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

Add a line from 1 file after every line of another (shuffle files together)
After every line in targetfile (empty lines included) insert in a line from addfile. "Save" results to savefile. Addfile should be longer than targetfile since this doesn't loop back to the top of addfile. /^/R addfile -- says for every line that matches "has a start of line" output a line from the file addfile. > savefile (optional) -- redirect output to savefile file.

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

know the current running shell (the true)
Return the current shell. It is better than print $SHELL which can sometimes return a false value.

Convert text to lowercase
Usage: lower [STRING]...

Rename .JPG to .jpg recursively
Recursively rename .JPG to .jpg using standard find and mv. It's generally better to use a standard tool if doing so is not much more difficult.

rgrep: recursive grep without .svn
Only excludes .svn from filenames.

Which .service related this file?
I use this as an alias to get all .service files related a single installed file/conf (if it has services, of course). For rpm based systems ;)

start a VNC server for another user

ping as traceroute
This command uses ping to get the routers' IP addresses to the destination host as traceroute does. If you know what I mean..

Generate pretty secure random passwords
These are my favourite switches on pwgen: -B Don't include ambiguous characters in the password -n Include at least one number in the password -y Include at least one special symbol in the password -c Include at least one capital letter in the password It just works! Add a number to set password length, add another to set how many password to output. Example: pwgen -Bnyc 12 20 this will output 20 password of 12 chars length.


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: