Commands tagged grep (409)

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

Analyze awk fields
Breaks down and numbers each line and it's fields. This is really useful when you are going to parse something with awk but aren't sure exactly where to start.

Find out when your billion-second anniversary is (was).
This is the same command as this one, but for OS X. http://www.commandlinefu.com/commands/view/3053/find-out-when-your-billion-second-anniversary-is-was.

List every file that has ever existed in a git repository
What was the name of that module we wrote and deleted about 3 months ago? windowing-something? $ git log --all --pretty=format:" " --name-only | sort -u | grep -i window

(Git) Revert files with changed mode, not content
I sometimes (due to mismanagement!) end up with files in a git repo which have had their modes changed, but not their content. This one-liner lets me revert the mode changes, while leaving changed-content files be, so I can commit just the actual changes made.

Count threads of a jvm process
if you have problem threads problem in tomcat

remove comments from xml
xml with verbose commenting can be difficult to read. remove comments from xml.

mplayer -af scaletempo
Pitch-correct play speed with mplayer. You can also use [] and {} keys to change play speed on-the-fly.

Start a HTTP server which serves Python docs
I use this command to start a local Python document server over HTTP port 8888.

exec chmod to subfiles
Using `-exec cmd {} +` causes find to build the command using all matching filenames before execution, rather than once per file.

Get video information with ffmpeg
I used an flv in my example, but it'll work on any file ffmpeg supports. It says it wants an output file, but it tells what you want to know without one.


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: