Find and replace in Vi or vim editor

In this article, we will see Find and replace in Vi or vim editor with examples. IN Vim or vi, we can easily find and replace text using :s(:substitute) command. We can run this command only in normal mode. To go back to normal mode just press on ESC key from your keyboard. Find and replace operation is case-sensitive which means “R2schools” and “r2schools” are not same.

Syntax to Find and Replace in Vi or Vim editor:

:[range]s/{pattern}/{string}/[flags] [count]

Continue reading Find and replace in Vi or vim editor

File test operators in Linux shell script

In this article, we will see File test operators in Linux shell script with examples.

In linux and unix operating systems every thing is a file. When you are using files in your shell or bash script, it is a good idea to do some tests on the file before using it.

The file tests include:

Checking for existence of the file.
File is readable, writeable or executable.
File is empty or non-empty
Type of the file and so on. Continue reading File test operators in Linux shell script

Difference between find and locate command in Linux

In this article, we have explained Difference between find and locate command in Linux

Continue reading Difference between find and locate command in Linux
find locate
It searches directly in the file system for the required files and directories It searches in the database for the required files and directory
find command has number of options and easy to customized based on our requirement. locate command has very few options
We can find files based on name, size,type,depth,age,user,group, permissions etc We can find files only based on name and permissions
We can reduce the depth of search We cannot reduce depth of search

How to schedule a job in Linux using cron

In this video, we will see how to schedule a job in Linux using cron.

cron is a system process or daemon running on a Linux system and has a responsibility to detect and execute a certain cron job in a given time period. cron job is any defined task to run in a given time period. It can be a shell script or a simple bash command. Cron job helps us automate our routine task, it can be hourly, daily, monthly, or a given interval of period.
Continue reading How to schedule a job in Linux using cron