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

pimp text output e.g. "Linux rocks!" to look nice

Create a mirror of a local folder, on a remote server
Create a exact mirror of the local folder "/root/files", on remote server 'remote_server' using SSH command (listening on port 22) (all files & folders on destination server/folder will be deleted)

Optimal way of deleting huge numbers of files

Find the process you are looking for minus the grepped one
faster ;) but your idea is really cool

Get the full path to a file
Useful in scripts when the file is passed in as an argument. Eg. $ filepath=$(realpath $1)

Lookup your own IPv4 address

Prevent shell autologout
Unset TMOUT or set it to 0 in order to prevent shell autologout. TMOUT is the number of seconds after which the present shell will be killed if it has been idle for that long.

Encrypt every file in the current directory with 256-bit AES, retaining the original.
The password is stored in the password file, which obviously must be kept secure, encrypted later with gpg, deleted, or whatever you prefer. To decrypt: $ openssl enc -d -aes-256-cbc -salt -in filename.enc -out filename -pass file:/path/to/password-file Alternative ciphers can be used, of course.

create dir tree
create tree of dir's in one command

Find Out My Linux Distribution Name and Version
Another way of do it in debian like distros, don't know if works for others


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: