The aim of this assignment is to continue familiarization basic Unix commands, in particular the find
command. I've recorded a YouTube video that once again shows the process of accepting and cloning the assignment as well as describes the expectations for completion:
-
In the repository, you will find a directories
files1
andfiles2
with a set of subdirectories and files inside them. Use the Unixfind
command to locate the following files when run from the repository's root directory (this is not the files system root/
)./files1/lorem2.dat ./files1/lorem3.dat ./files2/lorem2.dat ./files2/lorem3.dat
Just for clarity, the entire repository file structure is shown below, the files you are looking for are highlighted with **.
assignment3/ ├── .github | ├── CODEOWNERS | └── workflows | └── main.yml ├── .gitignore ├── environment.yml ├── README.md ├── LICENSE ├── test.py ├── files1/ | ├── lorem1.txt | ├── lorem2.txt | ├── lorem3.txt | ├── lorem1.dat | ├── **lorem2.dat** | ├── **lorem3.dat** | ├── files3/ | | ├── lorem1.txt | | ├── lorem2.txt | | ├── lorem3.txt | | ├── lorem1.dat | | ├── lorem2.dat | | └── lorem3.dat | └── files4/ | ├── lorem1.txt | ├── lorem2.txt | ├── lorem3.txt | ├── lorem1.dat | ├── lorem2.dat | └── lorem3.dat └── files2/ ├── lorem1.txt ├── lorem2.txt ├── lorem3.txt ├── lorem1.dat ├── **lorem2.dat** ├── **lorem3.dat** ├── files5/ | ├── lorem1.txt | ├── lorem2.txt | ├── lorem3.txt | ├── lorem1.dat | ├── lorem2.dat | └── lorem3.dat └── files6/ ├── lorem1.txt ├── lorem2.txt ├── lorem3.txt ├── lorem1.dat ├── lorem2.dat └── lorem3.dat
-
Test your
find
command interactively on the command line. Once you've figured out the correct syntax, copy your command into a new file calledmyfind.sh
, you can do this by usingecho 'find <my complicated arguments>' > myfind.sh
where<my complicated arguments>
is replaced with the correct set of arguments. Alternatively, you could also open a new file in the text editor and add yourfind
command syntax. -
Add
myfind.sh
to the git repository, commit, and push back to Github.
Hint: You will likely need an option to restrict the depth of the search that I did not discuss in the video (because matching file names are found in the directories files3
, files4
, files5
, and files6
). Use the man
page or Google to assist in finding the correct options.
If you would like to check to see if your solution is correct, simply run
python test.py
A status message of OK
indicates you have the correct answer.