Commands tagged filenames (2)

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

Get a brief overview of how many files and directories are installed
To start, you first need to make sure updatedb has been run/updatedb, and initialized the db: $ su -l root -c updatedb This locate command is provided through the mlocate package, installed by default on most GNU/Linux distributions. It's available on the BSDs as well. Not sure about support for proprietary UNIX systems. The output is self-explanatory- it provides an overview of how many directories and files are on your system.

Get version of loaded kernel module
Returns the version of the kernel module specified as "MODULENAME", when available.

Set up alarm with fade-in, for graceful awakening
There are a lot of commands, which invokes your player at specified time. But I prefer not to jump from by bed, when alarm start to play. Instead, this script increases volume of mpd over time, which much more pleasant when you just woke up :)

a function to create a box of '=' characters around a given string.
First argument: string to put a box around. Second argument: character to use for box (default is '=') Same as command #4962, cleaned up, shortened, and more efficient. Now a ' * ' can be used as the box character, and the variables get unset so they don't mess with anything else you might have. They marked c++ as a function for this command, but I'm not sure why. Must be a bug.

Check if a command is available in your system
Usefull to detect if a commad that your script relies upon is properly installed in your box, you can use it as a function function is_program_installed() { type "$1" >/dev/null } Invoke it and check the execution code is_program_installed "dialog" if [ ! $? -eq 0 ]; then echo "dialog is not installed" exit 1 fi

check open ports without netstat or lsof

A sorted summary of disk usage including hidden files and folders
Same result as with 'du -ks .[^.]* * | sort -n' but with size outputs in human readable format (e.g., 1K 234M 2G)

Fixes Centos 6.2 yum's metalink certificate errors
Fix's centos 6.2 yum's error: could not get metalink error was 14: PYCURL ERROR 77 - "Problem with the SSL CA cert (path? access rights?)" Error: Cannot retrieve metalink for repository: epel-source. Please verify its path and try again

File rotation without rename command
Rotates log files with "gz"-extension in a directory for 7 days and enumerates the number in file name. i.e.: logfile.1.gz > logfile.2.gz I needed this line due to the limitations on AIX Unix systems which do not ship with the rename command.

Set laptop display brightness
Run as root. Path may vary depending on laptop model and video card (this was tested on an Acer laptop with ATI HD3200 video). $ cat /proc/acpi/video/VGA/LCD/brightness to discover the possible values for your display.

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: