Shell Programming Blog Shell Programming Blog

Friday 28 September 2012

How to exclude or skip a directory while searching for a file using FIND command

Unknown | 10:33 |




Find command is used to search the files in the Linux environment. This find command will search all the directories and the sub directories in the path which we give in the find command. Often we would like to exclude some directories from our FIND command. Now we will see how to do it.


The below command is used to search all the *.sh files starting from current directory.



Suppose if you want to skip or exclude the directory './dir22' and all files and directories under it, you need to use -prune option with bash find command.



0 Comments:

   

Post a Comment

Don't just read and walk away, Your Feedback Is Always Appreciated. I will try to reply to your queries as soon as time allows.

Note:
1. If your question is unrelated to this article, please use our Facebook Page.
2. Please always make use of your name in the comment box instead of anonymous so that i can respond to you through your name and don't make use of Names such as "Admin" or "ADMIN" if you want your Comment to be published.
3. Please do not spam, spam comments will be deleted immediately upon my review.

Regards,
Mohamed Abubakar Sittik A

 

Shell Programming Copyright © 2012 Shell Programming theme is Designed by Abusittik, Shell Programming