13 November

Using if-else in Shell Scripting

In the previous post, we learned how to use variables in shell script. Next, we are going to learn about using if-else in shell scripting. The if-else construct is used whenever we want to evaluate a condition i.e., whether some condition is true or false. Syntax if [ condition ] then   statement 1   […]

11 October

Using Variables in Shell Scripting

Variables are nothing but a placeholder for storing some value or data. Referencing the value of the variable is called variable referencing. Next, we will learn about using variables in shell scripting. How to assign value to a variable? The synatx for using a variable in shell scripting is simple variable_name=value Remember: Never give space […]

07 October

What is Shell Scripting?

A Shell script is a nothing but a sequence of commands written to achieve a specific task. For example: echo “script to create a file”touch File1echo “File created” What is the need of Shell Script? A script helps to automate tasks. For instance, if you are required to execute 20 commands every day, you will […]

22 September

Difference between read write and execute permissions

The topic of this post may seem trivial, but many students do not understand the difference between read, write and execute permissions for file and directory. For example, what is the point of assigning execute permission to directory? It’s never going to run. So, in this discussion we are going to clarify all such doubts. […]

27 August

How to create links using ln command in Linux?

Links in Linux are like Short-cuts in Windows. We create a shortcut for a file/folder in Windows so that the original file can be accessed from multiple locations. The same concept goes for links. Links help to access the file from multiple directories. Before we learn how to create links using ln command in Linux, […]

17 August

How to copy files using cp command in Linux?

The cp command in Linux is used to copy files and directories. Syntax $cp [OPTION]… SOURCE…Directory The SOURCE here means all the files that you want to copy and the last argument must be a Directory where you want to copy the files For Example $cp notes.txt D1 will copy the file notes.txt to directory […]

12 August

How to delete directories using rmdir command in Linux?

rmdir command in Linux is used to delete empty directories. Empty directory means a directory which do not have files or sub-directories. So, lets learn how to use mkdir command in Linux. Syntax $rmdir [OPTION]…DIRECTORY… Example The example above shows the deletion of directory Dir using rmdir command in Linux. Options used with rmdir in […]