In: Computer Science
Linux Directories, File Properties, and the File System in C
Your version of find command
Try running the find command in the shell and observe the output. Try it in different folders to make sure you understand what it prints out.
$ find
Write your version of the find command and add comments.
The find command in UNIX is a command line utility for walking a file hierarchy. It can be used to find files and directories and perform subsequent operations on them. It supports searching by file, folder, name, creation date, modification date, owner and permissions
Different versions of the find command are:
1) find . -name new
This command will try to search for a file named "new" in the current directory which is indicated by a dot (.).
The -name searches for the name specifed at the end.
This will search the file in Desktop directory and will return the file when found.
2) find Desktop/ -name script.sh
This command will try to search for a file named "script.sh" in the directory given by us which is the Desktop directoy.
This return us the value script.sh where the directory name is indicated first tand then the file name is shown.
You can specify any directory and then use the find command to find in that specific directory.
3) find Downloads/ -name newdownload
This command will try to search for a file named "newdownload" in the Downloads directory.
As expected, this return the file location with directory name first whichis Downloads and then the name of the file which is newdownload
If you have any doubts, leave a comment below before rating. I'll be happy to assist you further.
Do UPVOTE this as I have put a lot of EFFORT in answering this question. It really helps me.