Linux Custom Script Tasks
Linux Custom Script Tasks
Scenario There is a customer who came to you with a problem to have a custom linux
command for his operations. Your task is to understand the problem and create a linux
command via bash script as per the instructions.
Section A
1. I want a manual page of command so that I can see the full documentation of the command.
man ls
as output we get the doc and usage guidelines. Similarly if I execute man internsctl I want
to see the manual of my command.
2. Each linux command has an option --help which helps the end user to understand the use
cases via examples. Similarly if I execute internsctl --help it should provide me the
necessary help
internsctl --version
Section B
I want to execute the following command for -
Expected Output -
---
I want to get memory information of my server through the following command:
Expected Output
Note - above command should create user who can login to linux system and access his home
directory
---
I want to list all the regular users present on my server through the following command:
---
If want to list all the users with sudo permissions on my server through the following command:
Expected Output [make sure to have the output in following format only]
In case I want only specific information then I must have a provision to use options
--last-modified, m
If I want to obtain the size of the specified file only, I should be able to use the following
command:
If I want to obtain the permissions of the specified file only, I should be able to use the following
command:
If I want to obtain the owner of the specified file only, I should be able to use the following
command:
If I want to obtain the last modified time of the specified file only, I should be able to use the
following command: