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:
I had problems in Ubuntu while trying to edit /etc/resolv.conf, even with sudo I couldn't make any change. After a 2 minutes search on google I found this command.
Hope someone finds it useful.
It works like chmod, with + and - to denote which attributes are being added and which are being removed.
See other attributes on man pages or on wikipedia http://en.wikipedia.org/wiki/Chattr
Limits the usage of bandwidth by apt-get, in the example the command will use 30Kb/s ;)
It should work for most apt-get actions (install, update, upgrade, dist-upgrade, etc.)
if you haven't already done so, install lame and flac:
sudo apt-get install lame flac
this also generates errors (change 4 to higher number for more mistakes)
Please install aria2c before you try the above command. On ubuntu the command to install aria2c would be:
sudo aptitude install aria2
This command will transcode a MythTV recording. The target device is a Google Nexus One mobile phone. My recordings are from a HDHomerun with Over The Air content. Plays back nicely on the N1.
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.