1. 程式人生 > >小白Linux第六天

小白Linux第六天

centos7

1、系統目錄

ls是list的縮寫,ls ls / 只要是列出系統的目錄與文件命令與其功能;

[[email protected] ~]# ls /

bin dev home lib64 mnt proc run srv tmp var boot etc lib media opt root sbin sys usr 根下面包含這些;

[[email protected] ~]# ls /root/.ssh/authorized_keys //在root根目錄

[[email protected] ~]# ls /home/ //在普通用戶

[[email protected] ~]# yun install -??? //運行此命令是用來安裝缺少命令

2.ls命令

[[email protected] ~]# ls -i anaconda-ks.cfg //多少用戶使用anaconda

33574979 anaconda-ks.cfg

[[email protected] ~]# ls -la

總用量 28

dr-xr-x---. 3 root root 147 7月 15 22:03 . //.表示當前目錄

dr-xr-xr-x. 17 root root 224 7月 15 23:34 .. //

..上一個目錄

[[email protected] ~]# ls -l / //不加 -d 的話列出所有目錄

總用量 20

lrwxrwxrwx. 1 root root 7 7月 16 04:49 bin -> usr/bin

dr-xr-xr-x. 4 root root 4096 7月 16 04:57 boot

.....................

.....................

[[email protected] ~]# ls -dl / //加上 -d 只列出目錄本身

dr-xr-xr-x. 17 root root 224 7月 15 23:34

-l 詳細信息 -i -a 全部 -t時間 -h -d 目錄 c b s l軟連接

3.文件類型

ls -l /dev/

lrwxrwxrwx. 1 root root 15 7月 17 19:31 stderr -> /proc/self/fd/2 //藍色標註軟連接

lrwxrwxrwx. 1 root root 15 7月 17 19:31 stdin -> /proc/self/fd/0

lrwxrwxrwx. 1 root root 15 7月 17 19:31 stdout -> /proc/self/fd/1

crw-rw-rw-. 1 root tty 5, 0 7月 17 19:31 tty

crw--w----. 1 root tty 4, 0 7月 17 19:31 tty0 //黃色標註的是字符串

[[email protected] ~]# ls -l /dev/log

srw-rw-rw-. 1 root root 0 7月 17 19:31 /dev/log //通信服務 tcp/ip

熟悉這些命令所表達的意思以及所使用的意義


本文出自 “我與Linux擦肩而過” 博客,謝絕轉載!

小白Linux第六天