Skip to main content

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

In phase 3 of serial Linux Commands, we will be able to learn to use File Editor in Linux. There are many equipment that is helping us to edit recordsdata in Linux (textual content editor). We may even edit Linux recordsdata from our Windows by means of FTP consumer (corresponding to CuteFTP or FileZilla) or we will be able to edit Linux recordsdata immediately by means of command line (corresponding to vi, nano, vim, gedit, emacs …). Remember that Commands in CentOS and Ubuntu are very identical, however occasionally there are variations.
(Linux Command Line) Part 3 - Commands Line for File Editor in Linux(CentOS, Ubuntu)

Editing recordsdata in Linux server from Windows by means of FTP consumer is somewhat visible and simple, however occasionally, we need to edit recordsdata immediately in Linux servers by means of Command Line. In this text, I will be able to information you the right way to edit TEXT report in Linux by means of 4 techniques: 1- Command Line the usage of VI Text Editor, 2-Command Line the usage of NANO Text Editor, 3-Command Line the usage of different Text Editor, 4- Edit report from Windows by means of FTP consumer

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 under command:

VI filepath/filename

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

VI php.ini

Linux Text Editor with VI (photo:

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

– To edit textual content (edit report content material), we wish to transfer to Insert Mode. Insert Mode permits the usage of keyboard to edit report contents.

Note: In the Insert Mode, we can’t use instructions. To permit instructions, we wish to go out Insert Mode by means of urgent ESC key

👉 Group Commands within the Insert Mode

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
: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 alternate made
:w Save into a brand new report

👉 Group Commands for shifting the cursor in VI

h Go left 1 area
e Go proper 1 area
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

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 3 phrases
dd Delete the present line
x Delete 1 persona
y Copy
u Undo the former operation
3yy Copy 3 consecutive strains
yy Copy all of the line on the cursor place
y$ Copy from present cursor to the remaining
p Paste

👉 Group Commands to seek out and exchange in VI

? Find upward
/ Find down
*/and Find subsequent phrases of “and”
*?and Find phrases finishing by means of “and”
*/nThe Find from the following line starts with “The”
n Find downward
N Find upward
cw Replace 1 phrase
3cw Replace 3 phrases
cc Replace the present line
5cc Replace 5 strains
:s/text1/text2/g Replace “text1” by means of “text2”
:g/one/s/1/g Replace “one” by means of “1”
 :1.$s/report/folder Replace report by means of 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 elementary options corresponding to opening recordsdata, modifying recordsdata and saving recordsdata …


nano  filepath/filename

Linux Text Editor with NANO (photo:

Some commonplace NANO keyboard shortcuts:

  Ctrl-O Save report
  Ctrl-R Open report
  Ctrl-X Close report
  Ctrl-G Help

3) Other Text Editor in Linux

Beside same old 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 more than a few options. I regularly use VI, if you wish to know about different Editors, you’ll to find extra from Google.

4) Guide to edit recordsdata in Linux Server by means of Windows FTP consumer

In many instances, particularly those that have by no means labored with Linux, they do not need 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 need to replica and paste from Windows). In such case, modifying Linux report by means of Windows FTP consumer will in reality assist.

Guide to edit files in Linux Server via Windows FTP client

Here is the right way to edit Linux report by means of Windows FTP consumer:
– Connect to Linux server by means of FTP consumer (CuteFTP or Filezilla)
– Browse to the folder that comprises the report(s) you wish to have 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 usage of the default textual content editor program in Windows (Notepad, Notepad++ …) => You can edit the report as you wish to have 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


Popular posts from this blog

Flatsome | Multi-Purpose Responsive WooCommerce Theme

Version 3.3.5 is out! (04.05.17) Click right here to view the Change logCompatible with WordPress 4.7+ and WooCommerce Responsive WordPress & WooCommerce Theme with fantastic User Experience

Flatsome is the Best Selling WooCommerce Theme EverFlatsome is the maximum used and depended on theme for any roughly WooCommerce Project. We at all times beef up newest WooCommerce variations so Flatsome is the most secure theme on your undertaking.

Main FeaturesFlatsome OverviewFree Lifetime updates!WordPress 4.4+ ReadyWooCommerce 2.4, 2.5, 2.6+ ReadyWPML Ready (.po recordsdata integrated)search engine marketing OptimisedDrag and Drop Page BuilderOnline Documentation – Chrome, Safari, Firefox, IE8+Catalog Mode Option (Hide cart and checkout capability)Easy Updates the usage of Envato WordPress ToolkitChild Theme integratedDemo content material integrated!PSD recordsdata and property integratedNotes* Product photographs or photog…

Samsung’s new Galaxy J5 (2017) and Galaxy J7 (2017) leak out fully, all colour variations proven right here

The inexpensive Samsung Galaxy J collection are one of the most well liked affordable telephones that you’ll get, and this 12 months, they’re getting an replace with no less than two new telephones: the Samsung Galaxy J5 (2017), and its sibling with a larger display screen, the Galaxy J7 (2017).Sleek, steel, colourful, inexpensive: the brand new J (2017) collectionthe brand new How do we all know? It’s now not Samsung that has printed any reputable knowledge simply but, however a treasure trove of leaked photographs have surfaced lately, and this this is your final supply of leaked pictures: the brand new J5 (2017) and the J7 (2017) are proven in all their colour variations and from all angles.The large new issues within the 2017 Galaxy J telephones are a brand spanking new complete steel frame, an improve over the plastic 2016 J telephones, a bump in solution, advanced cameras, quicker 4G LTE strengthen, 3GB of RAM (vs 2GB of closing 12 months’s fashions), however nonetheless most ef…

The 10 Most Anticipated PC Games of 2017

2016 used to be a good if unspectacular 12 months for PC gaming. Several widespread sport franchises won prime quality additions – Battlefield 1, Dishonored 2, Civilization VI, and Watch Dogs 2 simply to call a couple of – however we additionally noticed nice new IPs from studios giant (Ubisoft’s The Division) and small (Jonathan Blow’s The Witness).On the opposite hand, a choice of video games we have been excited to play ended up being main disappointments. Mafia III and No Man’s Sky are top examples, even though even titles like Deus Ex: Mankind Divided won blended reception amongst fanatics of the collection. Hopefully the video games we’re maximum excited to play in 2017 will meet the hype surrounding their unencumber.Mass Effect AndromedaClick on symbol to play gameplay video[embedded content] Release Date: March 21, 2017Genre: Sci-fi role-playingBuy if you happen to like: Mass Effect, BioWare RPGs, area exploration Perhaps probably the most hotly expected sport of 2017 on PC, in …