Shell like bash or sh are application which provide you a way to run other application/commands via the command line interface.
Most of the command and applications which you run (like vi, nano, ls, fsck etc) are separate applications, when you type in any of these commands the shell looks them up and runs them.
you can use a command called βwhichβ to find out where a particular command file is located. (e.g. which ls will give you where ls command is)
Linux Shell
Some or the other time as a sys admin you will come across a need to add multiple users to your Linux system. So the question is how to do the same.
Let us see how we can do the same in this post.
We will assume that N number of users are to be added with a standard prefix or suffix and values incrementing with numbers. e.g. employee27... emp28.. etc
The command to add a user is useradd
The command can be simply run as:
BASH is the default shell in GNU/Linux systems. While writing BASH scripts sometimes it become necessary to take action based upon the success of previous command. So how do we do this.
First we need to understand that almost every command that is run once completed returns a exit code, 99% of commands just use 0 for success, 1 for failure. Without getting into other details, lets see how we can use this value.