Linux and Unix echo command tutorial with examples

The “echo” command in Unix is often used in the shell script for displaying/printing messages on the terminal.There are two uses of the “echo” command. 1. echo to print messages on the terminal. Echo with options -n: This option prevents the trailing newline character from being printed. It is useful when you want to display … Read more

Unix Linux date command tutorial with examples

The linux date command is used to display and set the date of the system.To see the current date type the command “ date” on the terminal as shown the below

output

Linux date Format Linux date format is as below %Y: 4-digit year (e.g., 2023) %y: 2-digit year (e.g., 23) %m: 2-digit … Read more

Linux and Unix cd command tutorial with examples

Command cd stands for Change Directory. You can change directory or move from one directory to another directory by using cd command. Syntax:

Example: pwd command display the absolute path name of current directory. To see the current directory absolute path press pwd command on terminal.

We are currently in “ it ’ … Read more

Linux and Unix mv command tutorial with examples

“mv” command is used to moves a group of file to a another/different directory. “mv” command can also use to rename file and directory. This command does not create a new copy of file , it only rename it. When we rename it does not consume any additional space on the disk. Syntax:

Example … Read more

Linux and Unix tail command tutorial with examples

Linux and Unix tail command is one of the important command. Command tail displays the bottom/end of the file at the terminal. When “tail” command is used without any option it will display the bottom/end ten lines of the file. Syntax of tail Command in Unix and Linux Syntax:

Example of tail Command in … Read more

Linux and Unix head command tutorial with examples

Command head displays the beginning/top of the file at the terminal. When “head” command is used without any option it will display the beginning/top ten lines of the file. Syntax:

Example: Suppose we have a file Employee.txt as shown below and we want to see the beginning/top of this file by default it will … Read more

Linux and Unix ls command tutorial with examples

ls command list all the file and directory name present in the current directory. Syntax:

Example: Print the name of all the directory and file available in the current directory.

Above command display four file and directory name. Check availability of file or directory: We can check whether a particular file or directory … Read more

Linux and Unix rmdir command tutorial with examples

rmdir stands for remove directory. In the UNIX file system, we can remove directory by using rmdir command. Syntax:

Note: In above syntax in the place of [directory name] we will specify the name of the directory to be removed. Example:

The directory abc is removed. To confirm directory is created press “ls” … Read more