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

Show apps that use internet connection at the moment. (Multi-Language)
for one line per process: $ ss -p | cat for established sockets only: $ ss -p | grep STA for just process names: $ ss -p | cut -f2 -sd\" or $ ss -p | grep STA | cut -f2 -d\"

Adjust display hardware brightness [dbus way]

Display duplicated lines in a file
Displays the duplicated lines in a file and their occuring frequency.

Rename files in batch

Prettify XML in pipeline
xmllint2 comes with GNU libxml2 library. (based on: http://vim.wikia.com/wiki/Format_your_xml_document_using_xmllint)

Smart renaming
A powerfull way to rename file using sed groups. & stand for the matched expression. \1 referes to the first group between parenthesis. \2 to the second.

Produce a pseudo random password with given length in base 64

List PCI device with class and vendor/device IDs
This is a quick replacement for lspci if you need to know what's in a given system but pciutils is not installed. You then need something that can look up the IDs from pci.ids if you want the verbose output.

list files recursively by size

Batch file name renaming (copying or moving) w/ glob matching.


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: