Linux常用基礎命令

pwd顯示工作目錄
  1. [root@localhost ~]# pwd
  2. /root
cd 切換回家目錄,注意:bash中,~表示家目錄:
  1. [root@localhost ~]# cd
  2. [root@localhost ~]#
cd ~USERNAME:切換至指定用戶的家目錄;cd ~切換回自己的家目錄; cd -:在上一次所在目錄與當前目錄之間來回切換;
  1. [root@localhost ~]# cd ~goodlove007
  2. [root@localhost goodlove007]#

ls 列出指定目錄下的內容
  1. ls [OPTION]... [FILE]...
ls -a 顯示所有文件,包括隱藏文件
  1. [root@localhost ~]# ls -a
  2. . .bash_logout .config .lesshst
  3. .. .bash_profile .cshrc original-ks.cfg
  4. anaconda-ks.cfg .bashrc .dbus .tcshrc
  5. .bash_history .cache initial-setup-ks.cfg
ls -A 顯示除.和..之外的所有文件
  1. [root@localhost ~]# ls -A
  2. anaconda-ks.cfg .bash_profile .config initial-setup-ks.cfg .tcshrc
  3. .bash_history .bashrc .cshrc .lesshst
  4. .bash_logout .cache .dbus original-ks.cfg
ls -l:–long,長格式列表,即文件的詳細屬性信息
  1. [root@localhost ~]# ls -l
  2. total 12
  3. -rw-------. 1 root root 2949 Jun 15 18:39 anaconda-ks.cfg
  4. -rw-r--r--. 1 root root 2964 Jun 15 11:02 initial-setup-ks.cfg
  5. -rw-------. 1 root root 2066 Jun 15 18:39 original-ks.cfg
        

  1. -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:對文件大小單位換算;換算后的結果可能會非精確值;
  1. [root@localhost ~]# ls -lh
  2. total 12K
  3. -rw-------. 1 root root 2.9K Jun 15 18:39 anaconda-ks.cfg
  4. -rw-r--r--. 1 root root 2.9K Jun 15 11:02 initial-setup-ks.cfg
  5. -rw-------. 1 root root 2.1K Jun 15 18:39 original-ks.cfg
ls -d:查看目錄自身而非其內部的文件列表;

  1. [root@localhost ~]# ls -d
  2. .
ls -r:逆序顯示;

  1. [root@localhost ~]# ls
  2. anaconda-ks.cfg initial-setup-ks.cfg original-ks.cfg
  3. [root@localhost ~]# ls -r
  4. original-ks.cfg initial-setup-ks.cfg anaconda-ks.cfg
ls -R:遞歸顯示;

原創文章,作者:N27_太極異次元,如若轉載,請注明出處:http://www.www58058.com/78574

(0)
N27_太極異次元N27_太極異次元
上一篇 2017-06-25 23:44
下一篇 2017-06-26 08:32

相關推薦

  • SSH——安全的通信

    SSH ·ssh:secure shell, protocol, 22/tcp,  安全的遠程登錄 ·OpenSSH:ssh協議的開源實現 ·dropbear:另一個開源實現 ·SSH協議版本:          v1:基于CRC-32做MAC,不安全;man-in-m…

    Linux干貨 2016-09-25
  • rpm和yum常用命令選項總結

    =======rpm命令的使用總結====== 安裝:  rpm {-i|–install} [install-options] PACKAGE_FILE …     -v: verbose     -vv: more verbose &nbsp…

    Linux干貨 2015-12-15
  • 關于RHEL6中ulimit的nproc限制

    ulimit 用于限制 shell 啟動進程所占用的資源,支持以下各種類型的限制:所創建的內核文件的大小、進程數據塊的大小、Shell 進程創建文件的大小、內存鎖住的大小、常駐內存集的大小、打開文件描述符的數量、分配堆棧的最大大小、CPU 時間、單個用戶的最大線程數、Shell 進程所能使用的最大虛…

    Linux干貨 2016-10-19
  • centos6啟動故障及修復

    前言 前文中我們熟悉了linux的啟動流程,如果在啟動過程中文件丟失或者損壞了怎么辦呢?難道只有重裝系統這一條路嗎?那我們不是成了普通網管了嗎?作為專業的運維工程師,我們需要掌握如何快速修復系統啟動。 實驗1: 破壞/boot/grup/下的文件——-stage2 階段  不影響啟動  mv /boot/grub …

    2017-09-03
  • BIND的編譯安裝\DNS的搭建及測試

    編譯安裝bind          1、下載bind: isc.org: bind-9.10 bind-9.11 bind-10          2、 #tar xvf bind-9.10.5.tar.gz       &nbs…

    2017-07-31
欧美性久久久久