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 9

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

  • -3
    rename .txt .md *.txt
    mrwill · 2010-12-19 20:04:37 7
  • 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 9

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


    2
    rpm -q --queryformat %{VERSION}\\n pkgname
    mrwill · 2010-06-03 01:54:17 12
  • 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 9

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

backup delicious bookmarks
Useful script to backup all your delicious bookmarks. With decilicious shutting down soon , it could be useful

list block devices
Shows all block devices in a tree with descruptions of what they are.

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

Suppress output of loud commands you don't want to hear from
This works even if there are spaces in any word in the command line.

Watch the size of a directory using figlet
You can substitute /home/$USER with any path you like.

remove recursively all txt files with number of lines less than 10

Fast portscanner via Parallel

Which processes are listening on a specific port (e.g. port 80)
swap out "80" for your port of interest. Can use port number or named ports e.g. "http"

Redirect STDIN
Several times, I find myself hitting my up arrow, and changing the search term. Unfortunately, I find myself wasting too much time typing: $ grep kernel /var/log/messages Redirecting STDIN allows me to put the search term at the end so I less cursor movement to change what I'm searching for: $ < /var/log/messages grep kernel If you're using the emacs keyboard binding, then after you press your up arrow, press CTRL+w to erase the word. If this has already been submitted, I couldn't find it with the search utility.

Push a directory onto the stack
Use also with: Move to respective parameters == () { = +2; } === () { = +3; } ==== () { = +4; } Pop the last entry off the directory stack - () { popd ${1:+"$1"}; }


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: