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

Record MP3 audio via ALSA using ffmpeg
Record audio to an MP3 file via ALSA. Adjust -i argument according to arecord -l output.

Set GIT_COMMITTER_DATE = GIT_AUTHOR_DATE for all the git commits

Convert seconds to [DD:][HH:]MM:SS
Converts any number of seconds into days, hours, minutes and seconds. sec2dhms() { declare -i SS="$1" D=$(( SS / 86400 )) H=$(( SS % 86400 / 3600 )) M=$(( SS % 3600 / 60 )) S=$(( SS % 60 )) [ "$D" -gt 0 ] && echo -n "${D}:" [ "$H" -gt 0 ] && printf "%02g:" "$H" printf "%02g:%02g\n" "$M" "$S" }

git diff of files that have been staged ie 'git add'ed

grab all of google IPv4 network blocks

Extract the contents of an RPM package to your current directory without installing them.
This assumes you have the 'rpm', 'rpm2cpio' and 'cpio' packages installed. This will extract the contents of the RPM package to your current directory. This is useful for working with the files that the package provides without installing the package on your system. Might be useful to create a temporary directory to hold the packages before running the extraction: $ mkdir /tmp/new-package/; cd /tmp/new-package

vim easter egg
inside vim try: :help 42 to get the meaning of life, the universe and everything !

Insert an element into xml
This inserts an element as last child under /breakfast_menu/food in simple.xml. xml used - http://www.w3schools.com/xml/simple.xml

List process in unkillable state D (iowait)

exit without saving history
this exits bash without saving the history. unlike explicitly disabling the history in some way, this works anywhere, and it works if you decide *after* issuing the command you don't want logged, that you don't want it logged ... $$ ( or ${$} ) is the pid of the current bash instance this also works perfectly in shells that don't have $$ if you do something like $ kill -9 `readlink /proc/self`


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: