10 Interesting Linux Command Line Tricks and Tips Worth Knowing

If You Appreciate What We Do Here On TecMint, You Should Consider:

  1. Stay Connected to: Twitter | Facebook | Google Plus
  2. Subscribe to our email updates: Sign Up Now
  3. Get your own self-hosted blog with a Free Domain at ($3.45/month).
  4. Become a Supporter - Make a contribution via PayPal
  5. Support us by purchasing our premium books in PDF format.
  6. Support us by taking our online Linux courses

We are thankful for your never ending support.

Aaron Kili

Aaron Kili is a Linux and F.O.S.S enthusiast, an upcoming Linux SysAdmin, web developer, and currently a content creator for TecMint who loves working with computers and strongly believes in sharing knowledge.

Your name can also be listed here. Got a tip? Submit it here to become an TecMint author.

RedHat RHCE and RHCSA Certification Book
Linux Foundation LFCS and LFCE Certification Preparation Guide

You may also like...

35 Responses

  1. Stefan says:

    Better use tail -f rather than watch tail.

  2. Nick says:

    Yes, watch is a perfect command, but in this example you can use tail -f /var/log/auth.log

  3. Jim Forte says:

    Hi I think that the effective command to watch output from the end of a file name is ‘tail -f filename’. This is much less of a load on the system as well

  4. thanks says:

    afaik
    tail -f or -F
    is better for watching log files instead of watch.

  5. Mistiry says:

    Why would you do a watch on tail? Lol, -f does the same thing and will keep more than 10 lines on your screen. Horrible “tips” here.

  6. Martin says:

    Two things:
    sudo is an acronym for “Switch User then DO” not “SuperUser DO.” It’s an important distinction that most users don’t get. Look at the man page for the visudo and sudoers for more information (also, su means “Switch User” not “Super User”)

    Also, you don’t have to use watch with tail. The tail command has the -f option that does the same thing in real time in stead of evey two seconds.

    • Aaron Kili says:

      @Martin

      sudo elevates a users privileges to that of the target user(normally root) in order to execute a command or perform a given operation on the system, and su is used to switch to another user. Then i just discovered that tail actually has a switch to enable watching changes in a file in real-time.

      Many thanks for the useful response.

  7. J says:

    Instead of watch tail, most would probably be better suited with tail -f

  8. Alex says:

    watch tail is an overcomplication. Try tail -f filename.

  9. Raj says:

    You just removed owner privilege instead of others in the first example

  10. Technohacker says:

    I’d suggest an improvement to tip 9:

    tail has a flag “-f” for following files as they update. watch on the other hand, updates at a specific interval. it’s like polling vs. events

Got something to say? Join the discussion.

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.