Linux中常用命令学习总结.pdf_第1页
Linux中常用命令学习总结.pdf_第2页
Linux中常用命令学习总结.pdf_第3页
Linux中常用命令学习总结.pdf_第4页
Linux中常用命令学习总结.pdf_第5页
已阅读5页,还剩1页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

Generated by Unregistered Batch DOC TO PDF Converter 2009 1 1201 1343 please register 1 切换目录 cd 到 tmp 目录 cd tmp 到上层目录 cd 2 查看当前目录 pwd 3 创建一个新的文件夹 mkdir 创建一层目录 创建多层目录 4 删除目录 rmdir p 如果需要层级删除目录 就需要带上 p 只能删除空目录 5 查询环境变量 echo PATH 或者 PATH 6 切换用户 su 用户名 7 移动文件 仔细阅读上面的命令 你会发现 mv还可以对文件进行从命名 上面的命令将 hellot txt 从 a 中移动到了 b 中 并改名为 hello1 txt Generated by Unregistered Batch DOC TO PDF Converter 2009 1 1201 1343 please register 8 查看文件与目录 ls ls a 目录名称 列出目录中所有的文件 ls al 目录名 列出长字符串 包含文件的一些详细信息 如果没有给定目录名 那么就是当前目录 9 文件的复制 cp adfilprsu 源文件 目标文件 将源文件拷贝到目标文件 cp src1 src2 des 将多个源文件拷贝到目的文件夹 cp 这个命令非常重要 不同的身份执行对命令产生不同的效果 尤其是 a p 参数 对不同的身份来说 区 别非常大 例 1 使用 root执行 如果我们要将文件的所有的属性复制过来 则要加上参数 a 复制一个目录到另外一个目录 cp r src desc 10 移除文件或目录 rm fir 文件或目录 f 强制的意思 忽略不存在的文件 不会出现警告信息 i 互动模式 删除前 会询问是否删除 Generated by Unregistered Batch DOC TO PDF Converter 2009 1 1201 1343 please register r 递归删除 这里不再演示 记得之前的 rmdir 吗 只能删除空目录 所以删除非空目录只能使用 rm r 11 文件类容查询 cat b 列出行号 n 列出行号 包括空白行 cat 是一次性将数据显示到屏幕上 如果想一页一页的看怎么办 使用 more 命令 more 在运行的过程中 你有几个按键可以按 空格键 代表向下翻一页 Enter 代表向下滚动一行 q 离开 more b 往回翻页 12 创建文件 touch touch a txt 就会在当前目录下创建 a txt 13 查找文件的命令 whereis find whereis bmsu 文件或目录名 b 二进制文件 m 只找在说明文件manual 路径下的问津 s 只找source 源文件 u 查找不在上述三个选项中的其他特殊文件 whereis ifconfig Generated by Unregistered Batch DOC TO PDF Converter 2009 1 1201 1343 please register 下面看看 find 命令 find path option actioin 查找 home 下面属于 gavin 的文件 find home user gavin 查找系统中不属于任何人的文件 find nouser 查找文件名为 passwd 的这个文件 find name passwd 查找文件类型为 socket的文件 find type s 14 磁盘和目录的容量 df 列出文件系统的整体磁盘使用量 du 评估文件系统的磁盘使用量 15 创建链接文件 ln sf 源文件 目标文件 s 创建软连接 如果不加则是硬连接 f 如果目标文件存在 则删除后再建 root localhost test2 echo good a txt root localhost test2 ls a txt root localhost test2 ln s a txt b root localhost test2 ls a txt b root localhost test2 ll total 12 rw r r 1 root root 5 Aug 8 01 09 a txt lrwxrwxrwx 1 root root 5 Aug 8 01 09 b a txt root localhost test2 echo hello b root localhost test2 cat b good hello root localhost test2 cat a txt Generated by Unregistered Batch DOC TO PDF Converter 2009 1 1201 1343 please register good hello root localhost test2 ln a txt c root localhost test2 ll total 20 rw r r 2 root root 11 Aug 8 01 09 a txt lrwxrwxrwx 1 root root 5 Aug 8 01 09 b a txt rw r r 2 root root 11 Aug 8 01 09 c root localhost test2 echo bad c root localhost test2 cat c good hello bad root localhost test2 cat a txt good hello bad root localhost test2 cat b good hello bad root localhost test2 rm a txt rm remove regular file a txt y root localhost test2 cat b cat b No such file or directory root localhost test2 cat c good hello bad root localhost test2 运行上面的命令行 相信你对 ln 的使用会非常清楚的 15 挂载 CD Generated b

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论