I wonder, how do you remember all the command line options? Recently I had this thought: maybe those people who can remember the options actually are autistic (don't know the proper word, that thing many geeks are deemed to be), and I am not. Remembering command line options might be like knowing large prime numbers within seconds. But I am also interested in memory techniques like the Loki method. Perhaps some good…
What's the one Linux command you wish you knew years ago?
201–210 of 216 posts
Re: What's the one Linux command you wish you knew years ago?
#202For 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
cat **/*.java | wc -lRe: What's the one Linux command you wish you knew years ago?
#203It's not a command but it is still useful. When you are typing a long command and you realize that you need to do other command or set of commands first, usually you type ctrl + c to cancel it. By default it does not save in the history. If you put # (comment the command) in front of the command (you can do it quickly with Ctrl + a #) and then you can use Ctrl + r to get it back. I'm sure there are other ways to save…
Re: What's the one Linux command you wish you knew years ago?
#204Nobody knows this: the bash extension $ diff -u Internally, bash creates a pipe and passes /dev/fd/XXX to the main command.
Just diff the two directories. $ ls a b a: 1 2 3 4 b: 1 2 3 # Yours: $ diff -u Maybe I'm missing something?
Re: What's the one Linux command you wish you knew years ago?
#205For 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
In zsh: cat **/*.java | wc -l
It's not as useful as find.
Re: What's the one Linux command you wish you knew years ago?
#206Earlier quoted context omitted.
The 'help' command is exactly what you're looking for -- e.g., 'help disown' will describe the 'disown' command. Definitely beats searching the entire bash man page for the command you want (which is what I did for far too long, until I found out about 'help').
Yeah, but it often isn't as long as a real man page. Plus for some reason zsh doesn't have it!
$ help "*"
will print out all shell built ins (list help for them). And if the short description is not enough, go google for each.
Re: What's the one Linux command you wish you knew years ago?
#207emacs --daemon (or after you start emacs, M-x server-start). This starts up the emacs server, so that it preserves your open files, and you can start new emacs instances immediately with emacsclient. (I actually symlink emacsclient to vi since it loads as fast as vi, which was one of the weakest points of emacs for me.) Very useful if you are using a remote box (like a vps) as your dev environment.
$ vim -h | grep -i server
--remote Edit in a Vim server if possible
--remote-silent Same, don't complain if there is no server
--remote-wait-silent Same, don't complain if there is no server
--remote-send Send to a Vim server and exit
--remote-expr Evaluate in a Vim server and print result
--serverlist List available Vim server names and exit
--servername Send to/become the Vim server
$Re: What's the one Linux command you wish you knew years ago?
#208Earlier quoted context omitted.
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.
On my MacBook the manpages scroll hellishly slow and there are no "Page Down" keys (maybe there is some key combo? I don't know). I end up googling for the manpages on the web instead most of the time...
Re: What's the one Linux command you wish you knew years ago?
#209Re: What's the one Linux command you wish you knew years ago?
#210Earlier quoted context omitted.
Dollar-paren expansion beats backticks for being nestable. 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 ge…
I like to use (for GNU date at least): $ date -Iseconds 2011-11-21T10:56:17+0000 because it requires less typing. The ISO 8601 standard format. -Is, -Im, -Ih, and -Id allow you to change the displayed resolution. Bizarrely, this doesn't seem to be documented in my version of date (coreutils 8.10).
That said, I can't find "-I" documented anywhere.
What I like about the timestamp I use is that it's semantic but sorts lexically as well. Though yours does as well. Hrm.