You may have discovered that the first article is very useful. This article is an extension of the 20 commands that are useful to novice Linux users. The purpose of the first article is to be prepared for new users. This article is intended for intermediate and senior Linux users. Here you will learn how to perform Custom Search, know the processes in progress and stop the processes, how to use the strong features of Linux, and how to compile C in the system, C ++ and JAVA programs.
21. Command: Find
Search for files in the specified directory, start from the parent directory, and then search for subdirectories.
- root@tecmint:~# find -name *.sh
- ./Desktop/load.sh
- ./Desktop/test.sh
- ./Desktop/shutdown.sh
- ./Binary/firefox/run-mozilla.sh
- ./Downloads/kdewebdev-3.5.8/quanta/scripts/externalpreview.sh
- ./Downloads/kdewebdev-3.5.8/admin/doxygen.sh
- ./Downloads/kdewebdev-3.5.8/admin/cvs.sh
- ./Downloads/kdewebdev-3.5.8/admin/ltmain.sh
- ./Downloads/wheezy-nv-install.sh
Note: The '-name' option is case sensitive for search. You can use the '-iname' option to ignore case sensitivity during search. * It is a wildcard character that can be used to search for all objects. '. Sh' you can use a file name or a part of the file name to specify the output result)
- root@tecmint:~# find -iname *.SH ( find -iname *.Sh / find -iname *.sH)
- ./Desktop/load.sh
- ./Desktop/test.sh
- ./Desktop/shutdown.sh
- ./Binary/firefox/run-mozilla.sh
- ./Downloads/kdewebdev-3.5.8/quanta/scripts/externalpreview.sh
- ./Downloads/kdewebdev-3.5.8/admin/doxygen.sh
- ./Downloads/kdewebdev-3.5.8/admin/cvs.sh
- ./Downloads/kdewebdev-3.5.8/admin/ltmain.sh
- ./Downloads/wheezy-nv-install.sh
- root@tecmint:~# find -name *.tar.gz
- /var/www/modules/update/tests/aaa_update_test.tar.gz
- ./var/cache/flashplugin-nonfree/install_flash_player_11_linux.i386.tar.gz
- ./home/server/Downloads/drupal-7.22.tar.gz
- ./home/server/Downloads/smtp-7.x-1.0.tar.gz
- ./home/server/Downloads/noreqnewpass-7.x-1.2.tar.gz
- ./usr/share/gettext/archive.git.tar.gz
- ./usr/share/doc/apg/php.tar.gz
- ./usr/share/doc/festival/examples/speech_pm_1.0.tar.gz
- ./usr/share/doc/argyll/examples/spyder2.tar.gz
- ./usr/share/usb_modeswitch/configPack.tar.gz
Note: search for all files containing 'tar.gz 'under the root directory and all directories with commands.
For more information about the 'Find 'Command, see 35 find Command Examples in Linux