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 files that are older than x days
Find files that are older than x days in the working directory and list them. This will recurse all the sub-directories inside the working directory. By changing the value for -mtime, you can adjust the time and by replacing the ls command with, say, rm, you can remove those files if you wish to.

Prints new content of files
Useful to e.g. keep an eye on several logfiles.

list files recursively by size

Mutt - Change mail sender.

Batch Convert SVG to PNG
Convert some SVG files into PNG using ImageMagick's convert command.

Remove newlines from output
Remove newlines from output. One character shorter than awk /./ filename and doesn't use a superfluous cat. To be fair though, I'm pretty sure fraktil was thinking being able to nuke newlines from any command is much more useful than just from one file.

ps -ef | grep PROCESS | grep -v grep | awk '{print $2}' | xargs kill -9
kills all pids matching the search term of "PROCESS". Be careful what you wish for :)

Set access and modification timestamps of a file using another one as reference
atime and mtime timestamps of $FILE2 is changed according to the ones of $FILE1. If $FILE2 doesn't exist is created.

tcpdump from src to dst
then open with wireshark

Watch TCP, UDP open ports in real time with socket summary.


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: