adds small word finding exercise
This commit is contained in:
parent
067bd574a1
commit
04fa604721
File diff suppressed because it is too large
Load Diff
|
@ -1122,6 +1122,21 @@ All of these conditions can be combined to improve the specificity of your query
|
|||
There are a few exercises below so I won't give too many spoiler.
|
||||
My best advise is to read `man find` and experiment.
|
||||
|
||||
# Exercise
|
||||
|
||||
Inside a clean minimal installation can you please:
|
||||
|
||||
* find all files that are 3286 bytes
|
||||
* find all files not owned by `root` **and** `$USER` (yourself)
|
||||
* find all symbolic links
|
||||
* find all files that contain *ssh* in the filename **and** are smaller that 10 bytes
|
||||
|
||||
For the eager ones:
|
||||
|
||||
* find all files in `/usr` that contain the word *hippo*
|
||||
* find all files in `/usr` that contain the word *hippop* or *hiphop*
|
||||
* find all Belgian email addresses in `/usr`
|
||||
|
||||
## Searching inside files
|
||||
|
||||
`locate` and `find` are used to search **for** files.
|
||||
|
@ -1170,7 +1185,7 @@ waldek@debian:~$ locate american
|
|||
/var/lib/ispell/american.remove
|
||||
```
|
||||
|
||||
We can use `grep` to find all occurrences of the word *hippo* with the following syntax.
|
||||
We can use `grep` to find all occurrences of the word *hippop* with the following syntax.
|
||||
|
||||
```
|
||||
waldek@debian:~$ grep "hippop" /usr/share/dict/american-english
|
||||
|
@ -1260,19 +1275,12 @@ waldek@helloworld:~$ ls [6-9][0-3][ab]?x*
|
|||
waldek@helloworld:~$
|
||||
```
|
||||
|
||||
|
||||
|
||||
# Exercise
|
||||
|
||||
Inside a clean minimal installation can you please:
|
||||
|
||||
* find all files that are 3286 bytes
|
||||
* find all files not owned by `root` **and** `$USER` (yourself)
|
||||
* find all symbolic links
|
||||
* find all files that contain *ssh* in the filename **and** are smaller that 10 bytes
|
||||
* find all files in `/usr` that contain the word *hippo*
|
||||
* find all files in `/usr` that contain the word *hippop* or *hiphop*
|
||||
* find all Belgian email addresses in `/usr`
|
||||
I hid a lot of words in [this](../assets/find_words_in_here.txt) file.
|
||||
How many can you find?
|
||||
What do they all have in common?
|
||||
Can you count the occurences?
|
||||
|
||||
* [exercise from Linux long](https://gitea.86thumbs.net/waldek/linux_course_doc/src/branch/master/modules/qualifying/learning_regex.md)
|
||||
|
||||
|
|
Loading…
Reference in New Issue