RSS

Useful Linux Commands: Part II

15 Sep

Linux Tools

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

This post will continue from Useful Linux Commands: Part I and list the commands which I found useful in Linux environment.

Must mention the greatness of the Linux command line tools especially its various thoughtful switches/options. It makes the life of developers very easy and saves a lot of time. More importantly it helps people like me to continue to be lazy (did I say smart!?!)..

  1. List the file names which have a pattern
    • grep -rl "my_pattern" "my_path"
    • Usage:

    • grep -rl "couldn't read file" */*/my_log

  2. List the contents of a directory (only two levels down – for sub directories)
    • tree -L 2 "my_path"
    • Usage:

    • tree -L 2 ./
    • tree -L 2 /home/$USER/some_dir

Advertisements
 
3 Comments

Posted by on September 15, 2011 in Linux, Technical

 

Tags: , ,

3 responses to “Useful Linux Commands: Part II

  1. ripple

    September 15, 2011 at 9:42 am

    The grep utility becomes more powerful with “pattern Matching” regex expression. Keep updating more on Unix tips… I would love to see your new finding on command lines …tips & tricks on Unix. Thanks

     
    • maynature

      September 15, 2011 at 10:53 am

      @ripple: Agree, grep’s regex implementation is very powerful! Sure, I am planning to update all next Linux commands/tools in this series.

       

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: