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.
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.
Try this (via a shell):
update db locate index.html
find /var -iname "index.html"
Replace /var with your best guess as to the directory it is in but avoid starting from /
find /the_path_you_want_to_find -name index.html
In general, the best way to find any file in any arbitrary location is to start a terminal window and type in the classic Unix command “find”:
find / -name index.html -print
Since the file you’re looking for is the root file in the root directory of your web server, it’s probably easier to find your web server’s document root. For example, look under:
find /var/www -name index.html -print