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 8

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

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

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

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

List your interfaces and MAC addresses

List .log files open by a pid
Uses lsof to display the full path of ".log" files opened by a specified PID.

Lists the supported memory types and how much your board can support.

Make changes in .bashrc immediately available

Reset terminal that has been buggered by binary input or similar

Stream YouTube URL directly to MPlayer
A function for streaming youtube to mplayer. The option "-g" for youtube-dl tells it to output the direct video URL, instead of downloading the video. "-fs" tells MPlayer to go FullScreen, and "-quit" makes it less verbose. Requires: youdube-dl ( http://bitbucket.org/rg3/youtube-dl/ ) (Tested in zsh)

Get IP from host
I just wanted a simple DNS request. Because host and nslookup commands are not on all systems, we use getent instead. Thanks aulem for that tip.

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

One command line web server on port 80 using nc (netcat)
Very simple web server listening on port 80 will serve index.html file or whatever file you like pointing your browser at http://your-IP-address/index.html for example. If your web server is down for maintenance and you'd like to inform your visitors about it, quickly and easily, you just have to put into the index.html file the right HTML code and you are done! Of course you need to be root to run the command using port 80.

Getting the last argument from the previous command


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: