The dates in the output are Start Date, End Date, Days Remaining in warranty, respectively. This will only work if you are running it on a dell machine. You can substitute the dmidecode command with a service tag if you are not using a dell. Also, you have to either allow your user to run sudo dmidecode with no password or run this command as root. Show Sample Output
If you use the logfile feature of ddrescue, the data is rescued very efficiently (only the needed blocks are read). Also you can interrupt the rescue at any time and resume it later at the same point. http://www.gnu.org/software/ddrescue/ddrescue.html
This will look through file and print the data in between the pattern matches. It's great for restoring tables from a mysqldump backup. You can then import it back into your database with:
mysql -u <user> -h <host> <database> < restored_table.sql
Replace DOS character ^M with newline using perl inline replace.
Audio convert is a script that uses zenity and lame to transcode virtually any format to any other format provided you have the libraries installed to do so.
Tc is used to configure Traffic Control in the Linux kernel. See man tc for further details. This series of commands will limit the bandwidth of the specified device to the limit you set (300kbit in the second command) to the address you specify.
Using awk, find duplicates in a file without sorting, which reorders the contents. awk will not reorder them, and still find and remove duplicates which you can then redirect into another file.
Execute the most recent command containing search string. This differs from !string as that only refers to the most recent command starting with search string. Show Sample Output
This command will nicely dump a filesystem to STDOUT, compress it, encrypt it with the gpg key of your choice, throttle the the data stream to 60kb/s and finally use ssh to copy the contents to an image on a remote machine. Show Sample Output
This is very useful if you need to show someone some text from a distance. (Like someone standing over your shoulder...) I'd recommend aliasing it to something like: alias osd_cat="osd_cat -o 400 -s 8 -c blue -d 60 -f -*-bitstream\ vera\ sans-*-*-*--200-*-*-*-*-*-*-*" xosd is the utility that provides osd_cat.
Set the affinity of a process to a particular core(s). Arguments for processor include a comma separated list, or a range. (example: 1,2 or 0-3) You can use top in smp mode (Press 1) to see the changes to the affinity. Show Sample Output
Retrieve top ip threats from http://isc.sans.org/sources.html and add them into iptables output chain.
Due to the recent dynamic update vulnerability with bind, I was forced to dig a little deeper into dig... Show Sample Output
Knock on ports to open a port to a service (ssh for example) and knock again to close the port. You have to install knockd. See example config file below. [options] logfile = /var/log/knockd.log [openSSH] sequence = 3000,4000,5000 seq_timeout = 5 command = /sbin/iptables -A INPUT -i eth0 -s %IP% -p tcp --dport 22 -j ACCEPT tcpflags = syn [closeSSH] sequence = 5000,4000,3000 seq_timeout = 5 command = /sbin/iptables -D INPUT -i eth0 -s %IP% -p tcp --dport 22 -j ACCEPT tcpflags = syn
This set of commands will rip a dvd title using a 2 pass mencoder xvid encode. It will provide a great quality rip. It will rip as close to 700MB as possible. (note the bitrate of -700000) Enjoy!
This set of commands will rip a dvd title using a 2 pass mencoder xvid encode. It will provide a great quality rip. It will rip as close to 700MB as possible. (note the bitrate of -700000) Enjoy!
Remove annoying improperly packaged files that untar into the incorrect directory. Example, When you untar and it extracts hundreds of files into the current directory.... bleh.
This is great if you are behind a router that does not support dynamic dns updates! Example: AT&T u-verse gateway... Put this in a script and run it as a cron job.
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.
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: