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

Another way to calculate sum size of all files matching a pattern
Here the pattern is '*.jar', you could pass in any pattern. Another, maybe nicer way to do this is http://www.commandlinefu.com/commands/view/1921/summarise-the-size-of-all-files-matching-a-simple-regex You could replace sed with tr

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

Find files and calculate size of result in shell
Use find's internal stat to get the file size then let the shell add up the numbers.

list block devices
Shows all block devices in a tree with descruptions of what they are.

Remove all the files except abc in the directory
This is for zsh with extended globbing.

Sort files in folders alphabetically
Creates one letter folders in the current directory and moves files with corresponding initial in the folder.

list all hd partitions
Only one command and not dependant on full read access to the devices.

Rename files in batch

Show bash's function definitions you defined in .bash_profile or .bashrc
If you omit the function name, the command will display all definitions

mirrors directory to a ftp server
http://lftp.yar.ru/


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: