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

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

Force unmount occupied partition
Alternative if "Lazy unmount" (umount -l) doesn't obey. Alternative for NFS: $ umount -f /media/sdb1 Use with caution: forcing to unmount a busy partition can cause data loss!

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

Delete files older than..
This command will delete files i a given path (/dir_name) , which older than given time in days (-mtime +5 will delete files older than five days.

Backup all mysql databases to individual files on a remote server
It grabs all the database names granted for the $MYSQLUSER and gzip them to a remote host via SSH.

Delete empty directories recursively

Simulate typing
this also generates errors (change 4 to higher number for more mistakes)

See where a shortened url takes you before click

Print all /etc/passwd lines with duplicated uid
Prints all the lines in /etc/passwd belonging to users with a duplicated uid. It also adds the hostname to the beginning of the line. It's been tested in AIX, Solaris and Linux.

The Chromium OS rootfs is mounted read-only. In developer mode you can disable the rootfs verification, enabling it to be modified.


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: