ubuntu – ExpLinux https://www.explinux.com Explore Linux How to, Tutorials, Unix, Updates, Technology. Sun, 27 Jun 2021 07:26:38 +0000 en-US hourly 1 https://wordpress.org/?v=6.7.1 https://www.explinux.com/wp-content/uploads/2023/04/cropped-favicon-32x32-1-32x32.png ubuntu – ExpLinux https://www.explinux.com 32 32 How to Use vi Editor in Linux and vi Editor Cheat-Sheet with 38 Shortcut https://www.explinux.com/2020/07/how-to-use-vi-editor-in-linux-and-vi-editor-command-in-linux.html https://www.explinux.com/2020/07/how-to-use-vi-editor-in-linux-and-vi-editor-command-in-linux.html#comments Sun, 05 Jul 2020 04:30:00 +0000 https://explinux.online/2020/07/05/how-to-use-vi-editor-in-linux-and-vi-editor-command-in-linux/ How to Use vi Editor in Linux and vi Editor Cheat-Sheet with 38 Shortcut Read More »

]]>
How to Use vi Editor in Linux and vi Editor Command in Linux
How to Use vi Editor in Linux and vi Editor Command in Linux

How to Use vi Editor in Linux and vi Editor Command in Linux

vi Editor :

. vi is the symbolic link of vim and this default editor comes with Linux based OS. This is very popular among sysadmins. This a very simple and powerful editor. You can use it to make your rivels list, a letter to your valentine, script, code, and edit any source code. This is your best friend in the Linux system.

vi Editor modes:

vi Editor has 3 modes –

1- Command mode :

                                This is the default mode when we enter in vi editor. In this mode almost every key n keyboard has a function, so use it very carefully.
Command mode
Command mode when enter file using vi <filename>
Command mode when press esc key
Command mode when press esc key from any other mode

2- Insert Mode :

                         You can enter this mode by pressing the “i” key on the keyboard. In this mode, you can write anything your code, list, or edit file.
insert mode

3- Visual mode  or GUI mode :

                                                This is not available in all distro and less used feature of vi editor. You can enter this mode by pressing the “v” key on the keyboard from command mode.
visual mode
Note: By default vi editor mode is Command mode. You can enter any mode from command mode only and escape from that mode to command mode by pressing the “esc” key on the keyboard.
These are the modes of vi editor in Linux. Below you will see some vi editor cheat sheet which you can use in your sysadmin work and give you more understanding of vi editor commands in Linux.

vi Editor Basic Commands :

In this section, we will talk about the basic command of vi editor which has to know by every Linux user for use of the basic function of vi editor.

Create New File or Enter Any Existing File :

To enter any file use command vi <filename>. For example, see below
# vi explinux
enter vi editor
you will enter in command mode as default by this command.

Write or edit in vi editors:

Press lowercase i to enter in edit mode. Now you can write anything or delete and navigate by keyboard navigation arrow key.
insert mode

vi Editor Save and Exit :

When you finished your editing you have to come in command mode for exit or save the file. Please find below the steps to save and exit from the file.
  1. Press esc key on the keyboard to change command mode from insert mode.
  2. write “:wq! ” in lowercase. Press enter key to execute the command to save and exit from file. Please check below pic to understand more.
vi editor save and exit
w – stands for save file 
q – stands for quit from file 
! – do not ask anything just run my command 

vi Editor Cheat Sheet :

Now you have learned how to use vi editor and basic commands of vi editor which every Linux user should have known. Now we will talk about some advance command which should be known by every Linux sysadmin or any advance user.
These commands will run only in command mode as mentioned earlier. By default vi is in command mode if you are in another mode press esc key to enter in command mode.
Linux is a case sensitive so be careful about it.

List of Commands :

Open or edit any file :

# vi <filename>

Enter to Insert mode 

i

Enter in Command Mode:

esc key on the keyboard
Save the file and Continue Editing:
:w
Save and quit vi Editor :
:wq!
Quit from file and do not write change :
:q!

Yank :

Copy or yank line :
yy
Copy X number of lines :
Xyy
for example 3 lines – 3yy
Paste Yanked File Below the Cursor Line :
p
Paste Yanked File Above the Cursor Line :
P    or  shift+p
This is the yank function that can be used to reduce time. This is a very useful command.
Create a New Line below the current line of Cursor :
o
Create a New Line Above the Current Cursor Line:
O  or shift+o
Go To End of Line and Switch To Insert Mode for Write:
A  or shift+a
Switch To Insert Mode At Start Of Line:
a
Switch to Insert Mode at the Beginning of Line :
I   or  shift+ i
Move to Begin of the Word :
b
Move to End of  the Word:
e
 
Go to the Last Line of Open file :
G  or shift+g
Go to the X Number Line of Open file :
XG
for example, we have to go on 3rd line: 3G
Go to the X Number Line of Open file :
gg
Delete a Single Letter or Character:
x
Delete a Single Word in Open File:
dw
Delete X Number of Words in Open File :
Xdw
for example, delete 3 words: 3dw
Change Any Word in vi Editor :
cw
Delete an Entire Current Line :
dd
Delete X Lines in One Command :
Xdd
For example, we have to delete 3 lines then: 3dd
Change or Replace Any Character or Letter :
r
Overwrite All Characters form onwards Cursor Position: 
R  or shift+r
Get the Current Line’s line Number in Open File:
:num  and press enter
Get All Lines’s Line Number in Open File:
:set nu  and press enter key
Undo Last Change in vi Editor :
u
Undo Last Change in entire Line vi Editor :
U  or shift+g

Search in vi Editor :

/<yourstring>
or
?<yourstring>
press n for the next result in an open file in vi editor .

Navigation In vi Editor :

Move left :
h
Move Down:
j
Move up :
k
Move right :
l
At this point, you are familiar with vi editor commands. Practice more to become pro at vi editor.

Summary :

  • The vi editor is most popular and distributed in every Linux distribution to edit almost all types of files.
  • There are 3 modes of vi editor
  • In this article, we covered almost all commands of vi editor
Share Article if you like it or report any bug in comments
]]>
https://www.explinux.com/2020/07/how-to-use-vi-editor-in-linux-and-vi-editor-command-in-linux.html/feed 1
How To Install Ubuntu Server 18.04 with Screenshots – Step by Step Guide with Bonus Tip https://www.explinux.com/2020/05/how-to-install-ubuntu-server-18-04-with-screenshots-step-by-step-guide.html https://www.explinux.com/2020/05/how-to-install-ubuntu-server-18-04-with-screenshots-step-by-step-guide.html#respond Thu, 14 May 2020 15:12:00 +0000 https://explinux.online/2020/05/14/how-to-install-ubuntu-server-18-04-with-screenshots-step-by-step-guide/ How To Install Ubuntu Server 18.04 with Screenshots – Step by Step Guide with Bonus Tip Read More »

]]>
install ubuntu 18.04

From the beginning of ubuntu till now ubuntu has added a lot of features and gains respect in OS. Even if you watch any tutorial for any web-based application it’s all on ubuntu because ubuntu is open source and focused on a new user base experience. Ubuntu always tries to add everything which is required to run the application. Even Kubernetes all testing has been initially done on ubuntu as per their document. Ubuntu desktop is best for any new user. In data centers, Ubuntu is the best alternative to non-REDHAT or fedora products.

In this article, we are going to show you how to install the ubuntu 18.04 server Bionic. Before that let’s talk about some new features of Ubuntu 18.04.

Features of Ubuntu 18.04

  • Ubuntu 18.04 has a new welcome desktop
  • It has a new GNOM desktop environment for a better experience. but you can still use Unity desktop.
  • It has improved its notification option. Now you will receive notification by default on the upper side.
  • It has a new login and lock screen.
  • More interactive and improved apps setting
  • Linux kernel version is 4.15 which is more secure and performance improved.
  • To install any package you need to use apt-get install package-name.
For all features, you can visit the ubuntu site and but the important features are mention are above.
You can download ubuntu from its official site till 2023 which is the end of support.

How to install ubuntu 18.04 server :

1- Mount DVD or ISO to your system or machine and boot from it. You will see the language select option. Choose your desired language.
start%2Bscreen install ubuntu 18.04 server
choose%2Blanguage install ubuntu 18.04 server
Choose your Country in fro below list :
choose%2Bteretory%2B 3 install ubuntu 18.04 server
2- For keyboard detect layout select “no” because sometimes in the case of VMware it takes the wrong keyboard.
keyboard%2Blayout%2B 4 install ubuntu 18.04 server
3- Select your keyboard as shown in the below pictures
choose%2Bkeyboard%2Blanguage%2B 5 install ubuntu 18.04 server
keyboard ubuntu
4-  Now it will load all components and discover server details.
loading%2Bdetails%2B 7 install ubuntu 18.04 server
5- If you are not connected with the network or in case of no DHCP server available it will ask you to configure IP manually otherwise it will take IP automatically. In this case, it is asking for IP.
if%2Bno%2Bdhcp%2Bavailable%2Bit%2Bwill%2Bask%2Bto%2Bconfigure%2Bmanually %2B8 install ubuntu 18.04 server
6 – Enter static IP
if%2Bno%2Bdhcp%2Bavailable%2Bit%2Bwill%2Bask%2Bto%2Bconfigure%2Bmanually %2B9 install ubuntu 18.04 server
enter%2BIP%2B 10 install ubuntu 18.04 server
7- Enter Netmask
enter%2BIP%2Bnetmask%2B 11 install ubuntu 18.04 server
8- Enter Gateway
enter%2BIP%2Bgateway 12 install ubuntu 18.04 server
9- Enter nameserver if you have otherwise use google DNS server 8.8.8.8
enter%2Bnameserver%2B 13 install ubuntu 18.04 server
10- Enter the hostname of the server.
enter%2Bhostname%2B 14 install ubuntu 18.04 server
11- Enter the desired username or you can enter ubuntu ( This is a standard user, not root).
enter%2Busername%2B 15 install ubuntu 18.04 server
12 – Enter password for user
enter%2Bpassword%2B 16 install ubuntu 18.04 server
13- Now here you have to create LVM, if you are not sure about it, use Guided – use entire disk and set up LVM.
LVM%2Bcreation%2B 17 install ubuntu 18.04 server
14- It will automatically take 10 or 20% extra to set up LVM. Click continue.
LVM%2Bcreation%2Bchoose%2Byes%2B 18 install ubuntu 18.04 server
LVM%2Bclick%2Bcontinue%2B 19 install ubuntu 18.04 server
15- Click yes on write the changes to disk. Now it will start creating an LVM partition and install OS. You need to wait until the process fully complete.
LVM%2Bclick%2Byes %2B20 install ubuntu 18.04 server
LVM%2Bcstart%2Bformating%2B %2B21 install ubuntu 18.04 server
16- Leave empty proxy server if you have any confusion or you can confirm with the network provider.
proxy%2Bserver%2Bleave%2Bblank%2B %2B22 install ubuntu 18.04 server
17- Configure Taskel  – choose no automatic update
choose%2Bno%2Bautomatic%2Bupdate%2B %2B23 install ubuntu 18.04 server
18- Software selection – if you are usingserver choose OpenSSH, you can choose as per your requirements. Press the spacebar to select and continue.
choose%2Bto%2Binstall%2Btools%252C%2Bpress%2Bspace%2Bbar%2B 24 install ubuntu 18.04 server
19- Install grub boot loader – click yes to install.
click%2Byes%2Bfor%2Bgrup%2Bloader 25 install ubuntu 18.04 server
20 – Installation finish click on continue, it will reboot server or machine and you are done.
installation%2Bfinished%2Bclick%2Bcontinue 26 install ubuntu 18.04 server
installation%2Bdone%2B 27 install ubuntu 18.04 server
Now at this point, you have installed ubuntu server 18.04. Start using it and you can customize OS.
Bonus Tip:
  • use apt-get update to update packages before use.
  • If you are using ssh then need to enable ssh because by default it may not be enabled to start and enable to automatically start after boot.
  • Ubuntu for the server has no desktop we can install the desktop version using taskel and after that, it automatically set it to run level 5.

Hope this tutorial helps you to install ubuntu. In case i miss something mention below in comments.

]]>
https://www.explinux.com/2020/05/how-to-install-ubuntu-server-18-04-with-screenshots-step-by-step-guide.html/feed 0