Commands by megrimm (0)

  • bash: commands not found

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

check open ports without netstat or lsof

Generate an XKCD #936 style 4 word password
The improvement of this command over Strawp's original alternative is that you can specify the size of the words, in this particular case words between 3 and 5 character's long. It also excludes words that contain apostrophes, if you'd rather keep those words simply substitue [^'] for .

pdfcount: get number of pages in a PDF file

Tells which group you DON'T belong to (opposite of command "groups") --- uses sed
special thanks to XwZ :)

Numerically sorted human readable disk usage
Provides numerically sorted human readable du output. I so wish there was just a du flag for this.

move up through directories faster (set in your /etc/profile or .bash_profile)
You can also remove the "&& pwd" if you don't want it to print out each directory as it moves up.

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"

Use all the cores or CPUs when compiling
Force make command to create as many compile processes as specified (4 in the example), so that each one goes into one core or CPU and compilation happens in parallel. This reduces the time required to compile a program by up to a half in the case of CPUs with 2 cores, one fourth in the case of quad cores... and so on.

Show directories
Show only the subdirectories in the current directory. In the example above, /lib has 135 files and directories. With this command, the 9 dirs jump out.

create an uncompressed tar file of each child directory of the current working directory
First, use find to find directories exactly one level below current directory, then create a tar file using the directory as the basename.


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: