Commands by ergut (1)

  • This command would be useful when it is desirable to list only the directories. 'egrep' chooses only the lines that begin with 'd'. Show Sample Output


    3
    ls -l | egrep ^d
    ergut · 2009-02-08 22:21:55 4

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

Using mplayer to play the audio only but suppress the video
Sometimes you only want to linsten the audio while output the video will be a waste of CPU resource and an annoying window. With option -vo null, you will enjoy the audio!

Copy a file structure without files
Taken from: http://www.webmasterworld.com/forum40/1310.htm

Get Futurama quotations from slashdot.org servers
slashdot.org webserver adds an X-Bender or X-Fry HTTP header to every response!

Which processes are listening on a specific port (e.g. port 80)
swap out "80" for your port of interest. Can use port number or named ports e.g. "http"

Convert current symbolic directory into physical directory

Install pip with Proxy
Installs pip packages defining a proxy

Countdown Clock
Simple countdown clock that should be quite portable across any Bourne-compatible shell. I used to teach for a living, and I would run this code when it was time for a break. Usually, I would set "MIN" to 15 for a 15-minute break. The computer would be connected to a projector, so this would be projected on screen, front and center, for all to see.

Grep only files matching certain pattern (Advanced)

View a file with less, starting at the end of the file
The same as typing 'less filename' then 'G' or '>' or the END key. Comes in handy with shell scripts or aliases: alias weblog='less +G /var/log/httpd/access_log' alias errlog='less +G /var/log/httpd/error_log'

print file without duplicated lines usind awk
show file withou duplicated lines


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: