SSH shell search commands
Linux systems come with an advanced search system. In addition to searching for folders or files, you can find useful commands related to searching for words within files in this article.
Searching for Folders with SSH
/ represents the root directory. If you want to search within the Home directory, you need to change it to /home.
find / -type d -name "folder name"
Searching for Files with SSH
find / -type f -name FILENAME
Searching for Words Inside Files with SSH
find . -iname '*.php' | xargs grep 'word' -sl
The '.*php' will only search within PHP files. If you leave it as '*', it will search in all files.
Replace 'word' with the term you want to search for.
Linux systems come with an advanced search system. In addition to searching for folders or files, you can find useful commands related to searching for words within files in this article.
Searching for Folders with SSH
/ represents the root directory. If you want to search within the Home directory, you need to change it to /home.
find / -type d -name "folder name"
Searching for Files with SSH
find / -type f -name FILENAME
Searching for Words Inside Files with SSH
find . -iname '*.php' | xargs grep 'word' -sl
The '.*php' will only search within PHP files. If you leave it as '*', it will search in all files.
Replace 'word' with the term you want to search for.