Much better alternatives - grep-alikes using perl regexps. With more options, and nicer outputs.
+ at the end means that many filenames will be passed to every chmod call, thus making it faster. And find own {} makes sure that it will work with spaces and other characters in filenames.
Benefit is that it doesn't make you keep the terminal open.
Sometimes you might need to have two copies of data that is in tar. You might unpack, and then copy, but if IO is slow, you might lower it by automatically writing it twice (or more times)
Alternatively: export MyVAR=84; awk '{ print ENVIRON["MyVAR"] }'
Will work with filenames with spaces inside. Will not break in case of someone making directory that matches *.pm. And sorts from largest. Where largest is file size, not line count.
First version was "ps uw -p $$", but current "ps -o comm= -p $$" just gives shell name
Output made so that it will match initial suggestion for this task. Personally, I think that output of du -h is more readable.
F[0] filters using first word. $F[1] - 2nd, and so on.
perl-less way
perl-based version
commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.
Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.
» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10
Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):
Subscribe to the feed for: