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

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

  1. postcd

    postcd Member

    Messages:
    65
    Likes Received:
    5
    Trophy Points:
    8
    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

    Messages:
    135
    Likes Received:
    43
    Trophy Points:
    28
    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 New Member

    Messages:
    28
    Likes Received:
    10
    Trophy Points:
    3
    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