Linux上的文件管理类命令

常用的文件目录管理命令:cd,pwd,ls,mkdir,rmdir,tree,more,less,head,tail,cp,mv,rm。

cd命令:改变目录 后面加绝对或者相对路径

命令格式:cd [options] [Dirname]

[Azuth@azuth ~]$ cd /home/Azuth
[Azuth@azuth ~]$ pwd
/home/Azuth

pwd命令:以绝对路径的方式显示用户当前的工作目录。

命令格式:pwd [options]

[Azuth@azuth ~]$ pwd
/home/Azuth

ls命令:显示指定文件目录的文件信息,默认显示当前目录下的文件信息。
命令格式:ls [OPTION]… [FILE]…

total 0
drwxr-xr-x. 2 Azuth Azuth 6 May 20 19:39 Desktop
drwxr-xr-x. 2 Azuth Azuth 6 May 20 19:39 Documents
drwxr-xr-x. 2 Azuth Azuth 6 May 20 19:39 Downloads
drwxr-xr-x. 2 Azuth Azuth 6 May 20 19:39 Music
drwxrwxr-x. 2 Azuth Azuth 6 May 20 19:03 perl5
drwxr-xr-x. 2 Azuth Azuth 6 May 20 19:39 Pictures
drwxr-xr-x. 2 Azuth Azuth 6 May 20 19:39 Public
drwxr-xr-x. 2 Azuth Azuth 6 May 20 19:39 Templates
drwxr-xr-x. 2 Azuth Azuth 6 May 20 19:39 Videos
drwxr-xr-x. 2 Azuth Azuth 6 May 20 19:40 桌面

mkdir命令:mkdir 用指定的名字建立目录。 缺省时,新建立的目录模式为0777,即不加保护地对所有人 都可读、可写、可执行

命令格式:mkdir [options] [Dirname]

[Azuth@azuth ~]$ mkdir -p /home/Azuth/tmp/1/A

rmdir命令:移除空文件夹

命令格式:rmdir [options] [Dirname]

[Azuth@azuth ~]$ cd /home/Azuth/tmp/

[Azuth@azuth tmp]$ rmdir -p 1/A

 

 

本文来自投稿,不代表Linux运维部落立场,如若转载,请注明出处:http://www.178linux.com/99029

(0)
AzuthAzuth
上一篇 2018-05-20
下一篇 2018-05-20

相关推荐

  • 脚本练习

    脚本编程

    2018-04-15
  • 加密与安全

    申请证书& ssh 服务基于key验证

    2018-05-19
  • N31第三周作业

    本周(7.2–7.8)第3周 1、列出当前系统上所有已经登录的用户的用户名,注意:同一个用户登录多次,则只显示一次即可 [a@localhost ~]$ who | cut -d” ” -f1 | sort -u a [a@localhost ~]$ who a pts/0 2018-07-09 09:14 (192.16…

    Linux笔记 2018-07-09
  • cp 常用选项

    cp 选项:

    Linux笔记 2018-04-01
  • 如何制作LINUX服务脚本

    如何制作一个Linux启动服务          Linux在启动的时候都会跑很多系统自带的服务脚本,来控制系统服务的开启和关闭。这些服务是系统自带的,我们可以查看这些服务及其对应的脚本(ls /etc/init.d/)。这些服务有独立服务,也有依赖服务,依赖服务有被依赖服务和依赖别的服务。今天我们就来看看怎么来制作一个系统独立服务,方便我们以后需要自己手动…

    2018-05-10
  • linux第二周

    总结

    Linux笔记 2018-04-08