How to create a new file and save it in Putty

Mihai B.

Well-known member
Joined
Apr 19, 2016
Messages
108
Best answers
0
Ratings
7
Points
18
#1
Can you guide me how to create a new file and save it in Putty? I don't want to switch to FTP client program and making a file there, using Putty SSH may be faster.
 

AlbaHost

Well-known member
Joined
Jan 18, 2017
Messages
264
Best answers
1
Ratings
52 3
Points
28
#2
Can you guide me how to create a new file and save it in Putty? I don't want to switch to FTP client program and making a file there, using Putty SSH may be faster.
nano filename
CTRL O
CTRL X

Done
 
Joined
Jan 16, 2017
Messages
53
Best answers
0
Ratings
4
Points
0
#3
You can also use 'vi filename' command. If you want to write programming code, use vim command. To start write, press 'i' and to save, first press 'Esc' and type ':wq'+ press enter. wq means write and quit.
 

24x7CSM

Well-known member
Joined
Sep 27, 2016
Messages
219
Best answers
0
Ratings
26
Points
0
#4
simple step , use the command touch file name and file will be created
in order to edit the file just use either vi or nano command
you can install nano command by yum install nano
 

Mihai B.

Well-known member
Joined
Apr 19, 2016
Messages
108
Best answers
0
Ratings
7
Points
18
#5
You can also use 'vi filename' command. If you want to write programming code, use vim command. To start write, press 'i' and to save, first press 'Esc' and type ':wq'+ press enter. wq means write and quit.
I used vi editor once but I could not remember its commands, especially shortcut keys.

nano filename
CTRL O
CTRL X

Done
Seem this way is easy and worked for me.

Thanks!
 

wpspeedster

Well-known member
Joined
May 6, 2016
Messages
107
Best answers
0
Ratings
3
Points
18
#8
Yes I used both nano and vi editor but I find nano more convenient.

If you want to use vi then here's commands

Code:
vi filename
Code:
i to insert
a to append
x to delete
dd to delete a line
: to begin a command sequence
:w to save
:q to quit
:q! to quit without saving
:wq to save and quit
Anyway, vi didn't show its command at the bottom of screen like nano editor, that will help you easily use commands even you don't need to remember them.

Hope that helped.
 

24x7serverman

Well-known member
Joined
Jul 25, 2017
Messages
594
Best answers
1
Ratings
52 3
Points
28
#9
I would recommend VI editor. Use the vi command to create the file. Below are the detailed command -

vi file name
Now as you wan to enter in the file for writing the content then press i
Enter the content
Now for saving the file press Escape key :wq

It will save the file.

Make sure to update the ownership and permission of the file for proper functioning. chown command is used to update the ownership and chmod is used for updating the permission.
 

djsmiley2k

Well-known member
Joined
Jul 10, 2016
Messages
103
Best answers
0
Ratings
4
Points
18
#10
djsmiley2k
Sometimes I forgot to use chown command after created a new file or uploaded a new zip file to server and unzip it, this if I don't use chown, it will not allow me to write/read to the file. Is there a way to auto chown for a file without running chown command from the terminal?
 
Newer Threads
Latest Threads
Recommended Threads

Latest postsNew threads

Latest Hosting OffersNew Reviews

Web Hosting

Most Likes - Past 30 Days

Tag Cloud

You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an alternative browser.