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

Run the Firefox Profile Manager
even when another instance is already open. Great for testing purposes when you need to be 2 people at once on the same site.

Show whats going on restoring files from a spectrum protect backup
spectrum protect's dsmc command shows file names and total amount of restore. This command shows which files are actually open and their siz in GB and highlights the change to the previous output

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"

View files opened by a program on startup and shutdown
Run this before you run a command in order to see what the command does as it starts. The -c flag is useful here as the PID is unknown before startup. All config files, libraries, logs, ports, etc used by the command as it starts up, (and shuts down) will be captured at 1s intervals and written to a file. Useful for debugging etc.

Record active input of soundcard to file.wav
You'll need sox package in Debian/Ubuntu.

Switch 2 characters on a command line.
If you typed 'sl', put the cursor on the 'l' and hit ctrl-t to get 'ls'.

Create a backup of the file.
It will create a backup of the filename. The advantage is that if you list the folder the backups will be sorted by date. The command works on any unix in bash.

move all files older than 60 days to a folder

return external ip
curl inet-ip.info -> 113.33.232.62\n curl inet-ip.info/ip -> 113.33.232.62 curl inet-ip.info/json -> JSON print curl inet-ip.info/json/indent -> JSON pretty print curl inet-ip.info/yaml -> YAML format curl inet-ip.info/toml -> TOML format http://inet-ip.info

Create a directory and cd into it
This creates a bash function `take` that you can call with the name of the directory as the first parameter. Add the function to ~/.bashrc to have it available anytime.


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: