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.
» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10
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:
Throttle download speed
aria2c --max-download-limit=100K file.metalink
Throttle upload speed
aria2c --max-upload-limit=100K file.torrent
Axel
--max-speed=x, -s x
You can specify a speed (bytes per second) here and Axel will
try to keep the average speed around this speed. Useful if you
don?t want the program to suck up all of your bandwidth.
Image to text converter.
Convert your scanned book in image format like .png, .jpg into editable text format.
OCR ==> Optical Code Reader
xrandr --output <outputname> --brightness <value>
If the driver of your graphics card supports it, then you can use xrandr.
The following command lists the current configuration:
xrandr --current --verbose
If you want to change the configuration of an output, then you need the name of the output. This name is part of the output of xrandr --current, for example LVDS1.
The brightness can be changed like this:
xrandr --output <outputname> --brightness 0.8
Gamma:
xrandr --output <outputname> --gamma 0.5:1.0:1.0
Some times you may ban usb to protect thefting of your personal data.
Blacklist the usb_storage module by adding blacklist usb_storage to /etc/modprobe.d/blacklist.conf.
To load the module manually,
sudo modprobe usb_storage.
Syntax is
fatattr [+-hsra] [files]
The letters are...
h hidden
s system
r read only
a archive
Execute a process or list of commands in the given interval and output the difference in output.
Brightness indicator to be used in scripts that adjust brightness [especially sys that doesn't support automatically]
dbus-send --system --print-reply --dest="org.freedesktop.UPower" /org/freedesktop/UPower org.freedesktop.UPower.Suspend
set how many commands to keep in history
Default is 500
Saved in /home/$USER/.bash_history
Add this to /home/$USER/.bashrc
HISTFILESIZE=1000000000
HISTSIZE=1000000
Use optimized sed to big file/stream to reduce execution time
Use
sed '/foo/ s/foo/foobar/g' <filename>
insted of sed
's/foo/foobar/g' <filename>
Accidentally deleted some file while used by a program ? (Eg: a song)
Use this command to find the file handle and recover using
cp /proc/pid/fd/filehandle /new/recoverd-file.ext
EG: aspectRatio 1920 1200
For display a image in full screen it should be in any of the resolution obtained from the output. So resize an image to any of it and you can display it in full screen
For general aspect ratio :
aspectRatio () { for i in `seq 1 1000 `; do awk "BEGIN {print $1/$i, $2/$i}"; done |grep -v "\." |tail -1; }
Redshift will adjust the color temperature and protects eye at night
-b : will adjust the brightness