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

Find all SUID binaries

Automaticly cd into directory
Makes bash-4.x like zsh. Automatic cd into a directory if a command with that name doesnt exists. Ready for your ~/.bashrc file

Show git log beautifully
Only show a short of important information inline ( include branch info ), and color this log tree.

Get line number of all matches in a file

Change display resolution
-s must be a valid resolution. You can get a list of valid (and supported) resolutions via `xrandr`.

create SQL-statements from textfile with awk
inputfile.txt is a space-separated textfile, 1st column contains the items (id) I want to put into my SQL statement. 39 = charactercode for single tick ' $1 = first column If inputfile.txt is a CSV-file separated by "," use FS= to define your own field-separator: $ awk 'BEGIN {FS=","; }{printf "select * from table where id = %c%s%c;\n",39,$1,39; }' inputfile.txt

Compare a remote dir with a local dir
You can compare directories on two different remote hosts as well: $ diff -y

Find usb device in realtime
Using this command you can track a moment when usb device was attached.

Show when filesystem was created
Knowing when a filesystem is created , you can deduce when an operating system was installed . find filesystem device (/dev/) informations by using the cat /etc/fstab command.

Get information on your graphics card on linux (such as graphics memory size)
Loop is needed if you have more then one card.


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: