Linux Basics

You are currently auditing this course.
43 / 107

Extra functions of find command

We can also search files of a particular type by using -type option with find command. We can search all directories present in the current directory by-

find . -type d

where d indicates a directory. We can use f for searching for files.

We can use the -exec option to execute a command after finding the respective file. So, we can remove all files of size greater than 1 megabyte by-

find . -size +1M -exec rm {} \;

where, {} \; tells exec to execute command with the result.


No hints are availble for this assesment

Answer is not availble for this assesment

Loading comments...