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

Create a backup of the file.
It will create a backup of the filename. The advantage is that if you list the folder the backups will be sorted by date. The command works on any unix in bash.

Bash function that saves bash functions to file from shell session
The simpler, 1-arg version is save_function(){ { date +"# %F.%T $1; declare -f "$1";}| tee -a ~/.bash_functions; }`

list all hd partitions
Only one command and not dependant on full read access to the devices.

Search files with js declarations inside
Useful to crawl where the javascript is declared, and extract it a common file. You can redirect it to a file to review item by item.

the executable that started the currently running oracle databases and the ORACLE_HOME relative to each
get a list of currently running oracle dbs (identified by the pmon process) show the executable that spawned the process and show the ORACLE_HOME relative to the environment within which the process is running tailored to AIX (sed on linux behaves...differently) suggestions for a better way...please.

directory size with subdirectories, sorted list

Get debian package names corresponding to latex packages used in a document

Set laptop display brightness
Run as root. Path may vary depending on laptop model and video card (this was tested on an Acer laptop with ATI HD3200 video). $ cat /proc/acpi/video/VGA/LCD/brightness to discover the possible values for your display.

geoip information
Show external IP and geolocation information. Primary feature is the use of tee to echo IP _and_ send to geoiplookup command...Use IP as input for as many commands as you want with more >( [command] ) Thanks to http://www.commandlinefu.com/commands/view/6334/ Requires MaxMind DB and geoiplookup tool. Sample output has IP obfuscated on first line, lines 2-4 from having MaxMind Country && MaxMind City DBs installed

Create a mirror of a local folder, on a remote server
Create a exact mirror of the local folder "/root/files", on remote server 'remote_server' using SSH command (listening on port 22) (all files & folders on destination server/folder will be deleted)


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: