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 the location of the currently loaded php.ini file

Find 'foo' string inside files

Screencast of your PC Display with mp4 output
Since ffmpeg on Ubuntu is deprecated, now there is avconv. Please note that the screen area here is set with a predefined format "-s wxga" that is corresponding to "-s 1366x768") There is also the option to add a title in the metadata of the resulting video.

(Debian/Ubuntu) Discover what package a file belongs to
Works similar to dpkg -S, but uses the locatedb and is thus inarguably a lot faster - if the locatedb is current.

Watch movies in your terminal
requires mplayer

How to backup hard disk timely?
'data' is the directory to backup, 'backup' is directory to store snapshots. Backup files on a regular basis using hard links. Very efficient, quick. Backup data is directly available. Same as explained here : http://blog.interlinked.org/tutorials/rsync_time_machine.html in one line. Using du to check the size of your backups, the first backup counts for all the space, and other backups only files that have changed.

convert from hexidecimal or octal to decimal
Bash can accept '0x' and '0' notation for hexidecimal and octal numbers, so you just have to output the values.

Updating the status on identi.ca using curl.
identica is an open source social networking and micro-blogging service. Based on Laconica, a micro-blogging software package built on the OpenMicroBlogging specification. http://identi.ca/

View the current number of free/used inodes in a file system
tune2fs also provides the same information . But the information does not give the current usage , it gives the information when the file system was last mounted. http://www.zaman4linux.in/2010/10/using-up-all-the-free-inodes.html

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"


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: