All commands (14,187)

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

Show directories in the PATH, one per line
This version uses Pipes, but is easier for the common user to grasp... instead of using sed or some other more complicated method, it uses the tr command

Split a tarball into multiple parts
Create a tar file in multiple parts if it's to large for a single disk, your filesystem, etc. Rejoin later with `cat .tar.*|tar xf -`

Wait the end of prog1 and launch prog2

Alternative for basename using grep to extract file name
Here's a bash version.

how to find the active X (X11/xorg) username and DISPLAY variable
Requires consolekit (works in e.g. Ubuntu). Here x11-display is DISPLAY

See system users

send tweets to twitter (and get user details)
great for outputting tweets from cron jobs and batch scripts

list block devices
Shows all block devices in a tree with descruptions of what they are.

Last Minute Cheap Essay
Writing a paper is never an easy chore. When students start college, they are confronted with a variety of new situations, but one of the most difficult is completing projects before the deadline. Many students' physical and mental health can suffer as a result of pressure, stress, and anxiety. International students face significant difficulties because English is a difficult language for them. After lessons and long college hours, many students don’t have the time or energy to write extensive essays. Students can be seen juggling classes, jobs, social lives, and finding time for themselves. I need someone to write an essay for me, you might be thinking. Prepare to be surprised! With our assignment service, we can help you get rid of all of your troubles. We will write an A+ essay for you to ensure that you get good grades on your tasks.

Copy sparse files
This causes cp to detect and omit large blocks of nulls. Sparse files are useful for implying a lot of disk space without actually having to write it all out. http://en.wikipedia.org/wiki/Sparse_file You can use it in a pipe too: $ dd if=/dev/zero bs=1M count=5 |cp --sparse=always /dev/stdin SPARSE_FILE


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: