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

guitar synthesizer in one line of C
outputs a f=220Hz guitar string sound (fifth string A) needs ALSA

Watching Command
If you need to keep an eye on a command whose output is changing, use the watch command. For example, to keep an eye on your load average

about how using internal separate field and store file content on variable

Show what a given user has open using lsof

Emulate tail using awk.
This awk codes emulates tail. For efficiency it uses a circular array, which stores only N number of records. Using awk gives the flexibility of modifying the output as needed, for example adding the record number (NR) at the output and much more.

list files with last modified at the end

display ip address
add this alias in .bashrc to fast check the ip address of your modem router alias myip="curl -s http://myip.dk | grep '' | sed -e 's/]*>//g'"

Ping a URL sending output to file and STDOUT
The tee (as in "T" junction) command is very useful for redirecting output to two places.

Opens an explorer.exe file browser window for the current working directory or specified dir (Fixed)
This alternative either opens the current working directory by just issuing the open function in the commandline. Or you can specify what directory you would like to open. Example: open /cygdrive/c/Windows Usage: open [path] When no option is specified it will open the current working directory

Create a tar of directory structure only
The original suggestion did not work for me, when operating on folders located on an external mount (ie other than the root device) in Ubuntu. A variation using xargs does the trick.


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: