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

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

get some information about the parent process from a given process

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.

Clear the terminal screen

Find the process you are looking for minus the grepped one
preferred way to query ps for a specific process name (not supported with all flavors of ps, but will work on just about any linux afaik)

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

Get all shellcode on binary file from objdump
Better than the others, and actually works unlike some of them.

Print all open regular files sorted by the number of file handles open to each.
List all open files of all processes. . $ find /proc/*/fd Look through the /proc file descriptors . $ -xtype f list only symlinks to file . $ -printf "%l\n" print the symlink target . $ grep -P '^/(?!dev|proc|sys)' ignore files from /dev /proc or /sys . $ sort | uniq -c | sort -n count the results . Many processes will create and immediately delete temporary files. These can the filtered out by adding: $ ... | grep -v " (deleted)$" | ...

Count the number of queries to a MySQL server

Key binding to search commandlinefu.com
This is a simple bash function and a key binding that uses commandlinefu's simple and easy search API. It prompts for a search term, then it uses curl to search commandline fu, and highlights the search results with less.


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: