Recall & Review
beginner
What does the
find command do in Linux?The
find command searches for files and directories in a directory hierarchy based on conditions like name, type, or size.Click to reveal answer
beginner
How do you use
find to search for files by name?Use
find [path] -name "filename". For example, find . -name "report.txt" finds files named 'report.txt' in the current directory and subdirectories.Click to reveal answer
beginner
What option do you use with
find to search by file type?Use
-type followed by a letter: f for files, d for directories. Example: find . -type d finds directories.Click to reveal answer
beginner
How can you find files larger than 1 megabyte using
find?Use
-size +1M. For example, find . -size +1M finds files bigger than 1 megabyte.Click to reveal answer
intermediate
Write a
find command to find all regular files named 'log.txt' larger than 500 kilobytes.Command:
find . -type f -name "log.txt" -size +500k. This finds files named 'log.txt' that are regular files and bigger than 500 KB.Click to reveal answer
Which
find option searches for directories?✗ Incorrect
The option
-type d searches for directories.How do you find files named exactly 'data.csv' in the current directory and subdirectories?
✗ Incorrect
Use
find . -name "data.csv" to find files by name.What does
-size +10M mean in a find command?✗ Incorrect
+10M means files larger than 10 megabytes.Which command finds all regular files larger than 100 kilobytes?
✗ Incorrect
Use
-type f for files and -size +100k for files larger than 100 KB.What does the command
find /tmp -type f -name "*.log" -size -1M do?✗ Incorrect
It finds regular files ending with '.log' smaller than 1 megabyte in /tmp.
Explain how to use the
find command to search for files by name, type, and size.Think about combining options like -name, -type, and -size in one command.
You got /3 concepts.
Describe a real-life scenario where you would use
find with name, type, and size filters.Imagine managing files on your computer or server.
You got /3 concepts.