10 Unknown but Useful Linux Terminal Commands

Posted by jun auza On 5/30/2009
Before, I have posted here a few basic Linux terminal commands that I think are essential for newbies to know. I've also shared some deadly ones that should be avoided at all costs. This time, I'm going to show you several terminal commands that are perhaps unfamiliar to many new-to-Linux users but could be really handy when used properly.

Here’s a list of 10 rather unknown yet useful Linux terminal commands:

1. Kill a running application by its name:

killall [app_name]

2. Display disk space usage:

df –h

3. Locate the installation directories of a program:

whereis [app]

4. Mount an .iso file:

mount /path/to/file.iso /mnt/cdrom –oloop

5. Record or capture a video of your desktop:

ffmpeg -f x11grab -s wxga -r 25 -i :0.0 -sameq /tmp/out.mpg

6. Find out the Universally Unique Identifier (UUID) of your partitions:

ls /dev/disk/by-uuid/ -alh

7. Show the top ten running processes (sorted by memory usage):

ps aux | sort -nrk 4 | head

8. Make an audible alarm when an IP address goes online:

ping -i 60 -a IP_address

9. Run the last command as root:

sudo !!

10. Make a whole directory tree with one command:

mkdir -p tmp/a/b/c

Bookmark and Share

Related Posts:



29 Response to "10 Unknown but Useful Linux Terminal Commands"

  1. Andrew Said,

    I already know most of them but I especially find this interesting:

    "8. Make an audible alarm when an IP address goes online:"

    Thanks!

     


  2. Anonymous Said,

    You should add "For Noobs" in your title so guys like me don't waste time reading stuff like this just so that guys like you can get paid to write crap.

     

  3. Nick Said,

    I think on number 4, there should be a space between "-o" and "loop" like so:

    mount /path/to/file.iso /mnt/cdrom –o loop

     

  4. wodny Said,

    and:
    pgrep procname
    tail -f filename [filename]

     

  5. Anonymous Said,

    No need to write "for noobs" because it's labeled "for dummy" just before the comment section.

     

  6. Anonymous Said,

    There used to be a cli command to list the history or buffer of the commands previously typed. What is that?

     


  7. Anonymous Said,

    history.

     

  8. Anonymous Said,

    I tried the sudo !! command but I keep getting an error. It says user !! isn't found. Any ideas?

     

  9. Relst.nl Said,

    free -m is also handy

     

  10. Anonymous Said,

    Another unknown but useful CLI tool is 'apropos'.
    An example would be:

    apropos who

    Really useful when you know what command you need but forgot its name.

     

  11. Anonymous Said,

    Know most of them. some of my favourite shell tricks below:

    using ranges {..} in wildcards

    e.g 1. rm {A-Z}*
    e.g 2. mkdir {A-Z}/{1..9}

    e.g 3. mkdir 2009-05-{1..31}

    e.g 4. pkill fox

    e.g 5. whoami

    e.g 6. uname -a

    e.g.7. cd -


    e.g 1: deletes all letters starting with capital letter

    e.g 2: will create directories of A/1, A/2 ...Z/9

    e.g 3: mkdir will create directories 2009-05-1 ... 2009-05-31

    e.g 4. pkill [substring] will kill all process that contain [substring]

    e.g 5. self explanetory

    e.g 6 gives OS info
    You should have put Noob or beginner IN THE TITLE.

    e.g 7. switches to last working directory

     

  12. Doubletwist Said,

    Don't use killall! Use pkill. If you go to some other *nix OS's [say Solaris], killall doesn't take an argument. It just kills EVERYTHING! So don't get in the habit of using killall.

    Use pkill

     

  13. Grant Said,

    This last comment was far more useful than the article. Although #2 doesn't work.

     

  14. Anonymous Said,

    How about making it easier for people to use the apps instead of making them create a file to save the commands in!

     

  15. Ferk Said,

    I prefer pkill over killall... it is shorter to type and it will kill any aplication that matches the regular expresion you type.. you only need to type "pkill firef" to kill firefox

     

  16. razrlazr Said,

    Anonymous said: "You should add "For Noobs" in your title so guys like me don't waste time reading stuff like this just so that guys like you can get paid to write crap"




    Please...your hubris is only outdone by the likelihood you haven't bathed in a week.

    To the author--thanks. A couple of these will be useful.

     

  17. Sam Allen Said,

    Nice list, although some "cd" tricks are worth mentioning.

    cd by itself takes the current user back to their home folder,
    while cd - returns to the previous folder, when the last cd command was issued, while 2 dashes goes back twice, 3 dashes goes back three times, etc...

     

  18. Anonymous Said,

    Is killall really that unknown? Apart from that, this was insightful in most aspects.

     

  19. TDTwister Said,

    Great post thank you!
    For what I can remember I found references to killall only once for the past few years so I suppose it is sort of unknown.

     

  20. I was searching for that UUID for a long time. Now I can fix my fstab easily :)

     

  21. Raja Said,

    The ffmpeg command is particulaly interesting. THanks man!!!

     

  22. Anonymous Said,

    one of my favorites is the watch command

     

  23. dannybuntu Said,

    Always be careful of the sudo command. It can bring doom and gloom.

    Hi Jun!

    Sudo please change my link in your blogroll to http://www.dannybuntu.com

    I am no longer a bum!

    At long last I came out of my rock and started to learn how to make money online as a freelance writer

    Sa wakas.

    P.S. I put you in my G-old friends hehehe.

     

  24. SergioCY Said,

    In the tip 5 you can add -f oss -i /dev/dsp1 to capture desktop with audio.
    Like this:
    ffmpeg -f oss -i /dev/dsp1 -f x11grab -s wxga -r 25 -i :0.0 -sameq /tmp/out.mpg

    if dsp1 don't capture audio use dsp0.

     

  25. diego Said,

    what's the command for viewing the history of safari even if you erase it or do private browsing?

     

  26. Anonymous Said,

    Uh, exactly who doesn't know these? These are basic Linux commands. I vote also to add on "for noobs" to be tacked on there, as that's the only people who don't know these.

     

  27. Anonymous Said,

    This is total junk.

     

Post a Comment

Archive


"Action is the real measure of intelligence" ~Napoleon Hill

Twitter

Tumblr

Google +