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 files containing string and open in vim
I often use "vim -p" to open in tabs rather than buffers.

dd with progress bar and statistics to gzipped image
This is a useful command to backup an sd card with relative total size for piping to pv with a progressbar

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

Verify if ntpd is working properly
Used to verify if Network Time Protocol daemon is working properly.

Backup all MySQL Databases to individual files
Backs up all databases, excluding test, mysql, performance_schema, information_schema. Requires parallel to work, install parallel on Ubuntu by running: sudo aptitude install parallel

Which processes are listening on a specific port (e.g. port 80)
swap out "80" for your port of interest. Can use port number or named ports e.g. "http"

Pipe text from shell to windows cut and paste buffer using PuTTY and XMing.
Set up X forwarding in PuTTY, with X display location set to :0.0 Launch PuTTY ssh session. Launch Xming. Make sure that display is set to :0.0 (this is default). $ echo "I'm going to paste this into WINDERS XP" | xsel -i will insert the string into the windows cut and paste buffer. Thanks to Dennis Williamson at stackoverflow.com for sharing...

print line and execute it in BASH
If script.sh contains only these two lines: $ uname -a $ whoami

Making scripts runs on backgourd and logging output
Save all output to a log.

I finally found out how to use notify-send with at or cron
You can write a script that does this : $remind []


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: