pwd顯示工作目錄
- [root@localhost ~]# pwd
- /root
cd 切換回家目錄,注意:bash中,~表示家目錄:
- [root@localhost ~]# cd
- [root@localhost ~]#
cd ~USERNAME:切換至指定用戶的家目錄;cd ~切換回自己的家目錄; cd -:在上一次所在目錄與當前目錄之間來回切換;
- [root@localhost ~]# cd ~goodlove007
- [root@localhost goodlove007]#
ls 列出指定目錄下的內容
- ls [OPTION]... [FILE]...
ls -a 顯示所有文件,包括隱藏文件
- [root@localhost ~]# ls -a
- . .bash_logout .config .lesshst
- .. .bash_profile .cshrc original-ks.cfg
- anaconda-ks.cfg .bashrc .dbus .tcshrc
- .bash_history .cache initial-setup-ks.cfg
ls -A 顯示除.和..之外的所有文件
- [root@localhost ~]# ls -A
- anaconda-ks.cfg .bash_profile .config initial-setup-ks.cfg .tcshrc
- .bash_history .bashrc .cshrc .lesshst
- .bash_logout .cache .dbus original-ks.cfg
ls -l:–long,長格式列表,即文件的詳細屬性信息
- [root@localhost ~]# ls -l
- total 12
- -rw-------. 1 root root 2949 Jun 15 18:39 anaconda-ks.cfg
- -rw-r--r--. 1 root root 2964 Jun 15 11:02 initial-setup-ks.cfg
- -rw-------. 1 root root 2066 Jun 15 18:39 original-ks.cfg
- -rw-------. 1 root root 2949 Jun 15 18:39 anaconda-ks.cfg
-: 文件類型,-,d,b,c,l,s,p
rw——-
rw-:文件屬主的權限;
—:文件屬組的權限;
—:其他用戶(非屬主、屬組)的權限;
1:數字表示文件被硬鏈接的次數;
root:文件的屬主;
root:文件的屬組;
2949:數字表示文件的大小,單位是字節
Jun 15 18:39 :文件最后一次被修改的時間;
anaconda-ks.cfg 文件名
ls -h,–human-readable:對文件大小單位換算;換算后的結果可能會非精確值;
[root@localhost ~]# ls -lh
total 12K
-rw-------. 1 root root 2.9K Jun 15 18:39 anaconda-ks.cfg
-rw-r--r--. 1 root root 2.9K Jun 15 11:02 initial-setup-ks.cfg
-rw-------. 1 root root 2.1K Jun 15 18:39 original-ks.cfg
ls -d:查看目錄自身而非其內部的文件列表;
[root@localhost ~]# ls -d
.
ls -r:逆序顯示;
[root@localhost ~]# ls
anaconda-ks.cfg initial-setup-ks.cfg original-ks.cfg
[root@localhost ~]# ls -r
original-ks.cfg initial-setup-ks.cfg anaconda-ks.cfg
ls -R:遞歸顯示;
原創文章,作者:N27_太極異次元,如若轉載,請注明出處:http://www.www58058.com/78574