Saturday, August 13, 2022

find command in Linux

sudo find /folder -xdev -name file*

// -xdev means exclude other mounted file systems

// find -xdev doesn’t descend into directories that are mount points, but it still lists them

find / -xdev -size +100M // find files more than 100MB

find /home -name name.txt

sudo find / -xdev -name "file-name*" -print -exec rm -rf {} + / find and remove

find /path/to/directory -type f -name "*word*" //find files with a specific word in their name

//-type f: Limits the search to files (ignoring directories)

No comments:

Post a Comment