码迷,mamicode.com
首页 > 其他好文 > 详细

单元练习

时间:2016-10-11 00:10:58      阅读:209      评论:0      收藏:0      [点我收藏+]

标签:压缩包

<<<第十二单元练习>>>

1.在server主机中把/etc目录打包压缩到/mnt中,名字为etc.tar.gz

[root@server /]# tar zcf /mnt/etc.tar.gz etc

[root@server /]# ll /mnt

total 8540

-rw-r--r--. 1 root root 8742561 Oct 10 07:32 etc.tar.gz

2.复制server主机中的etc.tar.gz到desktop主机的/mnt中

[root@server /]# cp /mnt/etc.tar.gz root@172.25.254.99:/mnt

cp: cannot create regular file ‘root@172.25.254.99:/mnt’: No such file or directory

[root@server /]# scp /mnt/etc.tar.gz root@172.25.254.99:/mnt

root@172.25.254.99‘s password:

etc.tar.gz                                    100% 8538KB   8.3MB/s   00:00  

3.同步server主机中的/etc中的所有文件到desktop主机中/mnt中,包含链接文件

[root@server /]# cd /root/Desktop

[root@server Desktop]# rsync -lr /etc root@172.25.254.99:/mnt

root@172.25.254.99‘s password:

[root@server Desktop]# ll /mnt

total 8540

-rw-r--r--. 1 root root 8742561 Oct 10 07:32 etc.tar.gz

[root@desktop Desktop]# ll /mnt

total 8568

drwxr-xr-x. 133 root    root       8192 Oct 10 07:40 etc

-rw-r--r--.   1 root    root    8742561 Oct 10 07:36 etc.tar.gz

-rw-rw-r--.   1 student student    1690 Oct 10 00:57 file.all

-rw-rw-r--.   1 student student     815 Oct 10 00:55 find.err

-rw-rw-r--.   1 student student      30 Oct 10 00:54 find.out

-rw-rw-r--.   1 student student      30 Oct 10 01:04 find.out.1

 

<<<第十一单元练习>>>

1.在系统中创建set-ip-tool命令要求如下

当在系统中执行set-ip-tool 172.25.254.X 后

*)会自动显示ifconfig命令的输出

*)系统ip被设定为:172.25.254.X

*)系统网关被设定为:172.25.254.250

*)系统dns被设定为:172.25.254.250

[root@desktop Desktop]# ifconfig

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500

        inet 172.25.254.99  netmask 255.255.255.0  broadcast 172.25.254.255

        inet6 fe80::5054:ff:fe00:310a  prefixlen 64  scopeid 0x20<link>

        ether 52:54:00:00:31:0a  txqueuelen 1000  (Ethernet)

        RX packets 9039  bytes 39051255 (37.2 MiB)

        RX errors 0  dropped 0  overruns 0  frame 0

        TX packets 4424  bytes 337552 (329.6 KiB)

        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

 

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536

        inet 127.0.0.1  netmask 255.0.0.0

        inet6 ::1  prefixlen 128  scopeid 0x10<host>

        loop  txqueuelen 0  (Local Loopback)

        RX packets 1846  bytes 159460 (155.7 KiB)

        RX errors 0  dropped 0  overruns 0  frame 0

        TX packets 1846  bytes 159460 (155.7 KiB)

        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

 

 


本文出自 “12106768” 博客,请务必保留此出处http://12116768.blog.51cto.com/12106768/1860379

单元练习

标签:压缩包

原文地址:http://12116768.blog.51cto.com/12106768/1860379

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!