0% found this document useful (0 votes)
161 views52 pages

Linux Assignment

The document provides instructions for performing various basic Linux commands and system administration tasks. It includes commands to: 1. Create directories, files and move/copy them between directories. Commands are also provided to list contents, rename and remove files/directories. 2. Edit files using vi editor including inserting text, searching, replacing and modifying lines. 3. Create, modify and manage user accounts including adding users to groups and modifying group permissions. 4. Manage file permissions including restricting access, changing ownership and assigning permission values. 5. Manage physical storage including listing drives/partitions, creating partitions, volume groups and logical volumes for LVM configuration.

Uploaded by

Somesh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
161 views52 pages

Linux Assignment

The document provides instructions for performing various basic Linux commands and system administration tasks. It includes commands to: 1. Create directories, files and move/copy them between directories. Commands are also provided to list contents, rename and remove files/directories. 2. Edit files using vi editor including inserting text, searching, replacing and modifying lines. 3. Create, modify and manage user accounts including adding users to groups and modifying group permissions. 4. Manage file permissions including restricting access, changing ownership and assigning permission values. 5. Manage physical storage including listing drives/partitions, creating partitions, volume groups and logical volumes for LVM configuration.

Uploaded by

Somesh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 52

Executing Basic Linux Commands

Create a directory "Mindtree" under /tmp

Create a text file "Production" under the directory "Kalinga" under /tmp
path.

Create a text file "Development" under the directory " Kalinga "
.
List the history of the commands and save it in the file, history.txt using
output redirection
Copy the file "Development" to the directory "Mindtree"

Move the file "Production" to the directory "Mindtree"


Rename the file "Development" to "Testing" under the director
"Mindtree"
Change the path to the directory "Mindtree" and list the contents and
ensure the absolute path.

Create a directory "Dissolve" under /tmp from the path /tmp/mindtree


Find the directory and files that are present in .txt format
Remove the text file "Testing" under the directory "Mindtree"

Remove the directory "Kalinga"


Remove the directory "Dissolve"

Display the foreground process that are running in the linux server
Display the background process and filter the processes starts with "sy"
Editing files using Vi editor in Linux
Save the file
Enter to insert mode
To enter into insert mode click ‘i’.
Find the string “Mindtree” in the text file
Find the string “Kalinga” in the text file by ignoring case
Find the string 2017 and replace with 2018
Copy the line number 4 and paste it in end of the file
Enter into command mode and type :4 to go to 4th line
Type esc + yy and move the cursor to bottom of file and enter p to
paste the line.
Go to the line number 9
Enter to command mode and enter :9
.
The cursor moved to 9th line
Delete the line number 10 from the current position
Line 10 is deleted
Delete the current line
Delete the character under the cursor
Move the cursor to charcter and click escape and enter x
Creating and managing user accounts

create 6 users Alice, Bob, Joe, Amy, Willam, JoJo and verify the users
information.
Create a group "Development", "Testing" and "Infrastructure". And add
the Bob and Joe user to Development Group, Amy and Alice to Testing
group and Willam and JoJo to Infrastructure group explicitly.
Giving access to Development group for Testing group members
Remove the user Alice from testing group and remove the user Bob
from the server respectively .
File permissions

Create the files "export","import" under the directory "kalinga"


Create the files "production","development" under "Mindtree"
Restrict read permission for others to the file import under Kalinga.
Make a Copy of file export to mindtree and Move import to mindtree
and compare the permissions.
List the files under Mindtree to view the permissions of the files and
add execute permission to the file "production" for its owner and Add
write permission to the group of the file
Change the ownership of mindtree to "Alice"
Assign 422 to the file development under mindtree and display the
permission.
Managing Physical storage
Consider the client "X" would like to list the physical drives in the linux
host and Display the list of physical partitions in the physical HDD
Create 2 partitions with ext3 and ext4 respectively and mount under
/dev.
Create physical partition.
Two partitions ext3 & ext4 are created.
create an LVM "Development" with 25 GB of size with physical volumes
and provide logical volumes LV1 with 10 GB and LV2 with 11 GB
Create physical volumes using pvcreate.
Create volume group using vgcreate command.
Create logical volume using lvcreate.

You might also like