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

Merge tarballs
Requires the GNU tar ignore zeros option. http://www.gnu.org/software/tar/manual/html_section/Blocking.html

Use a Gmail virtual disk (GmailFS) on Ubuntu
Packages: gmailfs fuse-utils libfuse2 gvfs-fuse Config files: /etc/gmailfs/gmailfs.conf; ~/.gmailfs.conf (make a copy from the another one) Unmount: $ fusermount -u /mount/path/ /etc/fstab (Optional): none /mount/path/ gmailfs noauto,user[,username=USERNAME,password=PASSWORD,fsname=VOLUME] 0 0 NOTES: - The options between [] are optional since they already setuped on the config files. - The '-p' flag shows a prompt for the password entry. - It's necessary to add the user to the 'fuse' group. You can do that with: $ sudo chgrp fuse /dev/fuse and $ sudo usermod -a -G fuse USER - The volume name is not needed but highly recommended to avoid file corruption. Also choose a non-trivial name. - Google doesn't approve the use of Gmail account other than e-mail purposes. So, I recommend the creation of a new account for this.

Copy a directory recursively without data/files

small CPU benchmark with PI, bc and time.
$ # 4 cores with 2500 pi digits $ CPUBENCH 4 2500 $. $ every core will use 100% cpu and you can see how fast they calculate it. $ if you do 50000 digitits and more it can take hours or days

sed edit-in-place using -a option instead of -i option (no tmp file created)
does the -i option open a tmp file? this method does not.

Install a Firefox add-on/theme to all users
To install a theme use: $ sudo firefox -install-global-theme /path/to/theme You can get the .xpi or .jar file from the versions history on the add-on/theme page. NOTE: may not work in your system (Debian-based is an example).

Amazing real time picture of the sun in your wallpaper
Changes the wallpaper for the last IR picture of the sun taken by SOHO satellite. Lesser size, try $ curl http://sohowww.nascom.nasa.gov/data/realtime/eit_195/512/latest.jpg | xli -onroot -fullscreen -xzoom 120 -yzoom 120 -border black stdin I use inside kalarm(kde), updating every 15 minutes needs xli , curl

Quick glance at who's been using your system recently
This command takes the output of the 'last' command, removes empty lines, gets just the first field ($USERNAME), sort the $USERNAMES in reverse order and then gives a summary count of unique matches.

Find all the links to a file
This command finds and prints all the symbolic and hard links to a file. Note that the file argument itself be a link and it will find the original file as well. You can also do this with the inode number for a file or directory by first using stat or ls or some other tool to get the number like so: $ stat -Lc %i file or $ ls -Hid file And then using: $ find -L / -inum INODE_NUMBER -exec ls -ld {} +

Find name of package which installed a given shell command
Some command names are very different from the name of the package that installed them. Sometimes, you may want to find out the name of the package that provided a command on a system, so that you can install it on another system.


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: