Commands using ps (300)

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

convert filenames in current directory to lowercase
The simplest way I know.

Spawn a retro style terminal emulator.
Just note that ctrl+shift+t to make new tabs will not work with . Pair it with a terminal multiplexer like for the best experience.

Scan a gz file for non-printable characters and display each line number and line that contains them.
Scans the file once to build a list of line numbers that contain non-printable characters Scans the file again, passing those line numbers to sed as two commands to print the line number and the line itself. Also passes the output through a tr to replace the characters with a ?

Find Duplicate Files (based on MD5 hash) -- For Mac OS X
This works on Mac OS X using the `md5` command instead of `md5sum`, which works similarly, but has a different output format. Note that this only prints the name of the duplicates, not the original file. This is handy because you can add `| xargs rm` to the end of the command to delete all the duplicates while leaving the original.

A very simple and useful stopwatch
time read -sn1 (s:silent, n:number of characters. Press any character to stop)

Shows a specific process memory usage

Brute force discover
Show the number of failed tries of login per account. If the user does not exist it is marked with *.

Recursive find and replace file extension / suffix (mass rename files)
Find recursively all files in ~/Notes with the extension '.md' and pipe that via xargs to rename command, which will replace every '.md' to '.txt' in this example (existing files will not be overwritten).

Play radio stream with mplayer
Above command will play Virgin Radio Dubai

Retrieve the size of a file on a server
- Where $URL is the URL of the file. - Replace the $2 by $3 at the end to get a human-readable size. Credits to svanberg @ ArchLinux forums for original idea. Edit: Replaced command with better version by FRUiT. (removed unnecessary grep)


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: