Commands by mrwill (7)

  • this command will beep like an alarm for one minute from 18:57. you can change "1857" to your desired time. you should have alsa-oss package installed, and you should also be root or part of "audio" group.


    -1
    while true; do while [ `date +%H%M` == "1857" ] ; do sleep 1s; yes | head -n 2000 > /dev/dsp; done; done;
    mrwill · 2011-04-23 14:44:26 5

  • 0
    equery belongs $( which mv )
    mrwill · 2011-02-11 22:50:15 0

  • -3
    rename .txt .md *.txt
    mrwill · 2010-12-19 20:04:37 3
  • you should have the "most" package installed. I like it because it is colorful and easier to read. alternatively you can use "less" instead of "most". you can also add this to your ~/.bashrc to make it permanent.


    1
    export MANPAGER='most'
    mrwill · 2010-07-02 08:35:36 2

  • 0
    ifconfig eth0 | awk '/inet / {print $2}' | cut -d ':' -f2
    mrwill · 2010-06-30 08:52:01 0
  • 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 Show Sample Output


    1
    rpm -q --queryformat %{VERSION}\\n pkgname
    mrwill · 2010-06-03 01:54:17 0
  • you can also pipe it to "tail" command to show 10 most memory using processes. Show Sample Output


    13
    ps aux --sort=%mem,%cpu
    mrwill · 2009-10-10 22:48:51 0

What's this?

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.

Share Your Commands


Check These Out

Search commandlinefu.com from the command line using the API
just like the original - just colored and with less

Find usb device in realtime
Using this command you can track a moment when usb device was attached.

Print number of mb of free ram

happened to find this not bad software to keep my files and folders safe! Even the free trial version has the fantastic functions to protect any private files from being seen by anyone except me. With it I can encrypt, hide or lock anything I want, amazin
I noticed some spammer posted an advertisement here for "not bad" encryption. Unfortunately, their software only runs under Microsoft Windows and fails to work from the commandline. My shell script improves upon those two aspects, with no loss in security, using the exact same "military-grade" encryption technology, which has the ultra-cool codename "ROT-13". For extra security, I recommend running ROT-13 twice.

Colorful man
That command installs "most" and make this command as the default man reader. The "most" works like "less" (the current man reader), but it render colors for manpages and may do more things. Read "man most". You can see a preview here: http://www.dicas-l.com.br/dicas-l/20090718.php

Randomize lines in a file
Works in sort (GNU coreutils) 7.4, don't know when it was implemented but sometime the last 6 years.

Function to check whether a regular file ends with a newline
tail -c 1 "$1" returns the last byte in the file. Command substitution deletes any trailing newlines, so if the file ended in a newline $(tail -c 1 "$1") is now empty, and the -z test succeeds. However, $a will also be empty for an empty file, so we add -s "$1" to check that the file has a size greater than zero. Finally, -f "$1" checks that the file is a regular file -- not a directory or a socket, etc.

Find usb device in realtime
Using this command you can track a moment when usb device was attached.

How much RAM is Apache using?
Display the amount of memory used by all the httpd processes. Great in case you are being Slashdoted!

rename all images in folder with prefix of date and time from exif data
imagemagick is required


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.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

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: