在linux中,絕大多數(shù)命令都參照命令 選項(xiàng) 參數(shù)
選項(xiàng):適用于調(diào)整命令的功能的
參數(shù):指的是命令的操作對(duì)象linux常用命令,如果省略參數(shù)linux常用命令,是由于有默認(rèn)參數(shù)的
ls 顯示目錄下的內(nèi)容
# ls
[root@localhost ~]# ls
anaconda-ks.cfg install.log install.log.syslog
# ls --color=never 不顯示顏色的顯示目錄下的文件名
[root@localhost ~]# ls --color=never
anaconda-ks.cfg install.log install.log.syslog
# ls -a 顯示所有文件(包含隱藏文件)
[root@localhost ~]# ls -a
. .. anaconda-ks.cfg .bash_logout .bash_profile .bashrc .cshrc install.log install.log.syslog .pki .tcshrc
# ls -l 以長格式顯示文件
[root@localhost ~]# ls -l
總用量 16
-rw-------. 1 root root 1098 6月 8 19:38 anaconda-ks.cfg
-rw-r--r--. 1 root root 8025 6月 8 19:38 install.log
-rw-r--r--. 1 root root 3384 6月 8 19:38 install.log.syslog
# ls -d 只顯示目錄
[root@localhost ~]# ls -l
總用量 16
-rw-------. 1 root root 1098 6月 8 19:38 anaconda-ks.cfg
-rw-r--r--. 1 root root 8025 6月 8 19:38 install.log
-rw-r--r--. 1 root root 3384 6月 8 19:38 install.log.syslog
# ls -i 查看inode節(jié)點(diǎn)號(hào)
[root@localhost ~]# ls -i
260965 anaconda-ks.cfg 260611 install.log 260612 install.log.syslog
cd 切換所在目錄
# cd
[root@localhost ~]# cd /tmp/
[root@localhost tmp]#
# 進(jìn)入相對(duì)路徑
[root@localhost /]# cd /tmp/
[root@localhost tmp]# cd ../etc/yum.repos.d/
# 進(jìn)入絕對(duì)路徑
[root@localhost yum.repos.d]# cd /etc/yum.repos.d/
[root@localhost yum.repos.d]# ll
總用量 36
drwxr-xr-x. 2 root root 4096 6月 8 19:58 backup
-rw-r--r--. 1 root root 1991 3月 28 2017 CentOS-Base.repo
-rw-r--r--. 1 root root 647 3月 28 2017 CentOS-Debuginfo.repo
-rw-r--r--. 1 root root 289 3月 28 2017 CentOS-fasttrack.repo
-rw-r--r--. 1 root root 630 3月 28 2017 CentOS-Media.repo
-rw-r--r--. 1 root root 7989 3月 28 2017 CentOS-Vault.repo
-rw-r--r--. 1 root root 957 11月 5 2012 epel.repo
-rw-r--r--. 1 root root 1056 11月 5 2012 epel-testing.repo
# cd - 返回上次所在目錄
[root@localhost yum.repos.d]# pwd
/etc/yum.repos.d
[root@localhost yum.repos.d]# cd /
[root@localhost /]# cd -
/etc/yum.repos.d
[root@localhost yum.repos.d]#
# cd ~ 進(jìn)入當(dāng)前用戶的家目錄
[root@localhost yum.repos.d]# cd ~
[root@localhost ~]#
# cd .. 進(jìn)入上一級(jí)目錄
[root@localhost ~]# cd /tmp/
[root@localhost tmp]# pwd
/tmp
[root@localhost tmp]# cd ..
[root@localhost /]# pwd
/
上一個(gè)教程:Linux常用命令大全(新手入門).pdf
下一個(gè)教程:Linux下各種服務(wù)啟動(dòng)命令