Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

AI1601 OS Pratice in Class

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

Preparation

To capture the screen of result, in VMWare workstation, you can choose:

A file will be saved into your Desktop with name of virtual machine name + timestamp.

Please do the same as guideline above for all the


request of “capture the screen of result”
1. What will happen if you type man man in Linux?
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/anhbn. The resulting tree looks like:
/
+--- home
|
+--- anhbn
|
+--- 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, concatenate info2 and lines, saving the output as "joined".?
14. Still in mydir1, concatenate info2 and lines and file1 from test1, saving the output as
"joined2".?
Pratice in class
Please fill in your contact information and do the 4 exercises:
Your name:
Student ID:
Mobile:

Exercise 1:
In the console or terminal window, type the following LINUX commands on the command
line. Note and write down the results. Capture the screen of result.

$ who
$ cd ~
$ ls
$ pwd
$ ps
$ cd ..
$ pwd
$ cd /usr/local
$ ls

Exercise 2:

Execute the following command and explain the meaning of each of them. Capture the
screen of result.
• ifconfig
• route –n
• hostname
• cat /proc/cpuinfo
• free –m or top => Ctrl + C to terminate
• dpkg ‐l
• uname –r
Exercise 3:
In your home folder (cd ~), 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
Capture the screen of result.

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.
Capture the screen of result.

You might also like