...
Command | Description | ||
find |
|
Info |
---|
The find command is naturally recursive. |
...
Examples
Info |
---|
Find the file named: |
...
Info |
---|
The command completed since we got back to the prompt and no errors were displayed. No output means that this file could not be found. |
Info |
---|
Find The |
...
Info |
---|
Use wildcards to find all files with the postfix Lets look at two versions: |
Info | ||
---|---|---|
With quotes:
|
Info | ||
---|---|---|
Without quotes:
|
Note |
---|
Using or not using quotes across commands is an advanced and confusing subject. If you do not use quotes, then if you have a file in the current directory ending with So, if you have a file named say "software.csv" (which we do), the command that gets executed is This single file is found, and the command stops. Surrounding the search term with quotes prevents this from happening. |
Info |
---|
Find any files/folders that contain the string |
...
Code Block |
---|
[intro_to_linux]$ find . -type f -iname "*dec*" ./data/2022/Dec/2022_dec_01.txt |
...
Exercises: Find Files
Info |
---|
Questions:
|
...
Code Block |
---|
[intro_to_linux]$ ls -l data
total 4
drwxrwxr-x 6 <username> <username> 2021
drwxrwxr-x 6 <username> <username> 2022
drwxrwxr-x 5 <username> <username> 2023
drwxrwxr-x 2 <username> <username> dd.tx
[intro_to_linux]$ find . -type f -name "*.tx"
./data/2021/feb/february_01_2021.tx
# If we ignore case:
|
Note | ||
---|---|---|
If we (forget and) ignore the case (using
Notice this has listed a file with a capital a postfix |
...
Previous | Workshop Home | Next |
...