linux 常用命令ll 即 ls -l --color=auto

來源:互聯網
上載者:User

標籤:linux 常用命令ll

1.linux系統營運或者開發中,經常會用到ll 即 ls -l --color=auto 命令.比如 ll -hF,

<span style="font-size:18px;">[[email protected] ~]$ ll -hF總用量 1.1Gdrwxrwxr-x.  2 doctor doctor 4.0K 1月  18 10:23 Documents/-rw-r-----.  1 doctor doctor 701M 12月 24 21:51 Far123-XP-2014.5c.isodrwxr-xr-x.  4 doctor doctor 4.0K 11月 30 16:00 hadoop/drwxrwxr-x.  6 doctor doctor 4.0K 12月 16 22:04 hbaseRootDir/drwxrwxr-x. 27 doctor doctor 4.0K 1月  17 11:16 opt/drwxrwxr-x.  2 doctor doctor 4.0K 8月  13 21:48 save/drwxrwxr-x.  2 doctor doctor 4.0K 1月   1 15:26 share/drwxrwxr-x.  3 doctor doctor 4.0K 1月   2 21:11 vmware/-rwxr-x--x.  1 doctor doctor 418M 12月 24 23:07 VMware-Workstation-Full-11.0.0-2305329.x86_64 (1).bundle*drwxrwxr-x.  3 doctor doctor 4.0K 12月  3 21:03 WebstormProjects/drwxrwxr-x.  4 doctor doctor 4.0K 12月 28 08:15 workspace/drwxrwxr-x.  4 doctor doctor 4.0K 10月 26 18:28 workspaceForWork/drwxrwxr-x.  7 doctor doctor 4.0K 1月  17 23:50 workspace-sts-3.6.2.RELEASE/drwxrwxr-x.  5 doctor doctor 4.0K 9月  25 01:25 zookeeper/drwxr-xr-x.  2 doctor doctor 4.0K 1月  18 20:05 公用/drwxr-xr-x.  2 doctor doctor 4.0K 10月 30 21:11 視頻/drwxr-xr-x.  2 doctor doctor 4.0K 12月  7 23:04 圖片/drwxr-xr-x.  4 doctor doctor 4.0K 12月 13 20:58 文檔/drwxr-xr-x.  3 doctor doctor  12K 1月  18 10:46 下載/drwxr-xr-x.  3 doctor doctor 4.0K 8月  19 21:09 音樂/drwxr-xr-x.  2 doctor doctor 4.0K 12月  4 21:54 案頭/</span>

-h, --human-readable
print sizes in human readable format (e.g., 1K 234M 2G)
-F, --classify, --file-type
在每個檔案名稱後附上一個字元以說明該檔案的類型。“ * ”表示普通的可執行檔; “ / ”表示目錄;“ @ ”表示符號連結;“ | ”表示FIFOs;“ = ”表示通訊端 (sockets) ;什麼也沒有則表示普通檔案。

當然,為了方便,我們也可以利用別名像alias ll=‘ls -l --color=auto‘

一樣,定義一個別名:

<span style="font-size:18px;">[[email protected] ~]$ alias ll='ls -lhF --color=auto'[[email protected] ~]$ ll總用量 1.1Gdrwxrwxr-x.  2 doctor doctor 4.0K 1月  18 10:23 Documents/-rw-r-----.  1 doctor doctor 701M 12月 24 21:51 Far123-XP-2014.5c.isodrwxr-xr-x.  4 doctor doctor 4.0K 11月 30 16:00 hadoop/drwxrwxr-x.  6 doctor doctor 4.0K 12月 16 22:04 hbaseRootDir/drwxrwxr-x. 27 doctor doctor 4.0K 1月  17 11:16 opt/drwxrwxr-x.  2 doctor doctor 4.0K 8月  13 21:48 save/drwxrwxr-x.  2 doctor doctor 4.0K 1月   1 15:26 share/drwxrwxr-x.  3 doctor doctor 4.0K 1月   2 21:11 vmware/-rwxr-x--x.  1 doctor doctor 418M 12月 24 23:07 VMware-Workstation-Full-11.0.0-2305329.x86_64 (1).bundle*drwxrwxr-x.  3 doctor doctor 4.0K 12月  3 21:03 WebstormProjects/drwxrwxr-x.  4 doctor doctor 4.0K 12月 28 08:15 workspace/drwxrwxr-x.  4 doctor doctor 4.0K 10月 26 18:28 workspaceForWork/drwxrwxr-x.  7 doctor doctor 4.0K 1月  17 23:50 workspace-sts-3.6.2.RELEASE/drwxrwxr-x.  5 doctor doctor 4.0K 9月  25 01:25 zookeeper/drwxr-xr-x.  2 doctor doctor 4.0K 1月  18 20:05 公用/drwxr-xr-x.  2 doctor doctor 4.0K 10月 30 21:11 視頻/drwxr-xr-x.  2 doctor doctor 4.0K 12月  7 23:04 圖片/drwxr-xr-x.  4 doctor doctor 4.0K 12月 13 20:58 文檔/drwxr-xr-x.  3 doctor doctor  12K 1月  18 10:46 下載/drwxr-xr-x.  3 doctor doctor 4.0K 8月  19 21:09 音樂/drwxr-xr-x.  2 doctor doctor 4.0K 12月  4 21:54 案頭/[[email protected] ~]$ alias alias egrep='egrep --color=auto'alias fgrep='fgrep --color=auto'alias grep='grep --color=auto'alias l.='ls -d .* --color=auto'alias ll='ls -lhF --color=auto'alias ls='ls --color=auto'alias vi='vim'alias which='alias | /usr/bin/which --tty-only --read-alias --show-dot --show-tilde'</span>

我這裡是覆蓋了系統的別名,shell 文法中不要出現空格,注意.

2.如何顯示隱藏的檔案呢,一般配置jdk等系統命令是要在.bash_profile  .bashrc  中定義.

你可能想到ls -a,不過他也顯示了其它目錄.

可以用ls -d .* 只顯示這些隱藏的目錄.

-d, --directory
將目錄名象其它檔案一樣列出,而不是列出它們的內容。

linux 常用命令ll 即 ls -l --color=auto

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.