Commands by gustavgans (1)

What's this? 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.

Share Your Commands

Check These Out

Print a random 8 digit number
Don't need to pipe the output into rs if you just tell jot to use a null separator character.

List files with full path

IBM AIX: Extract a .tar.gz archive in one shot

Show a Package Version on RPM based distributions
if you want to see all information about a package use: rpm -qi pkgname full list of querytags can be accessed by the command: rpm --querytags you can also customize the query format how ever you like with using more querytags together along with escape sequences in "man printf"! you can also use more than one package name. for example this command shows name and version in to columns: rpm -q --queryformat %-30{NAME}%{VERSION}\\n pkg1 pkg2

commandline dictionary
Note: 1) Replace 'wonder' with any word you looking the meaning for in the above example 2) Need to install these packages: wordnet & wordnet-base (latter should be automatically installed because of dependency) 3) Combined size of packages is about 30MB on my old ubuntu system (I find it worth it)

Convert a videos audio track to ogg vorbis.
Assumes you have ffmpeg and oggenc. Similar to other scripts here, but this time outputting to Ogg Vorbis. I added the variable assignment for a nice output name. This is part of an interactive bash script I have with a few little multimedia tasks in it.

Prevent overwriting file when using redirection
If you set noclobber to on, bash won't allow redirection to overwrite existing files . $ set -o noclobber command turn the option on (default it s off ) . You can still append information but not overwrite the file .to turn it back off use : $ set +o noclobber . I use it because i overwrite a file by accident , after thought , content of the file was very important , creating a one more file mean nothing for my hard disk (we are not anymore on the 64 k memory time) , but content of file is far much important . What we call exeprience :(

translate with google, get all translations
the google-api gives you only one translation which is sometimes insufficent. this function gives you all translations, so you can choose which one fits best.

Quickly analyse an Apache error log
This searches the Apache error_log for each of the 5 most significant Apache error levels, if any are found the date is then cut from the output in order to sort then print the most common occurrence of each error.

Testing php configuration

Stay in the loop…

Follow the Tweets.

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.


Subscribe to the feeds.

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: