Commands using grep (1,935)

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

Converts to PDF all the OpenOffice.org files in the directory
Requieres unoconv (debian package)

Colorized grep in less
Get your colorized grep output in less(1). This involves two things: forcing grep to output colors even though it's not going to a terminal and telling less to handle those properly.

Watch RX/TX rate of an interface in kb/s
A shorter version

Monitor bandwidth by pid
Nethogs is a useful tool for monitor bandwidth consumption by pid. Tested on Debian an CentOs

Stop procrastination on Facebook.com
or echo '127.0.0.1 facebook.com' | sudo tee -a /etc/hosts Do not execute this command if you don't know what you are doing.

Say something out loud
Whatever arguments you pass will be spoken out loud. (Put it in a script or shell function.)

Printout a list of field numbers (awk index) from a CSV file with headers as first line.
Useful to identify the field number in big CSV files with large number of fields. The index is the reference to use in processing with commands like 'cut' or 'awk' involved.

Release memory used by the Linux kernel on caches
=1 --> to free pagecache =2 --> to free dentries and inodes =3 --> to free pagecache, dentries and inodes

Send an email from the terminal when job finishes
Might as well include the status code it exited with so you know right away if it failed or not.

Open Remote Desktop (RDP) from command line having a custom screen size
This example uses xfreerdp, which builds upon the development of rdesktop. This example usage will also send you the remote machine's sound.


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: