This simple command will copy a DVD losslessly to your drive and remove the encryption.
https://www.magnatune.com depends on unp but does not need to but unp is the easiest way to unpack any archive. it's in Debian repo's. !note: it deletes flac zip when done, if successful. Show Sample Output
Rearrange pdf document coming from a simplex document feed scanner, feeded first with odd pages, then with even pages from the end. Needs pdftk >1.44 w/ shuffle. Similar to http://www.commandlinefu.com/commands/view/7965/pdf-simplex-to-duplex-merge where there are 2 separate documents, odd and even
does it's better ? Show Sample Output
Strips the non-ip information from the dig output. Could be combined with "head -1" to ensure a single ip is returned. Useful for outputting as a variable for use in scripts. Show Sample Output
When need to pack the ZODB...
This command is suitable to use as application launching command for a desktop shortcut. It checks if the application is already running by pgrepping its process ID, and offer user to kill the old process before starting a new one. It is useful for a few x11 application that, if re-run, is more likely a mistake. In my example, x2vnc is an x11 app that does not quit when its connection is broken, and would not work well when a second process establish a second connection after the first broken one. The LC_ALL=C for xmesseng is necessary for OpenSUSE systems to avoid a bug. If you don't find needing it, remove the "env LC_ALL=C" part
This let me find some a set of modifications that were made to a rather large tree of files, where the file-names themselves were not unique (actually: insanely redundant and useless. "1.dat 2.dat ..."). Pruning down to last-branch brough things back to the "project-name" scope, and it's then easy to see which branches of the tree have recently changed, or any other similar search. Ideally, it should sort the directories by the mtime of the most recent *file* *inside* the directory, but that's probably outside the scope of a (sane...) command line.
This command will "su" the execution of the command to the postgres user(implies that you are already logger as root), and export the result of the query to a file on the csv format. You'll need to adequate the fields and database information to one of your choice/need. Show Sample Output
In the field, I needed to script a process to scan a specific vendor devices in the network. With the help of nmap, I got all the devices of that particular vendor, and started a scripted netcat session to download configuration files from a tftp server. This is the nmap loop (part of the script). You can however, add another pipe with grep to filter the vendor/manufacturer devices only. If want to check the whole script, check in http://pastebin.com/ju7h4Xf4 Show Sample Output
You may use another wordlist generator as regldg or whatever ./regldg '--debug-code=1' '--universe-set=7' '--universe-checking=3' '--max-length=8' '--readable-output' '--num-words-output=100' "(B|b)(n|N)(g|G)(4|a|A)(l|L)"
Works almost every time.
i'm using -x : -x, --one-file-system skip directories on different file systems so mounts points aren't walked trough Show Sample Output
In this example, I’m creating a wrapper for apt-get that assumes yes every time — but the command could be anything.
It uses curl --url-encode to encode long URLs *properly* and parses XML with xmlstarlet. If ~/.bitlyrc were to contain login:apikey then a script could read the apiKey and login from ~/.bitlyrc like so: login=$(sed 's/:.*//' < $HOME/.bitlyrc) apikey=$(sed 's/[^:]*://' < $HOME/.bitlyrc) curl -s --data-urlencode 'longUrl='$1 --data-urlencode 'login='$login --data-urlencode 'apiKey='$apikey 'http://api.bit.ly/shorten?version=2.0.1&format=xml' | xmlstarlet sel -T -t -m "//shortUrl" -v "." | line Show Sample Output
Can be installed in the root crontab if you want it to update your motd. If not on ubuntu you need to change /usr/share/cowsay/cows/* to the location of your cow files. Show Sample Output
a typical X11vnc command
In case sed and awk are not available you may use this to remove the last character from a string with "rev" and "cut". Show Sample Output
Instead of zeroing the filesystem, this command overwrites N times (default is 3) the disk content, making data recovery much harder. The command accepts many more options
Put this in your bash startup script so you can quickly remember the top rated commands on CommandLineFu's website. Put it in .bashrc on Linux, or .bash_profile on OSX. Show Sample Output
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: