I am trying to find where index.html
is located on my linux server, and was wondering if there was a command to do that. Very new to linux and appreciate any help I can get.
1 Open your favorite terminal app. ... 2 Type the following command: find /path/to/folder/ -iname *file_name_portion* The arguments above are as follows: /path/to/folder/ - the folder where to begin searching. ... 3 If you need to find only files or only folders, add the option -type f for files or - type d for directories. ... More items...
1. Search for a file by its file name. This is the most basic search you can perform using the find command. The command below will search for the query in the current directory and any subdirectories. find -iname "filename". Using -iname instead of -name ignores the case of your query.
The " {} " portion stands for files found by the find command. The "\;" ending specifies the end of the command for the -exec option. The locate search tool uses a special file database to find files instantly. The index for the command can be created and updated by the updatedb command.
Also, there's Catfish, a popular search tool with a search index, which can find your files really quickly. I would like to share the methods I use myself when I work in terminal. The first method involves the find utility, which exists in any distro, even in embedded systems built on busybox. The other method is the locate command.
Find from root path find / -name "index.html"
Find from current path find . -name "index.html"
The below line of code would do it for you.
find / -name index.html
However, on most Linux servers, your files will be located in /var/www or in your user directory folder /home/(user) depending on how you have it set up. If you're using a control panel, most likely it'll be under your user folder.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With