Which of the following commands will search for the file foo.txt under the directory /home?
Which of the following commands will search for the file foo.txt under the directory /home?
To search for a specific file within a directory in Unix-like operating systems, the 'find' command is used with the '-name' option followed by the filename. The command 'find /home -name foo.txt' correctly specifies the directory and the filename to search for. The other options either use incorrect syntax or invalid options.
Should be: find /home —name foo.txt the "" should be — (single dash)
In fact if you're on the home dir then all you need is: find -name foo.txt
This is correct, I verified it on centos. Proper syntax is "find /home -name foo.txt"
D find /home/ - name foo.txt
I tried it without quotes or dashes, and it worked.
The syntax is: find /home -name foo.txt
that command didnt work for me.
the command should be find /home search foo.txt
D. find /home ג€"name foo.txt