Finding Stuff on Linux Systems
How to Find Stuff on Linux
This is a placeholder for a future linux article. The article is sketched out and published as "hidden" for now to make it accessable...
There are a number of ways to find things on linux, including; locate, find, and grep.
locate
'used to quickly find files by their name.
- ... 'relies on a database that contains a snapshot of all files and directories on your system (updated roughly daily by chron-job).
Usage
locate myfile.txt
-r
Use regex.
find
Find files within a specified directory and its subdirectories based on various criteria.
Usage
find [path] [expression]
Examples
find . -name "*texture*"
grep
grep
is a VASTLY powerful command-line utility in Linux and Unix-like systems used to search for patterns within text data.
Usage
grep [options] pattern [file(s)]
Examples
Can be used to find files containing target patters. For example, find files containing the word 'texture' ...
1. grep -E -r ".*[Tt]exture\s*" .
2. grep -Erl ".*[Tt]exture\s*" . | xargs grep -l ".*[Nn]oise\s*"
Where -E
flags the use of extended regular expressions.
To be cont'd ...