commandlinefu.com is the place to record those command-line gems that you return to again and again.
Delete that bloated snippets file you've been using and share your personal repository with the world. 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.
If you have a new feature suggestion or find a bug, please get in touch via http://commandlinefu.uservoice.com/
You can sign-in using OpenID credentials, or register a traditional username and password.
First-time OpenID users will be automatically assigned a username which can be changed after signing in.
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.
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:
Use sed to comment out any up/down bindings in zsh
if you still get a permissions error using sudo, then nano the file:
sudo nano -w /sys/block/sdb/queue/rotational
and change 1 to 0
says that this will "help the block layer to optimize a few decisions"
cd to the folder containing the wav files, then convert them all to flac. yeah baby!
in ubuntu, to get the flac program just:
sudo apt-get install flac
flac file input formats are wav, aiff, raw, flac, oga and ogg
Replace 'SHOWNAME' with the name of the TV show.
Add -n to test the command without renaming files.
Check the 'sample output'.
This command will disable the beep sound from the PC speaker.
Lets you set all the java alternatives at once to a matching version. Also has options for just changing the jre or the plugin.
Next time you are leaching off of someone else's wifi use this command before you start your bittorrent ...for legitimate files only of course.
It creates a hexidecimal string using md5sum from the first few lines of /dev/urandom and splices it into the proper MAC address format. Then it changes your MAC and resets your wireless (wlan0:0).
The title is optional.
-t: expire time in milliseconds.
-u: urgency (low, normal, critical).
-i: icon path.
On Debian-based systems you may need to install the 'libnotify-bin' package.
Useful to advise when a wget download or a simulation ends. Example:
wget URL ; notify-send "Done"
Displays only the VGA adapter/chipset being used for the graphics. In this case, it gave me the "M22" and "Mobility Radeon x300" that I needed to research a graphics issue I was having.
Reconfigures time zone in Ubuntu, which I cannot figure out how to do through the GUI. Worked like a charm to set my time zone to CEST from EDT.
'dpkg -S' just matches the string you supply it, so just using 'ls' as an argument matches any file from any package that has 'ls' anywhere in the filename. So usually it's a good idea to use an absolute path. You can see in the second example that 12 thousand files that are known to dpkg match the bare string 'ls'.
Ever since the switch to pulseaudio, Ubuntu users including myself have found themselves with no sound intermittently. To fix this, just use this command and restarts firefox or mplayer or whatever.
This command is useful when you want to install the same packages on another fresh OS install for example. To do that, use:
sudo dpkg --set-selections < LIST_FILE
release upgrades are major upgrades as from 8.04 to 8.10 or from 8.10 to 9.04
update-manager-core must be installed:
sudo apt-get install update-manager-core
in some cases you must edit '/etc/update-manager/release-upgrades' and set 'Prompt=normal'
cd into the directory that contains the file.
this is just the usual move command but shortcut'd.
say you wanted to move a photo img1.png from ~/photos/holidayphotos into the parent directory which is ~/photos
command would be:
~/photos/holidayphotos$ mv img1.png ..
I use Ubuntu so this'll work in debian but not sure what else.
Useful to e.g. keep an eye on several logfiles.
Compares two versions with dpkg. It is not always obvious what version dpkg/apt will consider to be more recent. Operators include the following :
* These treat an empty version as earlier than any version: lt le eq ne ge gt.
* These treat an empty version as later than any version: lt-nl le-nl ge-nl gt-nl.
* These are provided only for compatibility with control file syntax: < > >.
This command doesn't output anything. It only returns with status 0 or 1, hence the echo "y" || echo "n" to get an output.
Requires: imagemagick and graphviz
On Debian systems, displays a graph of package dependencies. Works also with other image formats, like svg :
apt-cache dotty bash | dot -T svg | display
On Debian systems, choose which command provides java. Works for all alternatives listed in /etc/alternatives.