You can use cPanel’s file manager for various file-related tasks. Before we dive into some of the options, let’s have a quick look at the inferface.
Image: cPanel’s File Manager.
The navigation bar at the top contains two search fields and a Settings menu. The search fields are handy if you quickly want to find certain files. For instance, website errors are stored in error_log files. Typically, an error will be written to an error_log file in the directory in which the error occurs. In other words, you may have more than one error_log file – there could be one in the public_html directory, and another in the directory of a specific WordPress plugin. If you are debugging an error it is useful to do a search for any file with the name error_log.
Image: finding files named error_log.
A useful option in the Settings menu is Show Hidden Files (dotfiles). So-called dotfiles are files (or directories) whose name starts with the dot character. These files are mainly configuration files used by the system and are not displayed by default.
In the hosting world, the most famous dotfile is the .htaccess file. This file can be edited to configure things like URL redirection and access control. If you need to edit the file but you can’t see it, selecting Show Hidden Files should make it appear in the file manager.
Image: viewing hidden ‘dotfiles’.
By default the file manager will open in a new browser window or tab, and it will show the contents of your home directory. In our example that is the /home/example directory.
The directory you are most likely to be interested in is the public_html directory. This is where, by default, your website files are stored. Two other directories that are worth mentioning are .trash and logs.
The .trash directory is a hidden directory – to see it you need to make sure that dotfiles are displayed. You will find the .trash directory in your home directory. As the name suggests, the directory contains files you have deleted. By default, files you delete are put in the trash, unless you tick a box to permanently delete the file. You can restore items in the trash by right-clicking on the file name and selecting Restore.
Inside the logs directory you will find access logs for your website. These log files contain all the requests processed by the server for your account, which can be useful if you need specific information (for instance, if you are looking into an error on your website).
If you got a WordPress website then your public_html directory will look similar to the one shown in this image:
Image: The public_html directory, containing a WordPress install.
In the horizontal menu bar, just below the navigation bar, are three options that are enabled: you can create a new file, a new folder or upload a file. When you select a file other options become available: you will be able to copy, move, download, rename, view, edit or delete the selected file. You get the same options when you right-click on a file.
Image: A right-click (“contextual”) menu.
In general, these options are useful if you want to quickly perform an action on an individual file. For instance, if you want to make a quick edit to the wp-config.php file then you can copy the file (so that you got a backup in case your edit breaks things) and then edit it. If you want to perform an action on lots of files then there are better tools. We will next look at using FTP and the the Backup tool.
When you select a file or directory you can also change its permissions. As a rule of thumb, you should never have to increase the permissions. If, say, you are working on a PHP script and it is not working correctly, increasing the permissions will rarely solve the issue – and if it does there is probably another issue with your script. More importantly, making the script world-executable would be a serious security risk.