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

Another way to calculate sum size of all files matching a pattern
Here the pattern is '*.jar', you could pass in any pattern. Another, maybe nicer way to do this is http://www.commandlinefu.com/commands/view/1921/summarise-the-size-of-all-files-matching-a-simple-regex You could replace sed with tr

Add temporary swap space
In addition to a swap partition, Linux can also use a swap file. Some programs, like g++, can use huge amounts of virtual memory, requiring the temporary creation of extra space.

Cheap iftop
Shows updated status in a terminal window for connections to port '80' in a human-friendly form. Use 'watch -n1' to update every second, and 'watch -d' to highlight changes between updates. If you wish for status updates on a port other than '80', always remember to put a space afterwards so that ":80" will not match ":8080".

Download Video & extract only a specific Time of it
Because this does not download more of the video than necessary, it is faster (especially with long videos).

Insert the last command without the last argument (bash)
$/usr/sbin/ab2 -f TLS1 -S -n 1000 -c 100 -t 2 http://www.google.com/ then $!:- http://www.commandlinefu.com/ is the same as $/usr/sbin/ab2 -f TLS1 -S -n 1000 -c 100 -t 2 http://www.commandlinefu.com/

List packages manually installed with process currently running
Sometimes we install programs, we forget about them, and they stay there wasting RAM. This one-liner try to find them.

easily strace all your apache *child* processes
Like the original version except it does not include the parent apache process or the grep process and adds "sudo" so it can be run by user.

full path listing in /directory/path/* of javascript files.
file listing in /directory/path/* of specific files such as javascript(js) .

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"

Find today created files


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: