All commands (14,187)

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

Purge configuration file of all desinstalled package
From: http://www.debian-administration.org/users/fsateler/weblog/4

enumerate with padding
bash2 : for X in $(seq 1 5); do printf "%03g " "$X";done bash3 : for X in {1..5}; do printf "%03g " "$X";done bash4 : echo {001..5}

Burn CD/DVD from an iso, eject disc when finished.
cdrecord -scanbus will tell you the (x,y,z) value of your cdr (for example, mine is 3,0,0)

Count Files in a Directory with Wildcards.
Remove the '-maxdepth 1' option if you want to count in directories as well

quickly backup or copy a file with bash

Print a random 8 digit number
Don't need to pipe the output into rs if you just tell jot to use a null separator character.

Terminal - Show directories in the PATH, one per line with sed and bash3.X `here string'
another method : awk '{gsub(/:/, "\n");print}'

Insert the last argument of the previous command
for example if you did a: $ ls -la /bin/ls then $ ls !$ is equivalent to doing a $ ls /bin/ls

Convert CSV to JSON
Replace 'csv_file.csv' with your filename.

Create a new file


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: