Lab 4 Browsing the Filesystem

Sequence 1: Directory and File Organization

1. Log in as user student with the password student.

2. [student@stationX ~]$ pwd
/home/student

3. ls
    ls -a
    ls -al
-a option includes files whose names begin with a period and used for storing configuration information
The fifth column of ls -l's output displays the file's size.

4. [student@stationX ~]$ touch {report,graph}_{jan,feb,mar}

5. [student@stationX ~]$ ls

6. Make directory
[student@stationX ~]$ mkdir Projects
[student@stationX ~]$ mkdir Projects/graphs
[student@stationX ~]$ cd Projects
[student@stationX Projects]$ mkdir reports
[student@stationX Projects]$ cd reports
[student@stationX reports]$ mkdir ../Backups

[student@stationX reports]$ cd
[student@stationX ~]$ ls -l
[student@stationX ~]$ ls Projects

7. Move files
[student@stationX ~]$ mv graph_jan Projects/graphs
[student@stationX ~]$ mv graph_feb graph_mar Projects/graphs
[student@stationX ~]$ ls -l Projects/graphs/

8. Move the files in one command:
[student@stationX ~]$ mv report_jan report_feb Projects/reports
[student@stationX ~]$ ls -l Projects/reports

9. Remove the remaining report file:
[student@stationX ~]$ rm report_mar
[student@stationX ~]$ ls

10. Copy one using an absolute pathname and the other using a relative pathname:
[student@stationX ~]$ cd Projects/Backups
[student@stationX Backups]$ pwd

[student@stationX Backups]$ cp ../reports/report_jan .
[student@stationX Backups]$ cp /home/student/Projects/graphs/graph_jan .
[student@stationX Backups]$ ls -l

11. exit

Sequence 2: Managing Files with Nautilus

1. If you have not already, log into the graphical environment.

2. Double-click on the student's Home icon on your desktop.

3. Double-click on Projects, then graphs.

4. With the graphs window selected, press Ctrl-Shift-w to close the parent directory windows.

5. Press Ctrl-a to select all three graphs.

6. Press Ctrl-c to copy the files.

7. Press Ctrl-l (the letter l, not the number 1) to display the Open Location dialog. Type /tmp
(note that you can use tab-completion) and press Enter to open a new window displaying /
tmp.

8. Press Ctrl-Shift-n or right-click on the window background and select Create Folder to
create a new directory.

9. Type in Stuff_for_Bob as the new directory's name and double-click the directory to
open it

10. Press Ctrl-v to paste your graphs into /tmp/Stuff_for_Bob.

11. Press Ctrl-q to close all Nautilus windows

Sequence 3: Backing-up your system configuration

1. Log in on tty1 as user root with the password of redhat.

2. [root@stationX ~]# mkdir ~/backups

3. recursively copy
cp -rpv /etc/sysconfig ~/backups/sysconfig-20071231
cp -av /etc/sysconfig ~/backups/sysconfig-20071231

4. cp -av /etc/sysconfig ~/backups/sysconfig-20071231
~/backups/sysconfig-20071231/sysconfig/

5. cp -av /etc/sysconfig ~/backups/sysconfig-20071231
be prompted for confirmation before overwriting

posted on 2013-11-22 13:25  逝者如斯(乎)  阅读(228)  评论(0编辑  收藏  举报