Linux的目录处理命令上

xiaoxiao2021-02-28  24

一 建立目录

1、语法 mkdir -p [目录名] -p 递归创建 命令英文含义:make directories 2、实战 [root@localhost ~]# lsanaconda-ks.cfg gobin MusicChangeLog-2.6.0 goc2p PicturesDesktop golib PublicDocuments goproject TemplatesDownloads initial-setup-ks.cfg Videosgo1.8.3.linux-amd64.tar.gz linux-2.6.39.tar.bz2[root@localhost ~]# mkdir test[root@localhost ~]# lsanaconda-ks.cfg gobin MusicChangeLog-2.6.0 goc2p PicturesDesktop golib PublicDocuments goproject TemplatesDownloads initial-setup-ks.cfg testgo1.8.3.linux-amd64.tar.gz linux-2.6.39.tar.bz2 Videos[root@localhost ~]# mkdir -p japan/cang[root@localhost ~]# mkdir japan/cang1[root@localhost ~]# ls japancang cang1 二 切换所在目录 1、语法 cd [目录] 命名英文含义:change dirctories 2、简化操作 cd ~ 进入当前用户的家目录 cd     进入当前用户的家目录 cd -  进入上次目录 cd .. 进入上一级目录 cd .  进入当前目录  3、小技巧 清屏:Ctcl+L 命令补全和目录补全:Tab键 4、实战 [root@localhost ~]# cd japan[root@localhost japan]# lscang cang1[root@localhost japan]# cd /root[root@localhost ~]# pwd/root[root@localhost ~]# lsanaconda-ks.cfg goc2p PicturesChangeLog-2.6.0 golib PublicDesktop goproject TemplatesDocuments initial-setup-ks.cfg testDownloads japan Videosgo1.8.3.linux-amd64.tar.gz linux-2.6.39.tar.bz2gobin Music[root@localhost ~]# cd test[root@localhost test]# cd[root@localhost ~]# cd test[root@localhost test]# cd ~[root@localhost ~]# cd -/root/test[root@localhost test]# cd -/root[root@localhost ~]# cd ..[root@localhost /]# cd . 三 查询所在目录的位置 1、语法 pwd 命令英文含义:print work direct ory 2、实战 [root@localhost ~]# cd test[root@localhost test]# pwd/root/test 四 相对路径和绝对路径   大小: 167.7 KB 查看图片附件
转载请注明原文地址: https://www.6miu.com/read-2150253.html

最新回复(0)