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

Purge configuration files of removed packages on debian based systems
Purge all configuration files of removed packages

Recall “N”th command from your BASH history without executing it.

Find the process you are looking for minus the grepped one
Get the PID of a process by name

Get International Space Station sighting information for your city
This command outputs a table of sighting opportunities for the International Space Station. Find the URL for your city here: http://spaceflight.nasa.gov/realdata/sightings/

parse and format IP:port currently in listen state without net tools
Useful for containers and environments where you need to know if a port is currently in listen mode but you have not easy way or privileges to install net-tools like netstat or ss. "0A" is the code for listen state. The IP hex is reverse order and all in hex format.

Send apache log to syslog-ng
Send apache log to syslog-ng server without change configuration of syslog. Just add in httpd.conf or vhost conf.

Get full directory path of a script regardless of where it is run from
Also resolves symlinks, showing the full path of the link target

Display time of accounts connection on a system
Works on CentOS ad OpenBSD too, display time of accounts connection on a system, -p option print individual user's statistics.

Increment the filename of png in a given directory by one

geoip information
geoip from maxmind try to get the small utility via: apt-get install geoip


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: