Commands using egrep (220)

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

Hide comments
Hide comments and empty lines, included XML comments,

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"

Top 15 processes with the largest number of open files
See the summary.

One liner to kill a process when knowing only the port where the process is running
-k (kill option ) . To kill all processes accessing this port

Delete line number 10 from file
Very useful when the ssh key of a host has changed and ssh refuses to connect to the machine, while giving you the line number that has changed in ~/.ssh/known_hosts.

Create a 5 MB blank file via a seek hole
Similar to the original, but is much faster since it only needs to write the last byte as zero. A diff on testfile and testfile.seek will return that they are the same.

Retrieve a list of all webpages on a site
This spiders the given site without downloading the HTML content. The resulting directory structure is then parsed to output a list of the URLs to url-list.txt. Note that this can take a long time to run and you make want to throttle the spidering so as to play nicely.

Generate a random password 30 characters long

Broadcast your shell thru UDP on port 5000
Better solution in case of many clients, imo.

Cut flv video from minute 19 to minute 20 using flvtool2
We should calculate the video duration to milliseconds, 1 minute = 60000 milliseconds


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: