Commands by sanjaygoel (1)

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

clear the X clipboard
Clears your clipboard if xsel is installed on your machine. If your xsel is dumb, you can also use $xsel --clear --clipboard

Change pidgin status
Changes pidgin status using its dbus interface. The status code can be obtained using command #4543.

Download Entire YouTube Channel - all of a user's videos
create the function then run 'yt-chanrip username' to download that user's entire channel. uses youtube-dl and the GData API. similar to http://www.commandlinefu.com/commands/view/3154/download-youtube-playlist

Re-read partition table on specified device without rebooting system (here /dev/sda).

Start COMMAND, and kill it if still running after 5 seconds

Restore mysql database uncompressing on the fly.
This way you keep the file compressed saving disk space. Other way less optimal using named pipes: mysql -uroot -p'passwd' database <

Convert IP octets to HEX with no dots.
Converts IP octets to hex using printf command. Useful for generating pxeboot aliases in the pxelinux.cfg folder.

remove oprhan package on debian based system

Remount root in read-write mode.
Saved my day, when my harddrive got stuck in read-only mode.

Never rewrites a file while copying (or moving)
Allows you to preserve your files when using cp, mv, ln, install or patch. When the target file exists, it will generate a file named XXX.~N~ (N is an auto-incremental number) instead of deleting the target 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: