0% found this document useful (0 votes)
3 views

Linux File System Exrcise

The document outlines a Linux File System exercise with various tasks related to file system structure, user management, and command usage. It includes identifying directories, creating users, and executing commands for file manipulation. Additionally, it covers data handling using commands like grep and sort, along with specific questions about file attributes and system time commands.

Uploaded by

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

Linux File System Exrcise

The document outlines a Linux File System exercise with various tasks related to file system structure, user management, and command usage. It includes identifying directories, creating users, and executing commands for file manipulation. Additionally, it covers data handling using commands like grep and sort, along with specific questions about file attributes and system time commands.

Uploaded by

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

Linux File System Exercise

Figure 1

Desktop

Refer to Figure 1 above.


A
1. Identify the top level directories in the file system shown in Figure 1
2. Name five other top level directories that are missing in the Figure.
3. Name the directories that represent the home directories of all user accounts in the system.
4. How many users are in the system . Name them
5. Who can create users in a Linux machine?
6. Which commands can one use to create the users above.
7. How many home directories do you notice are in the system?
8. When are home directories created?
9. What are the contents of a home directory after they are created?
10. Distinguish between:
i. A command option and command arguments
ii. A command short option and a command long option
iii. The .(dot) and ..(dot dot) entries in a directory.
11. With examples give the command that you can use to
i. Create a directory in Linux
ii. Copy files in Linux
iii. Move file in Linux
iv. Delete a directory with contents
v. Rename A file in Linux
vi. Find for a file withing the file system
B. Refer to Figure 1 above.
1. Give any five examples of the use of command with options and arguments together.
2. Assume you have logged in as user James.
i. Explain how you will go about creating all the directories as shown the figure.
ii. Explain how you will go about creating all the files as shown.(Assume empty content)
iii. In which directory will the file .bash_history by located?
iv. In which directory will the file .bashrc by located?
v. How may directories are automatically created for you . Name them
3. Give the command you will use to create a copy of the Expenses directory and its content to the
Feb directory belonging to James.
4. Give the command you will use to move the Expenses directory and its content to the March
directory belonging to James
5. You are in January directory.
i. Which command/s and argument will you use to view the contents of the Food directory.
ii. Which command and argument will you use to view all the contents of all the directories
beneath the January directory in long listing.
iii. What will be the output if you run the command : ls -al /Expenses
iv. You want to be able to copy the content of the /data directory. What is the requirement?
Can you just do as you within the file system?
v. Which command and arguments will use to view the content of the data directory
6. Assume a file marks.txt containing student Id, Student name, Cat1 Marks, Cat2 marks,
Exam marks ,Aggregate marks and Grade in a columnar format in a directory Marks in
Peter’s home directory. The column are separated by a tab character.
i. Who can create such the directory Marks.
ii. Who can create the file marks.txt
iii. How can you find out the following attributes of the file?
a. Its size
b. Its owner
c. Last date of access
d. Number of links to the file
e. It Primary group?
f. Its Inode numbers
g. Whether the file is executable or not.
h. The access permissions of the world community to the file
iv. Which command/options can you use to:
a. Sort the file marks using the aggregate column?
b. Determine how many record of marks are there?
c. Determine how many students are in the file?
d. Display the five top performers?
e. Display the last 10 performers?
f. Display all those who scored A’s.?
g. Find out how many Students obtained A’s?
7. A user asks you to help him with a command to know the system time. How do you help. How
more can help the user as far as the command is concerned?
8. What can a user achieve with the date command?
9. Discuss the contents of an Inode data structure.
10. Give an example of absolute and relative path usage using Figure 1 above for reference.
11. Explain the significance of the man command
12. Discuss in details Possibilities made possible by the find command in Linux.
Shopping.txt : SEARCHING AND SORT TING EXERCISE
The grep | and sort Commands

C. Refer to Figure 2 Below.


1. Use the cat command and redirection operators to create the file shopping.txt with the content
as shown. The columns are separated by a tab character. The column labels are not supposed to
be included. They are only for guiding.
2. Use the cat to display the content of the file.
3. Which command/options can you use to:
a. Sort the file using the quantity column?
b. Determine how many record of food items are there?
c. Display all the drinks?
d. Display all the drinks that are sodas?
e. Create a file fats.txt of all the Fat sorted by unitcostP.
f. Find out how many Starches are in the file?
g. Find the most expensive grain

You might also like