I wish I would have known about dmidecode long before I found out about it.
What's the one Linux command you wish you knew years ago?
151–160 of 216 posts
Re: What's the one Linux command you wish you knew years ago?
#152slabtop
Re: What's the one Linux command you wish you knew years ago?
#153That reddit thread is delightful, because it is full of wonderful commands that I didn't know, or rarely use, or had forgotten. But it's also terrifying, because it exposes how many people will post questions before using man.
Many comments seem to be shell- and bash-related. Perhaps the thread exposes how difficult to read the bash manpage is. On my system, the bash 4.1 manpage is 41026 words long, or about 80 pages. Manpages are most useful to me when they are short and to-the-point so I can find what I am looking for before I lose interest in skimming through an 80 page book.
... gives you paginated manpages. I get about 96 pages for bash 4.1.5.
man -Tps bash > /tmp/bash.ps && gv /tmp/bash.ps
... gives you the manpage pretty-printed as postscript output (assumes you've got the gv ghostview viewer installed). Or you can use a PDF converter (e.g.: ps2pdf) and read with your preferred PDF viewer.
This version runs about 70 pages for the same manual.
Re: What's the one Linux command you wish you knew years ago?
#154100% agree with CTRL-R. It changed my life. Others that I love: screen, pdsh, perl -pi -e 's/find/replace/g' *.txt redis-cli's new ability to have piped in data be the last argument of a command. vim -o file1.txt file2.txt file3.txt (opening multiple files with vim) Using vim instead of less as a pager: cat file.txt | vim -
http://www.vim.org/scripts/script.php?script_id=1723 vimpager. Set vim as your pager. I love reading man pages in syntax-colored vim glory.
'most' will colorize bash output as well (it's strictly a pager, in the pg / more / less / most continuum).
Re: What's the one Linux command you wish you knew years ago?
#155100% agree with CTRL-R. It changed my life. Others that I love: screen, pdsh, perl -pi -e 's/find/replace/g' *.txt redis-cli's new ability to have piped in data be the last argument of a command. vim -o file1.txt file2.txt file3.txt (opening multiple files with vim) Using vim instead of less as a pager: cat file.txt | vim -
Re: What's the one Linux command you wish you knew years ago?
#156Earlier quoted context omitted.
'info bash' is much better than 'man bash', give it a try.
On my system, the info documentation for bash 3.1, not including indices, is 53610 words, or 105 pages. The content is identical to that in the manpage. In addition, you have to read it in a clunky, unintuitive, and un-Unixy browser. Far from short and to-the-point, I nearly lost interest just trying to figure out how to coax info to send its output to stdout so I could pipe the 105 page book to wc. The info document…
You can simply view the original file (it has minimal markup) in a pager for a single-file view. I generally write an "info" script or function to replace the info viewer with something more useful.
I share your dislike of the info format.
Re: What's the one Linux command you wish you knew years ago?
#157For me it was definitely find. I went through a ton of contortions to replicate its behavior several times before somebody knowledgeable clued me in. Also, `` and $(). Find combined with one of these is great. One of my favorite one-liners (I even figured it out myself :)) is: cat `find . --name *.java` | wc -l
Never thought to use ``. I always used xargs: find . -name *.java | xargs cat | wc -l
E.g.: I like dumping temporary files with timestamps:
some-command-to-generate-log > /tmp/log-$( date +%Y%m%d-%H%M%S )
Now, if I want to wrap that in a larger loop -- say, iterating over a number of files or parameters:
command $( expansion one $( expansion 2 ))
Works
With backticks you'd have to do escapes:
command `expansion 1 \`expansion 2\` `
... which gets tedious.
Re: What's the one Linux command you wish you knew years ago?
#158Nobody knows this: the bash extension $ diff -u Internally, bash creates a pipe and passes /dev/fd/XXX to the main command.
Re: What's the one Linux command you wish you knew years ago?
#159Earlier quoted context omitted.
Is tmux as available as screen? I often have to fix servers that are not from own group, so all my knowledge is honed around tools that i can find anywhere.
Perhaps not, but tmux's bindings are nearly all backwards-compatible with screen's. Well, the default escape char is ctrl-B but I (and I think most folks) just remap it to ctrl-A immediately.
Re: What's the one Linux command you wish you knew years ago?
#160Earlier quoted context omitted.
I was taken aback by one commenter whose command he wished he'd known for years was man, newly discovered by him. "All those years of googling, wasted." What happened that it's possible for someone to not know that it exists?
Google is what happened. Not to date myself, but when I was first learning (BSDi) UNIX Google didn't exist. The first thing the sys-admin who helped me said was, "type 'man'." These days most people just know that if they have an unanswered question, ask the Google.
And that also happened. It used to be virtually impossible to jump in alone, because someone had to create an account for you. It's now possible to start in Unix with no one's help. As long as you can figure out how to burn an iso to CD, you're in. The installation gives you an account, with sudo.
After you install CrunchBang, it pops up a terminal the first time you log in, and allows you to make additional choices that weren't made during install.
I think all distros should pop up a terminal upon first boot and direct you to read "man man."