Piping – using | symbol

Reading Time: 3 minutes

Pipelines (|) We often want to take the output of one command and pass it on to another. The standard way of performing this is using a pipeline, referred to as pipe, or pipeing the output. The pipe is a vertical bar ‘|’. On a standard US keyboard this shares the same ‘\’ key, but… Continue reading Piping – using | symbol

Published
Categorized as Linux Tagged

Redirect output – using > symbol

Reading Time: 3 minutes

The > symbol is used to redirect the output of a command. Redirecting stdout, stdin and stderr (> <) Unless a command is piped into another the output normally goes to the standard output (stdout) which is normally the screen. The input is normally taken from standard input (stdin) which is normally the keyboard. To automate processes… Continue reading Redirect output – using > symbol

Published
Categorized as Linux Tagged

Using wildcards in Linux

Reading Time: 2 minutes

Wildcards (also referred to as meta characters) are symbols or special characters that represent other characters. You can use them with any command such as ls command or rm command to list or remove files matching a given criteria, receptively. There are three main wildcards in Linux: An asterisk (*) – matches one or more occurrences of any character, including no character.… Continue reading Using wildcards in Linux

Published
Categorized as Linux Tagged

Simple Linux commands

Reading Time: 3 minutes

These are a list of the most commonly used linux commands Command Description ls It is a list command and will display the directories and files visible under the present working directory ls -R Goes a step further to display or list files in sub-directories of the present working directory ls -a The argument -a… Continue reading Simple Linux commands

Published
Categorized as Linux Tagged

linux man command (manual)

Reading Time: 2 minutes

The man command is used to view a system’s reference manuals(man pages). The command gives users access to manual pages for command-line utilities and tools. Here is the example output for man ftp that explains the usage of ftp command. type q to exit from the manual screen Each manual page is divided into sections: NAME, SYNOPSIS, CONFIGURATION,… Continue reading linux man command (manual)

Published
Categorized as Linux Tagged

Tools to connect to Linux from Windows (Putty and MobaXterm)

Reading Time: 3 minutes

Putty is the most popular tool to connect to the Linux server. Putty is a very simple application interface that can open different port connections. Download Putty from https://putty.en.softonic.com/ or Get Putty (Unofficial) – Microsoft Store Click on the icon and enter the connection properties. enter the address and port (most commonly 22) Click on… Continue reading Tools to connect to Linux from Windows (Putty and MobaXterm)

Published
Categorized as Linux Tagged

Linux Interview Questions

Reading Time: 21 minutes

1) What is Linux? Linux is an operating system based on UNIX and was first introduced by Linus Torvalds. It is based on the Linux Kernel and can run on different hardware platforms manufactured by Intel, MIPS, HP, IBM, SPARC, and Motorola. Another popular element in Linux is its mascot, a penguin figure named Tux. 2) What is the difference between UNIX and LINUX? Unix originally began as a propriety operating system from Bell Laboratories, which later on spawned into different commercial versions. On the other hand, Linux is free, open source and intended as a non-propriety operating system for the masses.

VI/VIM Text Editor Commands: Linux/Unix

Reading Time: 6 minutes

In this tutorial, you will learn- What is the VI editor? Command mode Insert mode Starting the vi editor vi Editing commands Moving within a file Saving and Closing the file What is the VI editor? The VI editor is the most popular and classic text editor in the Linux family. Below, are some reasons which make it a widely used editor – It is available in almost all Linux Distributions It works the same across different platforms and Distributions It is user-friendly. Hence, millions of Linux users love it and use it for their editing needs Nowadays, there are advanced versions of the vi editor available, and the most popular one is VIM which is Vi Improved. Some of the other ones are Elvis, Nvi, Nano, and Vile. It is wise to learn vi because it is feature-rich and offers endless possibilities to edit a file. To work on VI editor, you need to understand its operation modes. They can be divided into two main parts. Click here if the video is not accessible Command mode: The vi editor opens in this mode, and it only understands commands In this mode, you can, move the cursor and cut, copy, paste the text This mode also saves the changes you have made to the file Commands are case sensitive. You should use the right letter case. Insert mode: This mode is for inserting text in the file. You can switch to the Insert mode from the command mode  by pressing ‘i’ on the keyboard Once you are in Insert mode, any key would be taken as an input for the file on which you are currently working. To return to the command mode and save the changes you have made you need to press the Esc key Starting the vi editor To launch the VI Editor -Open the Terminal (CLI) and type vi or &If you specify an existing file, then the editor would open it for you to edit. Else, you can create a new file. vi Editing commands Note: You should be in the “command mode” to execute these commands. VI editor is case-sensitive so make sure you type the commands in the right letter-case. Keystrokes Action i Insert at cursor (goes into insert mode) a Write after cursor (goes into insert mode) A Write at the end of line (goes into insert mode) ESC Terminate insert mode u Undo last change U Undo all changes to the entire line o Open a new line (goes into insert mode) dd
3dd Delete line
Delete 3 lines. D Delete contents of line after the cursor C Delete contents of a line after the cursor and insert new text. Press ESC key to end insertion. dw
4dw Delete word
Delete 4 words cw Change word x Delete character at the cursor r Replace character R Overwrite characters from cursor onward s Substitute one character under cursor continue to insert S Substitute entire line and begin to insert at the beginning of the line ~ Change case of individual character Make sure you press the right command otherwise you will end up making undesirable changes to the file. You can also enter the insert mode by pressing a, A, o, as required. Moving within a file You need to be in the command mode to move within a file. The default keys for navigation are mentioned below else; You can also use the arrow keys on the keyboard. Keystroke Use k Move cursor up j Move cursor down h Move cursor left l Move cursor right Saving and Closing the file You should be in the command mode to exit the editor and save changes to the file. Keystroke Use Shift+zz Save the file and quit :w Save the file but keep it open :q Quit without saving :wq Save the file and quit Summary: The vi editor is the most popular and commonly used Linux text editor It is usually available in all Linux Distributions. It works in two modes, Command and Insert Command mode takes the user commands, and the Insert mode is for editing text You should know the commands to work on your file easily Learning to use this editor can benefit you in creating scripts and editing files.  

Published
Categorized as Linux Tagged