Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

General instructions 1 . The approach of solving the Problem solely depends on the Candidate 2 . Make sure to have Draw.io diagrams for the

General instructions
1. The approach of solving the Problem solely depends on the Candidate
2. Make sure to have Draw.io diagrams for the workflowns and application architecture
3. Every configuration, code written should be pushed on git (Private Repo)
4. Your are not permitted to share the doc with anyone, even with your colleagues
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.
Command name - internsctl
Command version - v0.1.0
Section A
1. I want a manual page of command so that I can see the full documentation of the command.
For example if you execute 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
3. I want to see version of my command by executing
internsctl --version
Section B
I want to execute the following command for -
Part1| Level Easy
I want to get cpu information of my server through the following command:
$ internsctl cpu getinfo
Expected Output -
I want similar output as we get from lscpu command
---
I want to get memory information of my server through the following command:
$ internsctl memory getinfo
Expected Output
I want similar output as we get from free command
Part2| Level Intermediate
I want to create a new user on my server through the following command:
$ internsctl user create
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:
$ internsctl user list
---
If want to list all the users with sudo permissions on my server through the following command:
$ internsctl user list --sudo-only
Part3| Advanced Level
By executing below command I want to get some information about a file
$ internsctl file getinfo
Expected Output [make sure to have the output in following format only]
xenonstack@xsd-034:~$ internsctl file getinfo hello.txt
File: hellot.txt
Access: -rw-r--r--
Size(B): 5448
Owner: xenonstack
Modify: 2020-10-0720:34:44.616123431+0530
In case I want only specific information then I must have a provision to use options
$ internsctl file getinfo [options]
--size, -s to print size
--permissions, -p print file permissions
--owner, o print file owner
--last-modified, m
Expected Output with options
If I want to obtain the size of the specified file only, I should be able to use the following
command:
xenonstack@xsd-034:~$ internsctl file getinfo --size hello.txt
5448
If I want to obtain the permissions of the specified file only, I should be able to use the following
command:
xenonstack@xsd-034:~$ internsctl file getinfo --permissions hello.txt
-rw-r--r--
If I want to obtain the owner of the specified file only, I should be able to use the following
command:
xenonstack@xsd-034:~$ internsctl file getinfo --owner hello.txt
xenonstack
If I want to obtain the last modified time of the specified file only, I should be able to use the
following command:
xenonstack@xsd-034:~$ internsctl file getinfo --last-modified hello.txt
2020-10-0720:34:44.616123431+0530

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advanced Database Systems For Integration Of Media And User Environments 98

Authors: Yahiko Kambayashi, Akifumi Makinouchi, Shunsuke Uemura, Katsumi Tanaka, Yoshifumi Masunaga

1st Edition

9810234368, 978-9810234362

Students also viewed these Databases questions

Question

Find solutions to the problems of pricing in high-risk markets

Answered: 1 week ago

Question

Why could the Robert Bosch approach make sense to the company?

Answered: 1 week ago