You can specify search standards for looking out information and directories. If you don’t specify any standards, the discover command searches for the information within the present listing.
Unix Search Command Examples:
1. Searching for the information within the present listing.
discover . -name '*.sh'
The dot(.) represents the present listing and -name choice specifies the identify of the file to be searched. This discover command searches for all of the information with “.sh” because the suffix.
2. Searching for the file in all of the directories.
discover / -type f -name 'job.xml'
The / specifies the house listing of the person, which is on the highest stage and the -type choice specifies the kind of file. This command searches for the common file,”job.xml”, in all of the directories.
3. Searching for the file in a specific listing.
discover /usr/native/bin/ -type f -name '*.java'
This discover command searches for all of the java information within the /usr/native/bin listing.
4. Searching for a listing.
discover . -type d -name 'tmp'
The -type d signifies the listing. This discover command searches for the tmp listing within the present listing.
5. Searching for a listing in one other listing
discover /var/tmp/ -typd d -name 'private'
This discover command searches for the non-public listing within the /var/tmp listing.
Recommended Posts: