Creating or editing files is one of the most common tasks that system admins perform every day. In this tutorial we are going to show you how to create and edit files on a Linux VPS.
Before we start, connect to your server via SSH and make sure that you are familiar with your environment. For that purpose, you can use the basic shell commands which were explained in one of our earlier blog posts. For example, you can create a new directory using the mkdir
command and navigate to that directory. Once you are navigated to the newly created directory, create your first file using the touch
command.
touch new_file
The command above will create an empty file named new_file and you can use that file for testing purposes. To edit the file and add some content to it you can use a text editor. There are many text editors which you can use, but nano
is very suitable for beginners. Our recommendation is to use nano
as an text editor to modify your files until you become more familiar with the others. In case you do not have nano
installed on your system, you can use the command below to install the program:
On a CentOS VPS:
sudo yum install nano
On a an Ubuntu VPS:
sudo apt-get install nano
Now, to open and edit the file you have previously created you can use the following command:
nano new_file
Enter some random text:
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Illud dico, ea, quae dicat, praeclare inter se cohaerere. Nam aliquando posse recte fieri dicunt nulla expectata nec quaesita voluptate.
To save and close the file you should press CTRL + X
and then Y
. In case you do not like to save the changes you should press N
after CTRL + X
.
Now that you have a test file with content on your server, lets see the content. There are many methods to see the content of a file, but by far the easiest method is to use the cat
command.
cat new_file
Using the cat
command you can do many other things. For example, using the cat
command you can concatenate multiple files together or append text to an already existing file. For more information you can read the Linux man page for cat
.
If you like to remove the file you created and used for testing purposes, you can use the rm
command. The basic syntax is:
rm new_file
Once you execute the command you will be prompted to confirm that you like to remove the file. You can confirm by pressing Y
. If you changed your mind, press N
.
Of course you don't have to do any of this if you use one of our Linux VPS hosting services, in which case you can simply ask our expert Linux admins to help you with any aspect of using your server. They are available 24×7 and will take care of your request immediately.
PS. If you liked this post please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.
Lihat Sumbernya → How to create and edit files on a Linux VPS
Download MP3 Terbaru → Chris Brown Mp3 Download
Blog Archive
-
▼
2016
(121)
-
▼
August
(17)
- Moving From Shared Hosting for the VPS Cloud?
- Shared Hosting vs VPS/Dedicated
- TrunkSpace Hosting KVM & OpenVZ servers @ $3.96 ...
- Shared Hosting to VPS - The Right Time to Switch
- VPS Web Hosting: A Cost Effective Web Presence
- VPS vs Dedicated Server Hosting Service
- How to create and edit files on a Linux VPS
- Luna Node Double credit LEB special starting @ $...
- A Whopping Offer By CloudOYE - 30% Off On Dedicate...
- HostReview Ranks Infinitely Virtual Amongst Top 10...
- How to install X2CRM on an Ubuntu 16.04 VPS
- HostReview Ranks Infinitely Virtual Among Top 10 V...
- AlphaRacks DDoS Protected OpenVZ VPS Starting @ ...
- 4 cloud VPS providers that could be a better fit f...
- Install Tomcat 9 on an Ubuntu 16.04 VPS
- Geek deals: 60% off shared web hosting with A2 Hos...
- Krebs on Security
-
▼
August
(17)
Total Pageviews
Search This Blog
Popular Posts
-
Cerita liburan, cerita liburan ke bali, cerita liburan ngentot, cerita liburan sekolah, cerita liburan ke pantai, cerita liburan bibi mama, ...
-
Kisah nabi musa as lengkap, kisah nabi musa as, kisah nabi musa membelah, kisah nabi musa as lengkap, kisah nabi musa full film, film kisah ...
-
Dp bbm, dp bbm terbaru, dp bbm lucu, dp bbm semangat kerja, dp bbm bergerak, dp bbm bergerak taekwondo, dp bbm lucu terbaru, dp bbm terbaru ...