DEV Community

Cover image for LINUX COMMANDS.
Emmanuel Essien
Emmanuel Essien

Posted on

LINUX COMMANDS.

What Is Linux?

Linux is a computer operating system, it is used to run, study, modify, and redistribute the source code, or even sell copies of their modified code. In fact, one of the most popular platforms on the planet, Android, is powered by the linux operating system.

The Following are the steps to use some Linux commands using an Ubuntu Operating System.

  • Launch the VMware Workstation from your desktop.

VMware Workstation Icon

VMware Workstation Page

  • You click on create a Virtual Mahine, Use the Custom Option

Second Option

  • The next page is the VM Hardware Capability, so u select the one best suitable for your use. After that u hit next.

VM Hardware

  • You will be directed to the Guest Operating System Installation select the option "I WILL INSTALL THE OPERATING SYSTEM LATER" then click NEXT.

Guest Operating System Installation

  • The next page will be "SELECT GUEST OPERATING SYSTEM" this is the operating system that u want to be installed on the virtual machine. By default, it will be "MICROSOFT WINDOWS" for users of Windows OS. Pls do well to change to LINUX Operating System as you will get the version under to be Ubuntu then u click next.

Select A Guest O.S

Click Next

  • This Shows Us the number of processors we want to assign to the virtual machine as u wish

Processing Number

  • The next page tells us the memory we want to specify in the virtual machine depending on your workload

Memory Specification

  • Leave the following next settings at the default till u get the SELECT A DISK PAGE here you can customize your disk size. The recommended size for Ubuntu is 20GB you can add additional 5GB to it or as much as u want but it should not be below 20GB press next then finish.

Select A Disk Page

  • You get to the final page then you hit finish...

Finish Page

  • You Lunch the VM.

Intializing The VM

UBUNTU HOMEPAGE

  • You click the Ubuntu Start Button on the Lower Left, the browse throuh till you get to the terminal option and then you select.

SELECT THE TERMINAL

WORKING WITH ROOT

Root Picture

TerminalPage

  • To Use Root the command Is sudo su in your linux terminal or shell. This command will put you in a root environment. The SU command is used to run a function as a difrent user. It is the easiest way to switch or change to the administrative account in the current logged in session.

SUDO SU COMMAND

Navigating The File System

  • This command pwd tells us the file directory path you currently are in type pwd in your terminal or shell.

PWD Command

  • The Next command is ls command ls means list. This command lists directory.

ls command

By default, Ubuntu provides a list of directory as highlighted in the picture.

  • ls -l in your terminal or shell. This command list directory files and contents with detailed information.

ls -l command

r means read
w means write
x means execute
xr group

  • The next command is CD this command means change directory or to enter into a directory for example to change our directory to MUSIC DIRECTORY

Change Directory

To go back to the previous directory type Cd

Go Back To The Previous Directory

Same command applies if you want to enter any directory(pictures,downloads,public etc.)

  • Exit command takes you back to the Ubuntu Directory then you enter the sudo su command to enter root

Exit Command takes U Back to the Ubuntu Directory

Sudo Su

File And Directory Operations

  • touch (name of textfile) this command create a new, empty file in your terminal or shell(this is our text file). For example i created an empty file named Odogwuexchange

Created A Filename

  • mkdir Command this creates a new directory example: mkdir (name of directory)

Mkdir Command

To enter into a directory we use the cd command that is cd name of directory

Cd Name of directory

PLS NOTE CD TAKES TO A PREVIOUS DIRECTORY

  • cp command this copies files or directories, that is cp (file name) (destination)

CP COMMAND

CP COMMAND

  • cat Command this command display the content of a file NOTE: To type something inside the text file we use a text editor, by default VIM is ubuntu text editor. We are going to update the system being a first time user the command is apt update then you install VIM first if you have not already done so the command is: apt install vim

APT UPDATE

After the Update then u install the VIM using the code apt install vim

Install VIM

INSTALL VIM

Install Vim

Then After the installation we can now use the CAT command but first we need to type a document inside the text file since we have installed VIM text editor. To do this we need to type: vim (name of the Document you created using TOUCH command)

VIM TEXT EDITOR PAGE

Before typing on the text document page, you first press I which means insert then you can proceed to typing.**

Text Document Page

  • SHIFT AND COLUMN COMMAND After you are done typing we have to save it. To do this we press the ESC button on your keyboard. After this we press shift and column: at the same time,you will get the column key below the page as indicated below.

Shift And Column

  • wq command After this we hit W which means to save the text document hitting Q will take us out of the text document as shown below It will save and take you back to the directory

wq command

DIRECTORY PAGE

  • Now we can use the CAT Command to view what we have in our text document without opening the text editor. All we need to do is type cat (name of the text document) as shown below

CAT COMMAND

CAT COMMAND

  • RM command, this command will help you to delete a file by using rm (filename) in the picture I created multiple text files and I am going to list them using LS command, then I am going to use the RM command to delete

Text File creation

LIST COMMAND

RM AND LS COMMAND

  • rmdir (directory) command this lets the user to remove an empty directory. Type rmdir (name of directory) in the picture below notice how i created two directories(john, glory) and I used the rmdir command to delete the directory

rmdir command

  • Less(filename) command: This allow users to view contents of a textfile one screen at a time and then Q takes you back as shown below.

Less command

Contents of a Text File

  • To view all the commands done on the terminal you type history

History Command

List Of commands

This are the few Basic Linux Command.

Top comments (0)