Skip to main content

(Linux Command Line) Part Three – Commands Line for File Editor in Linux (CentOS, Ubuntu)

In phase Three of serial Linux Commands, we will be able to discover ways to use File Editor in Linux. There are many gear that is helping us to edit recordsdata in Linux (textual content editor). We may even edit Linux recordsdata from our Windows by way of FTP shopper (corresponding to CuteFTP or FileZilla) or we will be able to edit Linux recordsdata without delay by way of command line (corresponding to vi, nano, vim, gedit, emacs …). Remember that Commands in CentOS and Ubuntu are very an identical, however once in a while there are variations.

Commands Line for File Editor in Linux (CentOS, Ubuntu)

Serial Linux Commands:

 👉 Part 1 – Linux Commands for Server Management and Monitoring
 👉 Part 2 – Linux Commands for File and Folder/ Directory Management
 👉 Part Three – Linux Commands for File Editor in Linux (CentOS, Ubuntu)
 👉 Part Four – Linux Commands for Network Configuration in Linux (CentOS, Ubuntu)
 👉 Part five – Other Useful Linux Commands (CentOS, Ubuntu) you wish to have to understand

Editing recordsdata in Linux server from Windows by way of FTP shopper is somewhat visible and simple, however once in a while, we need to edit recordsdata without delay in Linux servers by way of Command Line. In this newsletter, I will be able to information you how you can edit TEXT report in Linux via Four techniques: 1- Command Line the use of VI Text Editor, 2-Command Line the use of NANO Text Editor, Three-Command Line the use of different Text Editor, Four- Edit report from Windows by way of FTP shopper

Bonus: Share “All Linux Command Line” report, obtain right here.

Commands Line for File Editor in Linux (CentOS, Ubuntu)

1) Linux Text Editor with VI

VI is the usual textual content editor on Unix Operating Systems. It is a visible editor, working below two modes: Command Mode (Command Line) and Insert Mode (Edit mode)

To edit a report, we use the underneath command:

VI filepath/filename

For instance, to edit PHP.INI report, simply kind:

VI php.ini

Linux Text Editor with VILinux Text Editor with VI (photograph: howtogeek.com)

– In the Command Mode, we can most effective use the keyboard to accomplish movements corresponding to shifting the cursor, save knowledge, open the report … we can not edit textual content on this mode

– To edit textual content (edit report content material), we want to transfer to Insert Mode. Insert Mode lets in the use of keyboard to edit report contents.

Note: In the Insert Mode, we can’t use instructions. To permit instructions, we want to go out Insert Mode via urgent ESC key

👉 Group Commands within the Insert Mode

COMMAND PURPOSE / DESCRIPTION
i Switch to Insert Mode, persona is written in entrance of the cursor
l Before the primary persona at the line
a After the cursor
A After the primary persona at the line
zero Below the present line
O Above the present line
r Replace the present persona
R Replace till the clicking
ESC Switch again to Command Mode

👉 Group Commands for File movements in VI

COMMAND PURPOSE / DESCRIPTION
:w Save the report
: x Save the report and go out Insert Mode
: wq Save the report and go out Insert Mode (similar above)
:r Open/ learn a report
:q! Exit with out saving the report content material
:q Exit if no trade made
:w Save into a brand new report

👉 Group Commands for shifting the cursor in VI

COMMAND PURPOSE / DESCRIPTION
h Go left 1 house
e Go proper 1 house
w Go proper 1 phrase
okay Go above 1 line
j Go down 1 line
O In the present line
r Replace the present persona
R Replace till the clicking
) End of the sentence
( Start of the sentence
} End of the paragraph
{ Start of the paragraph

👉 Group Commands to delete, replica, paste, undo in VI

COMMAND PURPOSE / DESCRIPTION
dw Delete 1 phrase
d^ Delete characters from the cursor to the start of the road
d$ Delete characters from the cursor to the top of the road
3dw Delete Three phrases
dd Delete the present line
x Delete 1 persona
y Copy
u Undo the former operation
3yy Copy Three consecutive traces
yy Copy all of the line on the cursor place
y$ Copy from present cursor to the ultimate
p Paste

👉 Group Commands to seek out and change in VI

COMMAND PURPOSE / DESCRIPTION
? Find upward
/ Find down
*/and Find subsequent phrases of “and”
*?and Find phrases finishing via “and”
*/nThe Find from the following line starts with “The”
n Find downward
N Find upward
cw Replace 1 phrase
3cw Replace Three phrases
cc Replace the present line
5cc Replace five traces
:s/text1/text2/g Replace “text1” via “text2”
:g/one/s/1/g Replace “one” via “1”
 :1.$s/report/folder Replace report via folder from row 1

2) Linux Text Editor with NANO

NANO is Ubuntu integrated Text Editor. It is beautiful easy and simple to make use of, permitting us to edit recordsdata with fundamental options corresponding to opening recordsdata, modifying recordsdata and saving recordsdata …
Syntax:

nano  filepath/filename

Linux Text Editor with NANOLinux Text Editor with NANO (photograph: itsfoss.com)

Some commonplace NANO keyboard shortcuts:

COMMAND PURPOSE / DESCRIPTION
  Ctrl-O Save report
  Ctrl-R Open report
  Ctrl-X Close report
  Ctrl-G Help

Three) Other Text Editor in Linux

Beside standard Text Editor (VI and NANO), there are lots of different Linux Text Editors, corresponding to Gedit, Emacs, Kate, Geany, Kwrite, Nedit, Scribes, SciTE, Medit, Gtkedit… Each Editor helps quite a lot of options. I steadily use VI, if you wish to find out about different Editors, you’ll to find extra from Google.

Four) Guide to edit recordsdata in Linux Server by way of Windows FTP shopper

In many instances, particularly those that have by no means labored with Linux, they don’t wish to use even one easy command line; or if the content material of Linux report is carefully associated with a report(s) in Windows (you could wish to replica and paste from Windows). In such case, modifying Linux report by way of Windows FTP shopper will actually assist.

Guide to edit files in Linux Server via Windows FTP clientEdit recordsdata in Linux Server by way of Windows FTP shopper

Here is how you can edit Linux report by way of Windows FTP shopper:

– Connect to Linux server by way of FTP shopper (CuteFTP or Filezilla)

– Browse to the folder that accommodates the report(s) you need to edit

– Right-click at the report then choose View/Edit

– FTP Client program will obtain the report from Linux server then open it the use of the default textual content editor program in Windows (Notepad, Notepad++ …) => You can edit the report as you need very simply (in Windows Notepad or Notepad++)

– After modifying finished, you shut Notepad/ Notepad++ => Select “Upload” or “Save” within the affirmation conversation => Wait till importing completed. Done!

Tutorial video: How to make use of VI editor in Linux CentOS, Ubuntu 


Find more at: Tech Cuber

Comments

Popular posts from this blog

The Power of Man The Strongest Man

The Power of Man The Strongest Man The Power of Man The Strongest Man The Power of Man The Strongest Man Tech Cuber was found in 2012 by a group of who’d love mobile & internet technology. We aim to bring to visitors/users useful knowledge and experiences by many articles of tips and tricks for computer, mobile and other devices; guide how to install and config software, hardware, networking and make money online; product review and technology news. - Website: http://techcubers.com - Google+: https://plus.google.com/+Techcubers - Youtube: https://youtube.com/channel/UC1YcFbt95qPBaE_Mfn3ua9w - Facebook: https://facebook.com/techcubers - Twitter: https://twitter.com/techcubers - Blogger: https://techcubers.blogspot.com - Tumblr: https://techcubers.tumblr.com - WordPress: https://techcubers.wordpress.com The Power of Man The Strongest Man xmen power man strongest man big man biggest man x men x men days of future past cast x men days of future past x men movies xmovies x men film ...

10 Worst Circus Disasters | HowStuffWorks

Circuses are widely known as bad places. In fact, that is part of the joys, isn’t it? Nobody is enthusiastic about going to a circus that promises a subdued time. Instead, we wish to be on the edge of our seats, in a position to gasp in awe at the stunts performed or the ferocity of the animals. Unfortunately, that also means problems can transfer very mistaken at the circus. If all the conceit of a show is devious possibility, you upper believe that now and again possibility is going to win. And while it’s going to seem to be tales of circus woe are edging in opposition to risk free, it’s price pointing out that the screw u.s.a.we will be able to discuss inside the following pages don’t seem to be any trifling affair simply because they took place in a fun environment. There’s some stunning horrific traumas in circus history, and we may not be shy. But let’s get began with a modern circus disaster that, while horrific, didn’t result in loss of existence. 10: Providence Hair Hanger...

10 Ways to Get Rid of Greedy and Annoying Relatives

People in every single place the worldwide, specifically Indians, are blessed (no pun supposed) with a huge number of kinfolk from all corners of the sphere. We all have uncles, aunts, cousins, grandparents and so forth and so forth. Though there are few ones we don’t like, on the other hand have you ever ever ever given a thought how boring lifestyles would were without the ones kinfolk? There are ones we don’t like, there are few we love and easily their mere presence brightens up our day, there are some who don’t in truth bother us. But that’s what lifestyles is all about, isn’t it? We can just about categorize all our kinfolk in a lot of categories, the ‘agony aunt’, ‘the foreign return cousin’, ‘the cheek pulling uncle’. It is funny that how we hate the ones other folks, on the other hand they’re those that make our family unique and our family outings and gatherings stress-free. It is gorgeous as long as they’re messing along side your other cousins another way you siblings. The ...