Saturday, April 24, 2010

How to Find Files in Linux

The following command helps you find all files with names that start with test in /home folder:
find /home -name 'test*'
Find all files owned by user1 that are larger than 20MB:
find /home -user user1 -size +20M
Look for a text1 in all files in /etc:
find /etc -exec grep -l text1 {} \;
List txt files starting from current directory with phrase 'find me' inside:
find . -name '*.txt' | xargs grep 'find me'

No comments :

Post a Comment