vi editor: how to go to a line by line number

vi editor and search expressions

The vi or vim editor is the popular and feature rich editor for editing text files in Linux. You can go to a particular line in the editor in several ways depending on where you are accessing it from. from the command line If you are opening a file from the command line, and you want the cursor at a…

how to use secure copy (scp) to copy files in linux

linux cp command to copy folders

If you work with computers of any kind, sooner or later you will want to copy files between folders. Often times you want to copy files between machines or computers over a network as well. Secure Copy or scp allows you to copy files between hosts on a network. The files are copied over ssh or secure shell which allows…

how to delete lines in vi or vim editor in linux

vi editor and search expressions

If you use vi or vim editor to edit text files, then you should be aware of the different text manipulation commands that exist in the editor. One of the common actions you will perform is the deletion of a single line or the deletion of multiple lines of text from with in the editor. Let’s see the various ways…

how to use the tail command to view files in linux

linux tail command

There are several different ways to view text files in Linux. You can use a text editor such as vi or gedit. You can also use an utility like more or less that will print out the complete content of the file. tail is yet another utility that will allow you to view the contents of a file. However, there…

how to unzip files in linux command line

unzip zip archive

In Linux, tar and gzip is the widely used archiving and compressing file format. Another most widely file compression file format is zip, which is more popular in other operating systems such as Windows. However it does not mean that Linux does not support the zip format. There are utilities in Linux that you can use to uncompress zip files….

brace expansion in linux simplfied with examples

brace expansion notation in linux command shell

If have been bash programming, then you must have seen brace expansion syntax being used in shell commands. The main purpose of brace expansion is automatically generate a set of strings (or numbers) that follows a general pattern. The pattern is enclosed with curly braces: ‘{‘ and ‘}’. This leads it to be commonly referred to as the brace expansion…

how to use ‘for’ loop in bash shell scripts

for loop in bash

If you have done any programming in any language, you should be familiar with loops. Almost all computer programming languages have some version of a loop statement. It is a language construct that allows you to execute a specific piece of code repeatedly, often with different set of data. In this post, we will talk specifically about the for loop…

how to delete a folder or directory in linux

Linux command line delete files

The Linux command to delete a folder or directory is the same as the one to delete a file. You can use the rm command to delete both files and folders. Deleting an empty directory is easy enough but if you try to remove a directory that has files in them, you will get an error. deleting an empty folder…

how to setuid for a file in linux

qalc or qalculate calculator in linux command line

SetUID stands for set user id on execution. The Linux systems allow for elevated or escalated privileges when executing files. This is a special type of permission that can be set on the file in addition to the usual set of file permissions. When the setuid is set on an executable file, the users can execute that file with the…

how to enable and disable syntax highlighting in vi or vim editor

vi syntax on and off

Syntax Highlighting is a feature where the readability of the displayed text is enhanced by showing certain words, phrases or keywords in differing colors or fonts. This is especially useful when viewing source code of various programming, scripting or markup languages. In fact any text with an associated grammar can have syntax highlighting. Integrated Development Environments (IDE) or Programming Editors…

how to search for text inside a file in the vi editor in linux

vi editor and search expressions

The vi or vim is a console based text editor in Linux. It is probably the most useful of Linux applications, in that you can quickly view and edit the text files right at the command shell. When viewing the text files, one of the useful features is the ability to search for a word or some text in the file….