Linux Commands

How to grep All Files in a Directory Recursively

In this Linux tutorial we are going to learn how to grep all files in a directory Recursively in Linux using the grep command.

Most of the time we use grep command to search string in a Text File. But what if you want to search a string in all files in a Directory ?

Continue Reading >>

How to Create a Symbolic Link in Linux using ln Command

In This Linux tutorial We are going to learn how to create a symbolic link in Linux using ln command.

Also Called as soft links, A symbolic link in Linux is a pointer to another file or directory also what we called the target. When you access a symlink you actually accessing the original file and its content. If the original file deleted, then the symlink will be inaccessible, But if symbolic links are removed, it won’t effect to the original file. A symbolic link is just like a shortcut, very similar to shortcuts in Windows Operating System.

Continue Reading >>

How to Set Environment Variables in Linux

In This Tutorial we are going to learn how to set Environment Variables in Linux. Setting Environment Variable in Linux very easy. All we have to do is, export the variable using export command.

Setting environment variables in Linux very easy. All we have to do is, export the variable using export command.

FRUIT=apple

export FRUIT

It is also possible to set and export in one line.

export FRUIT=apple

Continue Reading >>

What is the Difference Between useradd and adduser Commands in Linux

In Linux more often you will see there is more than one Linux command available to do the same task. So when it comes to adding new users to the system most Linux distributions has two commands. Two commands are useradd and adduser. So what is the difference between useradd and adduser in Linux? Do they both always work the same way?

Even Though both can be used to create users, They do not always do the same thing. Depends on the Linux distribution two commands may behave differently.

Continue Reading >>

Linux Commands to Add User to Group

We can use either usermod or gpasswd command to add user to group in Linux operating system. And both commands are very easy to use.

usermod -a -G groupname username

gpasswd is a Linux command dedicated for group administration. Command option -a use to add user to group in Linux.

gpasswd -a username groupname

Continue Reading >>

What is Linux bash && Command Separator

In Shell scripting Often You will see multiple Linux bash commands run by spearing ‘&&’ sign. bash && use for executes sequence of commands one by one, but if one command failed reset of the commands will not execute. In other words, what bash && do is it runs multiple Linux commands one after another as long as there is no failure, if one command failed reset of the Linux commands will never execute.

Continue Reading >>