What's Your Command Line Judo?
lousyd asks: "We all have our CLI amor. That two- or three-letter command that fiddles our heartstrings. 'mv' is pedestrian, but 'mmv' is so cool. 'cp' can lug bits around all day to no applause, but 'cpio' will excite even the most jaded of command line linguists. 'How perfect!' you exclaim. So what's your poison? What turns you on? What little known command performs just the right function for you?"
Every person I see using linux clears the screen by typing CLS. The key combo "CTRL + L" is so much sexier.
Hacker Media
I'm not much of a linux guru, so my favorite is simple.
skill
s-kill, basically, kills a process by name. "skill netscape" will kill netscape, no finding proc ID required. It's what kill should have been from the beginning.
The only command I love more than skill is apt-get, but that doesn't really count.
The ______ Agenda
First, I must comment the article. Question goes What little known command performs just the right function for you? I hope all sane people here (haha) would answer "None". There's no command that does just the right function since there's no one The Function. It depends on the situation what the function is. And in that case, per Unix philosophy, where one tool does one simple job, but does it well, you should choose the tool accordingly.
/etc to this new IP address. First you might think searching all the files under /etc with find(1), then passing the list of files to grep(1) and then manually editing the places where the old IP address was found with your $EDITOR. That's fine and will get the job done and all but what if you could just edit the files in place? With perl, you can.
/etc -type f`
:)
Enough of that. If you really must name something, then, in my opinion, there's one gizmo above others. And that is
perl
Perl one-liners is a damn powerful concept when you get it. Say one of your boxen switches IP address. You want to replace all references in files under
perl -pne's/oldip/newip/g' -i `find
and you're done (better be extra careful with commands like that for obvious reasons!). Of course you're able to do the same thing with other tools too, but I don't think it could be much easier than that. And naturally you're not just limited to simple search and replace of text, you have the full power of Perl (and CPAN!) at your disposal.
Besides being my number one choice for creating complex scripts and small applications, Perl has very special place in my command line toolbox just next to the old friends such as grep(1), cut(1), wc(1), etc. and a huge pile of pipes
Why waste your time fighting with DOS commands?
UNIX Utils, Natively Compiled for Windows
That's great. Now, create a directory called " " (empty space). Inside that, create a directory called " -rf " ("-rf" with an empty space on either side). Inside that, create a file named " " (yet another empty space). Now, watch in horror as find prints "./ -rf /", which it passes dutifully to "rm -f". Since xargs by default passes each word as an individual argument, that expands to:
Hope you weren't running as root! The moral of this story is to never, never! use find/xargs without the "-print0" option whenever the command you're executing is destructive. "ls" is probably OK. "rm" definitely isn't.
Dewey, what part of this looks like authorities should be involved?