man手册、zip备份
man手册、zip备份
3.1问题
本例要求掌握man帮助手册的使用,以及zip压缩/解压缩的操作,完成下列任务:
查阅passwd命令、/etc/passwd配置文件的手册页
使用zip打包/usr/share/doc/qemu-kvm/目录
3.2方案
zip/unzip压缩与解压缩:
制作zip压缩包:zip[-r]备份文件.zip被归档的文档...
释放zip压缩包:unzip备份文件.zip[-d目标文件夹]
3.3步骤
实现此案例需要按照如下步骤进行。
步骤一:使用man手册页获取帮助
1)查看passwd命令的手册页
[root@svr7~]#man passwd
PASSWD(1)User utilities PASSWD(1)
NAME
passwd-update user's authentication tokens
SYNOPSIS
passwd[-k][-l][-u[-f]][-d][-e][-n mindays][-x maxdays][-w
warndays][-i inactivedays][-S][--stdin][username]
DESCRIPTION
The passwd utility is used to update user's authentication token(s).
This task is achieved through calls to the Linux-PAM and Libuser API.
Essentially,it initializes itself as a"passwd"service with Linux-
PAM and utilizes configured password modules to authenticate and then
update a user's password.
....
2)查看/etc/passwd配置文件的手册页
[root@svr7~]#man 2 passwd
PASSWD(5)Linux Programmer's Manual PASSWD(5)
NAME
passwd-password file
DESCRIPTION
The/etc/passwd file is a text file that describes user login
accounts for the system.It should have read permission allowed for
all users(many utilities,like ls(1)use it to map user IDs to user‐
names),but write access only for the superuser.
In the good old days there was no great problem with this general
read permission.Everybody could read the encrypted passwords,but
the hardware was too slow to crack a well-chosen password,and more‐
over the basic assumption used to be that of a friendly user-commu‐
nity.These days many people run some version of the shadow password
suite,where/etc/passwd has an'x'character in the password
....
步骤二:使用zip命令制作压缩包
1)将目录/usr/share/doc/qemu-kvm/备份为/root/qemu-kvm.zip
[root@svr7~]#zip -r /root/qemu-kvm.zip /usr/share/doc/qemu-kvm/
adding:usr/share/doc/qemu-kvm/(stored 0%)
adding:usr/share/doc/qemu-kvm/COPYING(deflated 62%)
adding:usr/share/doc/qemu-kvm/COPYING.LIB(deflated 65%)
adding:usr/share/doc/qemu-kvm/Changelog(deflated 61%)
adding:usr/share/doc/qemu-kvm/LICENSE(deflated 45%)
adding:usr/share/doc/qemu-kvm/README(deflated 4%)
2)恢复测试
l 删除目标文件夹并确认结果:
[root@svr7~]#rm -rf /usr/share/doc/qemu-kvm/
[root@svr7~]#ls /usr/share/doc/qemu-kvm/
ls:cannot access/usr/share/doc/qemu-kvm/:No such file or directory
l 恢复目标文件夹并确认结果:
[root@svr7~]#unzip /root/qemu-kvm.zip-d/
Archive:/root/qemu-kvm.zip
creating:/usr/share/doc/qemu-kvm/
inflating:/usr/share/doc/qemu-kvm/COPYING
inflating:/usr/share/doc/qemu-kvm/COPYING.LIB
inflating:/usr/share/doc/qemu-kvm/Changelog
....
[root@svr7~]#ls /usr/share/doc/qemu-kvm/
COPYING README qemu-tech.html
COPYING.LIB README.rhel6-gpxe-source qmp-commands.txt
Changelog README.systemtap qmp-events.txt
LICENSE qemu-doc.html qmp-spec.txt
man手册、zip备份的更多相关文章
- Service系统服务(二):补充应用技巧、软连接与硬连接、man手册、zip备份、vim效率操作、自定义yum软件仓库、发布及测试yum仓库、编译安装软件包
一.补充应用技巧 目标: 本例要求掌握在运维中比较常用的一些扩展命令技巧的使用,完成下列小技巧操作: 1> 采用数值形式将目录/root的权限调整为 rwx------ 2> 将记录的 ...
- SQLite学习手册(目录)
链接地址:http://www.cnblogs.com/stephen-liu74/archive/2012/01/22/2328757.html 在实际的应用中,SQLite作为目前最为流行的开源嵌 ...
- SQLite学习手册
在实际的应用中,SQLite作为目前最为流行的开源嵌入式关系型数据库,在系统的架构设计中正在扮演着越来越为重要的角色.和很多其它嵌入式NoSQL数据库不同的是,SQLite支持很多关系型数据库的基本特 ...
- SQLite学习手册(转)
原文网址:http://www.cnblogs.com/stephen-liu74/archive/2012/01/22/2328757.html 在实际的应用中,SQLite作为目前最为流行的开源嵌 ...
- 100天搞定机器学习|day45-53 推荐一本豆瓣评分9.3的书:《Python数据科学手册》
<Python数据科学手册>共五章,每章介绍一到两个Python数据科学中的重点工具包.首先从IPython和Jupyter开始,它们提供了数据科学家需要的计算环境:第2章讲解能提供nda ...
- C#源码500份
C Sharp 短信发送平台源代码.rar http://1000eb.com/5c6vASP.NET+AJAX基础示例 视频教程 http://1000eb.com/89jcC# Winform ...
- Logback学习笔记
Logback介绍 Logback 分为三个模块:Core.Classic 和 Access.Core模块是其他两个模块的基础. Classic模块扩展了core模块. Classic模块相当于log ...
- logback学习与配置使用
Logback介绍 Logback 分为三个模块:Core.Classic 和 Access.Core模块是其他两个模块的基础. Classic模块扩展了core模块. Classic模块相当于log ...
- winkawaks模拟器
Winkawaks (温科沃克斯)win+ka(日文)+wa(也是日文)+k+s 最好的街机模拟器之一,与Nebula和MAME齐名,支持的游戏的有CAPCOM公司的CPS1,CPS2所有游戏,如三国 ...
随机推荐
- 序列化器:ModelSerializer
ModelSerializer 类提供了一个快捷方式,可让你基于 Models 自动创建一个 Serializer 类,其中的字段与模型类字段对应. ModelSerializer 类与常规 Seri ...
- Kaggle 题目 nu-cs6220-assignment-1
Kaggle题目 nu-cs6220-assignment-1 题目地址如下: https://www.kaggle.com/c/nu-cs6220-assignment-1/overview 这是个 ...
- 性能测试进阶:(一)性能测试工具Locust
An open source load testing tool. 一个开源性能测试工具. define user behaviour with python code, and swarm your ...
- mongo的聚合操作
对图7-1所示的数据集exampledata1,使用聚合操作实现以下功能: (1)不返回_id字段,只返回age和sex字段. (2)所有age大于28的记录,只返回age和sex. (3)在$mat ...
- React笔记1
目录 1.react基础:类组件.函数式组件.ES5/ES6继承 2.生命周期钩子函数 3.什么是JSX 4.props和state有什么区别 5.路由配置 6.自定义封住组件 7.React 状态管 ...
- 分享几个 PHP 编码的最佳实践
对于初学者而言,可能很难理解为什么某些做法更安全. 但是,以下一些技巧可能超出了 PHP 的范围. 始终使用大括号 让我们看下面的代码: if (isset($condition) && ...
- 创建和存储 cookie
在这个例子中我们要创建一个存储访问者名字的 cookie.当访问者首次访问网站时,他们会被要求填写姓名.名字会存储于 cookie 中.当访问者再次访问网站时,他们就会收到欢迎词. 首先,我们会创建一 ...
- Event loops秒懂
Event loops秒懂 简介 JS是一种单线程脚本语言,为什么要设计成单线程? 举例说明,假设JS是多线程脚本语言,A线程修改了DOM,B线程删除了DOM,一旦B线程先执行完,DOM被删除了,A线 ...
- Mysql 查询天、周,月,季度、年的数据
Mysql 查询天.周,月,季度.年的数据 今天 select * from 表名 where to_days(时间字段名) = to_days(now()); 昨天 SELECT * FROM 表名 ...
- [C#] 命令总线模式
1 高内聚.低耦合 虽然已经毕业很多年了,但依然总是能记得,<软件工程>这门课的老师总是强调 "高内聚,低耦合". 这些年,在架构方面的技术发展方向,目标就是不断的拆分 ...