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

add all files not under version control to repository
This should handle whitespaces well and will not get confused if your filenames have "?" in them

Insert the last argument of the previous command
for example if you did a: $ ls -la /bin/ls then $ ls !$ is equivalent to doing a $ ls /bin/ls

HourGlass
Displays an animated hourglass for x amount of seconds

gzip compression with progress bar and remaining time displayed

Install a basic FreeBSD system
Install a basic FreeBSD system on a distant server. I use this to install FreeBSD on servers that can only boot a Linux rescue system. This sytem loads on ram when booted, so it is possible to install freely. You can even install on ZFS root !

display a smiling smiley if the command succeeded and a sad smiley if the command failed
you could save the code between if and fi to a shell script named smiley.sh with the first argument as and then do a smiley.sh to see if the command succeeded. a bit needless but who cares ;)

Install pip with Proxy
Installs pip packages defining a proxy

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"

Renames all files in the current directory such that the new file contains no space characters.
This is a better version, as it does no command piping, uses for instead of while loops, which allows for a list of files in the current working directory to be natively processed. It also uses the -v/verbose option with mv to let you know what the command is doing. While the command does exactly the same in a better way, I would modify the sed option to replace spaces with underscores instead, or dashes. Please note that you'll receive errors with this command as it tries to rename files that don't even have spaces. This is an alternative to: http://www.commandlinefu.com/commands/view/8761/renames-all-files-in-the-current-directory-such-that-the-new-file-contains-no-space-characters.

Write on the console without being registered
http://www.linux-party.com/index.php/8157-escribir-en-la-consola-linux-sin-que-quede-registrado-en-el-history


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: