没有合适的资源?快使用搜索试试~ 我知道了~
linux 基础命令的讲解及运用
资源推荐
资源详情
资源评论
基础目录二
// 目录管理
ls (list) //列出目录内容
ls -l //长格式详细的列出
ls -i // 显示文件的inode(查看文件在磁盘中的位置)
ls -a //显示所有文件(含隐藏文件)
[root@localhost ~]# ls
1 20230627 22 a anaconda-ks.cfg tq
[root@localhost ~]#
[root@localhost ~]# ls /opt
nginx
[root@localhost ~]#
1
2
3
4
5
6
7
[root@localhost ~]# ls -l
total 16
-rwxr-xr-x. 1 root root 73 Jun 27 19:41 1
drwxr-xr-x. 2 root root 6 Jun 27 14:59 20230627
-rw-r--r--. 1 root root 2 Jun 27 14:52 22
drwxr-xr-x. 5 root root 33 Jun 27 15:39 a
-rw-------. 1 root root 908 Jun 27 14:38 anaconda-ks.cfg
-rwxr-xr-x. 1 root root 103 Jun 27 19:31 tq
[root@localhost ~]#
[root@localhost ~]# ls -l /opt
total 0
lrwxrwxrwx. 1 root root 17 Jun 27 19:15 nginx -> /opt/nginx-1.12.2
[root@localhost ~]# ls -l /home
total 0
drwx------. 2 tq tq 83 Jun 26 19:26 tq
drwx------. 2 xxx xxx 62 Jun 27 19:31 xxx
[root@localhost ~]#
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
[root@localhost ~]# ls -li 1 111
[root@localhost ~]# ls -li 1 111
17046575 -rwxr-xr-x. 1 root root 73 Jun 27 19:41 1 ###前面的数字代表位置
16778031 -rw-r--r--. 1 root root 0 Jun 28 08:54 111
[root@localhost ~]#
1
2
3
4
5
ls -d //查看目录本身的信息(不是里面的内容)
ls -t //按建立的时间的先后显示(新建立的最先显示)
ls -r //逆序显示
cd //直接回到家目录
cd - //回上一级目录
[root@localhost ~]# ls -a ### 其中.表示当前目录,..表示上一级目录
. 111 a .bash_logout .config .tcshrc
.. 20230627 anaconda-ks.cfg .bash_profile .cshrc tq
1 22 .bash_history .bashrc .ssh .viminfo
[root@localhost ~]#
[root@localhost ~]# ls .
1 111 20230627 22 a anaconda-ks.cfg tq
[root@localhost ~]# cd /home
[root@localhost home]# cd ..
[root@localhost /]#
1
2
3
4
5
6
7
8
9
10
11
[root@localhost /]# ls -d
.
[root@localhost /]# ls -ld mnt
drwxr-xr-x. 3 root root 18 Jun 26 17:15 mnt
[root@localhost /]#
1
2
3
4
5
6
[root@localhost opt]# ls -t
nginx-1.12.2 nginx
[root@localhost opt]#
1
2
3
[root@localhost opt]# ls -lrt
total 0
lrwxrwxrwx. 1 root root 17 Jun 27 19:15 nginx -> /opt/nginx-1.12.2 ###两个文件位置改
变,按照时间
-rw-r--r--. 1 root root 0 Jun 28 08:46 nginx-1.12.2
1
2
3
4
[root@localhost ~]# cd /home
[root@localhost home]# cd
[root@localhost ~]#
1
2
3
[root@localhost ~]# cd /opt
[root@localhost opt]# ls
nginx nginx-1.12.2
[root@localhost opt]# mkdir ing
[root@localhost opt]# cd ing
[root@localhost ing]# cd -
/opt
[root@localhost opt]#
1
2
3
4
5
6
7
8
cd ~ //家目录
cd /root //直接切换到一个目录
mkdir //创建命令
-v :显示创建的过程
stat //显示文件的状态
cp
[root@localhost opt]# cd ~
[root@localhost ~]#
1
2
[root@localhost opt]# cd /root
[root@localhost ~]#
1
2
[root@localhost ~]# mkdir -pv a/{b/{xixi},b/ing,c/i}
mkdir: created directory 'a/b/{xixi}'
mkdir: created directory 'a/b/ing'
mkdir: created directory 'a/c/i'
[root@localhost ~]# tree
.
├── 1
├── 111
├── 20230627
├── 22
├── a
│ ├── b
│ │ ├── ing
│ │ ├── {xixi
│ │ │ └── hehe}
│ │ └── {xixi}
│ ├── c
│ │ ├── haha
│ │ └── i
│ └── d
│ └── enene
├── anaconda-ks.cfg
└── tq
12 directories, 5 files
[root@localhost ~]#
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
[root@localhost ~]# stat tq
File: tq
Size: 103 Blocks: 8 IO Block: 4096 regular file
Device: fd00h/64768d Inode: 17046573 Links: 1
Access: (0755/-rwxr-xr-x) Uid: ( 0/ root) Gid: ( 0/ root)
Context: unconfined_u:object_r:admin_home_t:s0
Access: 2023-06-27 19:32:20.725831293 +0800
Modify: 2023-06-27 19:31:28.528642044 +0800
Change: 2023-06-27 19:32:13.848804351 +0800
Birth: 2023-06-27 19:31:28.528642044 +0800
[root@localhost ~]#
1
2
3
4
5
6
7
8
9
10
11
12
剩余13页未读,继续阅读
资源评论
Cxttq~
- 粉丝: 7
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- html+css+'青春献礼二十大 红色旅游助乡村'为主题的网页设计 2022年参与学校网页设计比赛时完成的
- Unity 模型布尔运算插件
- eCANtools工具,CAN资料包
- 129335283047061xiazaigongjuxiang(去重软件).apk
- Android环境检测工具,检测ksu,lsp,magisk等
- WordPress后台美化插件QuarterAdmin分享
- PCB_Project单片机绘制 (2024-5-11 22-22-13).zip
- nccl-local-repo-ubuntu2204-2.21.5-cuda12.4-1.0-1-amd64
- STM32移植LVGL源码工程 stm32移植GUI-Guider源码 LVGL移植源码
- Screenshot_20240522_084328_com.tencent.mm.jpg
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功