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

Replace space in filename
This commands removes space from all the files with specific extension. I've specifed *.jpg as an example.

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"

Install pip with Proxy
Installs pip packages defining a proxy

Get current stable kernel version string from kernel.org
depends on "jq" This is more reliable in my opinion.

Capitalize first letter of each word in a string
Capitalize first letter of each word in a string.

Display Dilbert strip of the day
Requires display. Corrected version thanks to sputnick and eightmillion user.

How to run X without any graphics hardware
This starts an X server using Xvfb(1) (no graphics hardware required), then starts a VNC server on the display. Change :1 if there's a conflict with an existing display, and change 800x600x24 to suit your tastes (24 is the bit depth, 800x600 is the size). This command obviously requires X be installed, and also x11vnc(1); both are available via your favourite package manager. You can also use another VNC server of your choosing, as long as DISPLAY is set to the display of Xvfb(1). To change your desktop environment (the default is twm(1), which is rather fail), you can add it to your ~/.xinitrc file (see the startx(1) manpage for details).

commentate specified line of a file
used when modify several configuration files with a single command

Scan for new SCSI devices
Issues a scan command on the given scsi host adapter (ex. a fibre channel adapter, in the example above on host0). Output can be watched in the messages log or in "dmesg"

Copy via tar pipe while preserving file permissions (run this command as root!)
It's the same like 'cp -p' if available. It's faster over networks than scp. If you have to copy gigs of data you could also use netcat and the tar -z option in conjunction -- on the receiving end do: # nc -l 7000 | tar -xzvpf - ...and on the sending end do: # tar -czf - * | nc otherhost 7000


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: