To understand the basic file management functions in your
Linux system. After completed, you will be able to manage the files and system
resources from the system back end.
(These instructions are same for both Ubuntu and CentOS. If
any changes required, you can find the note below that instruction. )
The “vi” or “vim” editor.
are several file editing tools available in Linux. Here we are going to follow
the usage of the “vi” or “vim” editor. It is a powerful editing tool found in
almost all Linux distributions. ( If not installed by default, you can install
it using “apt-get” in Ubuntu and “yum” in CentOS. )
To open a a file to edit using “vim” you can use
the following command.
<file name or full file path>
its a new file, then you will get the following.
To edit, press “i” or “insert” ( Then you can
insert in to or delete from that file )
If you again press “i” or “insert” you will get
back to “Replace mode” and now you can replace the characters.
You can use “esc + u “ for undo and can use “esc
+ shift + : + q + !” to quit the file without saving.
You can use “esc + shift + : + x” to save the
file and quit
Now you know how to create a file, edit and
update a file using “vi” or “vim” editor.
Tip : Vim5 and later versions support syntax highlighting. Means you can see
special colouring and highlighting in files while editing using vim. But this option is disabled in Ubuntu systems
by default, if you want to enable this, open the file “/etc/vim/vimrc” and
uncomment the line “syntax on”. Then save the file. That will enable syntax
highlighting in your Ubuntu system)
copy a file, you can use the below command. (You can copy the content in a
different name if required )
<file name> <destination>
move a file, you can use the following command. ( You can also use this command
to rename the file )
remove a file or folder, you can use the following command. ( if you want to
remove the content forcefully, you can add “-rf” after rm )
you know the basic file operation that you can perform in your Linux system.
Now you can create, edit, copy, move and delete the files in your system. If
you encountered any issues with this guide, please also note that there is
additional information available in our Wiki database at
http://myhosting.com/kb. Finally, we encourage you to contact our technical
support team by email at email@example.com, or calling us at 1-866-289-5091
with any questions or concerns.