Find directories/files with find command

 

Find is one of the beautiful command in Linux.

With reference to man page of find command it is used search for files in a directory hierarchy.

Show only directories with find command:

$ find <INPUT_DIRECTORY> -type d

Above command will list only directories recursively from INPUT_DIRECTORY path.

Show only files with find command:

$ find <INPUT_DIRECTORY> -type f

Above command will list only files recursively from INPUT_DIRECTORY path.

If you are not given any INPUT_DIRECTORY current directory will be considered as INPUT_DIRECTORY.

-Sany
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s