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

scp with compression.
-C is for compression.

Remove all zero size files from current directory (not recursive)
works only in zsh

Backup with versioning

Unlock your KDE4 session remotely (for boxes locked by KDE lock utility)
Do the unlock KDE screen saver locked session with lightdm display manager used in Kubuntu 12.10 +

premiumize - create a ddl & save the URL in variable MYLINK

Create a simple playlist sort by Genre using mp3info

Convert seconds to [DD:][HH:]MM:SS
Converts any number of seconds into days, hours, minutes and seconds. sec2dhms() { declare -i SS="$1" D=$(( SS / 86400 )) H=$(( SS % 86400 / 3600 )) M=$(( SS % 3600 / 60 )) S=$(( SS % 60 )) [ "$D" -gt 0 ] && echo -n "${D}:" [ "$H" -gt 0 ] && printf "%02g:" "$H" printf "%02g:%02g\n" "$M" "$S" }

Hide or show Desktop Icons on MacOS
Hides all Files and Folders on the MacOS Desktop. To show files and folders, type "true" instead of "false". "Finder" at the end is case sensitive, "finder" doesn’t work

Play awesome rythmic noise using aplay
Try modifying the numbers in the "(i*(i>>8|i>>9)&46&i>>8))^(i&i>>13|i>>6)" part. Crudely stolen from http://www.xkcdb.com/9067

Make a directory named with the current date
Create a directory named with the current date in ISO 8601 format (yyyy-mm-dd). Useful for storing backups by date. The --iso switch may only work with GNU date, can use format string argument for other date versions.


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: