Learn about cPanel file manager

The Ultimate Guide To cPanel File Manager

How to edit a file(s) via File Manager

Yes, you can use your local machine text editor such as Visual Studio Code, Sublime Text, Panic Nova, etc to edit your website files.

But cPanel also provides a way to get that done in-browser.

Log in to your cPanel account.

Select the Files pane and click on File Manager.

Once the page (which will load in a new tab) opens, navigate to the folder where the file is located.

Click on the file’s name.

Click on the Edit icon to open the Edit window.

Click Edit to open a new window with the content of the file displayed.

Make your changes and click Save Changes on the top toolbar.


To achieve the same result using the command line:

vi | vim | nano $filename

If you want to just delete specific lines from a text file:, you can use the powerful sed command line editor and delete lines that match a specific rule.

For instance, let’s say you want to delete the 20th line number in a file named contact.php:

sed -i '20d' contact.php

To delete the last line in this file:

sed -i '$d' contact.php

To delete multiple lines, identify the range and:

sed -i '10,55d' contact.php

Pages: 1 2 3 4 5 6 7 8 9 10 11 12


Posted

in

,

by