Commands by slappy (2)

What's this?

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.

Share Your Commands


Check These Out

repeat any string or char n times without spaces between
(here is character '+' repeated 80 times) Sometimes needed to enhance the title of the script.

Join the content of a bash array with commas
This type of join is clearly documented in the bash manual. Only the first character of IFS is used for the delimiter.

convert ascii string to hex
You can use "decode()" in a similar manner: $ python -c 'print "68656c6c6f".decode("hex")'

Diff remote webpages using wget

View Processeses like a fu, fu
I don't truly enjoy many commands more than this one, which I alias to be ps1.. Cool to be able to see the heirarchy and makes it clearer what need to be killed, and whats really going on.

Printout a list of field numbers (awk index) from a CSV file with headers as first line.
Useful to identify the field number in big CSV files with large number of fields. The index is the reference to use in processing with commands like 'cut' or 'awk' involved.

Finding all files on local file system with SUID and SGID set

Edit 2 or more files in vim using vim -d
Is this not the same

Short and elegant way to backup a single file before you change it.
Remember to backup everything before changing it so you can restore all to normal.

Watch how fast the files in a drive are being deleted
This can be useful when a large remove operation is taking place.


Stay in the loop…

Follow the Tweets.

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

Subscribe to the feeds.

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: