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

temporarily override alias of any command
say, someone has aliased ls to 'ls --color=always' and you want to temporarily override the alias (it does not override functions)

create an uncompressed tar file of each child directory of the current working directory
First, use find to find directories exactly one level below current directory, then create a tar file using the directory as the basename.

Change wallpaper

Force the script to be started as root
Will run the script as root and exit if the wrong or no password is given. Also will keep the parameters active if any where given.

Figure out what shell you're running

Generate random valid mac addresses
Python Alternative

copy ACL of one file to another using getfacl and setfacl
If you copy windows file in e.g. cygwin the ACL might miss on the copied file. With this command you can copy the ACL of an existing file to another. WARNING: Existing ACL will get lost.

Generate a random password 30 characters long

lsof - cleaned up for just open listening ports, the process, and the owner of the process
another formatting/oneliner for lsof User - Process - Port

bash auto-complete your screen sessions
this bash command sets it so that when you type "screen ", it searches your running screens, and present valid auto-complete choices. The output is . Note: You must have programmable completion enabled. Check with "shopt progcomp", set with "shopt -s progcomp"


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: