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

WS1.1-OS Intro

1. The document provides instructions for a Linux file manipulation exercise. It asks the user to perform tasks like copying, moving, renaming files and directories using basic Linux commands. 2. It outlines a sample directory structure under /home/caine with subdirectories like test1, mydir1, data, etc. and asks the user to perform file operations within this structure. 3. Tasks include copying files between directories while changing or keeping the same name, renaming a file within a directory, changing into a subdirectory and copying files into the current directory.

Uploaded by

Le Ba Ha QP3526
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
75 views

WS1.1-OS Intro

1. The document provides instructions for a Linux file manipulation exercise. It asks the user to perform tasks like copying, moving, renaming files and directories using basic Linux commands. 2. It outlines a sample directory structure under /home/caine with subdirectories like test1, mydir1, data, etc. and asks the user to perform file operations within this structure. 3. Tasks include copying files between directories while changing or keeping the same name, renaming a file within a directory, changing into a subdirectory and copying files into the current directory.

Uploaded by

Le Ba Ha QP3526
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

File: WS1.

1_Rollnumber_Name_Class
Preparation
1. What will happen if you type man man in Linux?
Paste screenshot show results of command….
Fig1: Enter command:
Fig2: Results of command
2. How can you use the command ls to find out about the size of the file /etc/lilo.con?

3. What happens to the files in the command mv file1 file2 ? Which option of mv
issues a warning?

4. What is the command that you issue if you are in directory / and want to copy the file
/mydata to directory /labdata?
5. What is the command that you issue if you are in directory / and want to copy all files
and directories under /mydirectory to directory /newdirectory?
6. What happens when you type rm * in a directory?
7. What is the command used to delete all files and directories under the directory
/mydirectory?
This question covers basic file manipulation. To begin this question use the first button to set
up a small file and directory tree in /home/caine. The resulting tree looks like:
/
+--- home
|
+--- caine
|
+--- test1
| +--- file1
| +--- file2
| +--- file3
| +--- file4
|
+--- mydir1
| +--- info1
| +--- info2
|
+--- data
| +--- data1
| +--- data2
|
+--- lines
+--- words
+--- info
8. Bottom of Form
9. COPY file1 from test1 to data. Keep the name as file1.
10. COPY file2 from test1 to data. Change the name as you copy the file to the new
name of filecopy1
11. Rename info1 to newinfo1. Do not move it out of mydir1 ?
12. Change directory into mydir1, and then copy "lines" into the current directory.
13. Still in mydir1, concatinate info2 and lines, saving the output as "joined".?
14. Still in mydir1, concatinate info2 and lines and file1 from test1, saving the output as
"joined2".?

Classwork

Exercise 1:
In the console or terminal window, type the following LINUX commands on the command
line.
Note and write down the results
$ ls
$ pwd
$ps
$ cd ..
$ pwd
$ cd /usr/local
$ ls
Exercise 2:
Execute the following command and explain the meaning of each of them.
• ifconfig
• route –n
• hostname
• cat /proc/cpuinfo
• free –m or top
• dpkg ‐l
• uname –r
Exercise 3:
In your home folder, create a folder tree as following. Note that, the rectangular describes a
folder and the circle represent for a file. You can add any information into your created files.
- Create file Hello.java in folder Java and add whatever you want into that file.
- Copy file Hello.java to folder OS and rename it to newHello.txt
Exercise 4:
- Create a file named user.txt. Then, you add n usernames (each in one line, n>=5).
(cat >)
- Display the content of file user.txt (cat )
- Display list of n sorted usernames in your file and store that sorted list into a new
file named suser.txt (sort)
- Count the number of users in your file and display it.

You might also like