Linux操作系统基础:tar命令详解与注意事项

需积分: 11 2 下载量 84 浏览量 更新于2024-08-25 收藏 4.93MB PPT 举报
"这篇教程主要关注的是Linux操作系统中的tar命令使用注意事项,以及操作系统的基础知识,包括操作系统概述、功能、结构,特别提到了Linux操作系统的特点和发展。" 在Linux系统中,`tar`命令是一个非常重要的工具,用于打包和归档文件。在使用tar命令时,有几点需要注意: 1. **路径处理**:当创建档案文件时,tar会删除文件路径开头的“/”斜线,导致恢复文件时的位置可能与备份时不同。为避免这个问题,建议在根目录下执行备份和恢复操作。 2. **不可变位的处理**:对于设置了不可变位(通过`chattr`命令)的文件,tar在恢复时不保留这个属性。备份完成后,需要再次使用`chattr`来设置文件的不可变位。 3. **读取速度**:tar命令总是顺序读取备份卷,这可能导致处理大型卷时速度较慢。在使用如磁带机这样的顺序介质时,无法利用随机存取数据库技术来加速。 操作系统是计算机系统的核心,负责管理硬件和软件资源,提供用户接口。在介绍中,提到了以下几个关键点: - **操作系统概述**:操作系统作为软件系统的核心,负责管理所有资源,协调硬件和软件,以及人机交互。 - **Linux操作系统**:Linux以其高效、稳定和跨平台的特性受到青睐,其开源属性(遵循GPL)使得学习、开发和应用更加自由。 - **Linux特征**:Linux内核的特性包括其灵活性、可定制性和广泛支持的硬件平台。 - **操作系统结构**:讨论了操作系统的结构,包括其管理和控制计算机资源的功能,以及提供用户友好界面的作用。 - **现代操作系统特点**:现代操作系统通常具有多任务、内存管理和并发性等特点,Linux作为其中的一个例子,展现了这些特性的实现和发展。 本教程适合初学者,从操作系统的基本概念入手,逐步引导读者了解Linux操作系统,包括其基本命令和系统管理。通过学习这部分内容,用户能够掌握Linux操作系统的基础操作,并理解操作系统如何在计算机系统中发挥作用。

为什么会这样[user_mongo@nosql01 replicaset]$ cd /opt [user_mongo@nosql01 opt]$ ll total 0 drwxr-xr-x. 3 root root 25 Mar 16 17:08 servers drwxr-xr-x. 2 root root 51 Mar 16 17:10 software [user_mongo@nosql01 opt]$ tar -zxvf /opt/software/mongodb-linux-x86_64-rhel70-4.4.12.tgz -C /opt/servers/mongodb_demo/replicaset/ mongodb-linux-x86_64-rhel70-4.4.12/LICENSE-Community.txt tar: mongodb-linux-x86_64-rhel70-4.4.12: Cannot mkdir: Permission denied tar: mongodb-linux-x86_64-rhel70-4.4.12/LICENSE-Community.txt: Cannot open: No such file or directory mongodb-linux-x86_64-rhel70-4.4.12/MPL-2 tar: mongodb-linux-x86_64-rhel70-4.4.12: Cannot mkdir: Permission denied tar: mongodb-linux-x86_64-rhel70-4.4.12/MPL-2: Cannot open: No such file or directory mongodb-linux-x86_64-rhel70-4.4.12/README tar: mongodb-linux-x86_64-rhel70-4.4.12: Cannot mkdir: Permission denied tar: mongodb-linux-x86_64-rhel70-4.4.12/README: Cannot open: No such file or directory mongodb-linux-x86_64-rhel70-4.4.12/THIRD-PARTY-NOTICES tar: mongodb-linux-x86_64-rhel70-4.4.12: Cannot mkdir: Permission denied tar: mongodb-linux-x86_64-rhel70-4.4.12/THIRD-PARTY-NOTICES: Cannot open: No such file or directory mongodb-linux-x86_64-rhel70-4.4.12/bin/install_compass tar: mongodb-linux-x86_64-rhel70-4.4.12: Cannot mkdir: Permission denied tar: mongodb-linux-x86_64-rhel70-4.4.12/bin/install_compass: Cannot open: No such file or directory mongodb-linux-x86_64-rhel70-4.4.12/bin/mongo tar: mongodb-linux-x86_64-rhel70-4.4.12: Cannot mkdir: Permission denied tar: mongodb-linux-x86_64-rhel70-4.4.12/bin/mongo: Cannot open: No such file or directory mongodb-linux-x86_64-rhel70-4.4.12/bin/mongod tar: mongodb-linux-x86_64-rhel70-4.4.12: Cannot mkdir: Permission denied tar: mongodb-linux-x86_64-rhel70-4.4.12/bin/mongod: Cannot open: No such file or directory mongodb-linux-x86_64-rhel70-4.4.12/bin/mongos tar: mongodb-linux-x86_64-rhel70-4.4.12: Cannot mkdir: Permission denied tar: mongodb-linux-x86_64-rhel70-4.4.12/bin/mongos: Cannot open: No such file or directory tar: Exiting with failure status due to previous errors [user_mongo@nosql01 opt]$ tar -zcvf /opt/software/mongodb-linux-x86_64-rhel70-4.4.12.tgz -C /opt/servers/mongodb_demo/replicaset/ tar: Cowardly refusing to create an empty archive Try `tar --help' or `tar --usage' for more information.

2023-06-01 上传