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

Offcloud - add a link as remote download
You will get an json respond if all is fine

List the Sizes of Folders and Directories

shows history of logins on the server
perfect on a crashed system where you can't use commands like last. for investigation purposes wtmp file can be copied over to a different server and read with utmpdump

Create directory named after current date
Not a discovery but a useful one nontheless. In the above example date format is 'yyyymmdd'. For other possible formats see 'man date'. This command can be also very convenient when aliased to some meaningful name: $ alias mkdd='mkdir $(date +%Y%m%d)'

get all Google ipv4 subnets for a iptables firewall for example
a bit shorter, parenthesis not needed but added for clarity

Remove grep itself from ps
When you 'ps|grep' for a given process, it turns out that grep itself appears as a valid line since it contains the RE/name you are looking for. To avoid grep from showing itself, simply insert some wildcard into process' name.

Open a file with specified application.
This command require mac os x.

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"

Generate trigonometric/log data easily

Install pip with Proxy
Installs pip packages defining a proxy


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: