how to count the number of delimiters in a text file in linux

linux count characters, words, lines

It is easy enough to count lines in a text file, also it is easy enough to count characters with in a text file. So, counting delimiters in the text file should be just as simple. The delimiters are usually nothing but characters and counting those characters will give the count of delimiters in the file. For example, counting lines…

how to delete symbolic links in linux

Linking by cp in linux

Symbolic links and symlinks are one of the most popular features of posix based Linux systems. The symbolic links gives you the ability to duplicate files in the system with different names and location with out the need to create copies of the file. There are two different types of links that you can have in Linux: hard links and…

how to delete all empty directories in linux

Linux command line delete files

You might already know that in Linux a directory have to be empty before it can be deleted. Well…not quite true, you can force delete the directories. What if you want to remove only empty directories recursively from the folder structure? There are a couple of different ways to do this. We will see some of the options from the…

linux: how to replace text in file from command line

vi editor and search expressions

Linux has several different utilities that can perform string or text manipulation. Depending on your environment and the tools that are available, you should be able to easily parse, find and replace any string in a text file. Almost every single text editor comes with a find and replace feature with a UI, so we are going to only explore…

how to enable and disable ssh in linux

linux config file for sshd

ssh or secure shell is a network protocol that allows you to perform various network services remotely and securely over an unsecured network. There are several different operations that can be performed using the ssh protocol. The most common are probably logging in or connecting to a remote machine and transferring files over the network to a remote machine. In…

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 know different text manipulation commands that exist in the editor. One of the common actions you will perform is the deletion of a line or multiple lines from with in the editor. Let’s see the various ways you can delete a line in the vim editor….

how to use the tail command to view files in linux

tail command output in linux

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…