Basic use of the find command in Linux
To find a file named my file.txt anywhere;
find / -name "myfile.txt"
To find a file named my file.txt in the current directory;
find . -name myfile.txt
To find all files in the current directory;
find . -name *.txt
To find all jpg files in /home/plisken;
find /home/plisken -name *.jpg
To search the contents of files in current directory;
find . -type f -exec grep "keyword" '{}' \; -print
No comments:
Post a Comment
Note: only a member of this blog may post a comment.