Linux FIND command, exclude several path, where most files?

Discussion in 'Command Line' started by postcd, Aug 21, 2014.

  1. postcd

    postcd Member

    Joined:
    Apr 16, 2014
    Messages:
    130
    Likes Received:
    10
    Hello,

    im doing regular search in files contents in around 25 linux file systems (mostly redhat, debian).,

    i want to lower load on server by excluding folders which contains only system files and alot of files

    Which linux folders contains most files?


    I found i can exclude folders like this:

    the linux will entirelly skip above excluded directories, or it will go into them and search, but only mute listing? thx

    i mainly want to relieve disk I/O operations, thats also why i added "/bin/nice -n 19 " before the find command
     
  2. GrumpyOldMan

    GrumpyOldMan Active Member

    Joined:
    Oct 30, 2013
    Messages:
    220
    Likes Received:
    62
    Might work better if you start your search where you thing the files might be. For example, user files, use

    Code:
    find ~ -name "name_to_find"
     
  3. WharfRat

    WharfRat Member

    Joined:
    Jul 17, 2014
    Messages:
    44
    Likes Received:
    16
    Try

    Code:
    find . -path ./proc -prune -or -path ./sys -prune -or -path ./run -prune  -or -iname '*start*' -print
     
    Last edited: Aug 21, 2014
    JasKinasis and icehouse15 like this.

Share This Page