多语言展示
当前在线:1574今日阅读:91今日分享:37

如何查看文件和目录(ls)(图文教程)

如何查看文件和目录(ls)(图文教程)
工具/原料
1

PC

2

linux

方法/步骤
1

Ls只显示非隐藏文件的文件名以及颜色[redhat3@localhost redhat3]$ ls123       cds.lib    CDS.log.1.cdslck     mydesign     panic.log       tmp20150202  CDS.log    CDS.log.cdslck       mydesigntmp  Screenshot.pngcadence   CDS.log.1  CDS.log.cdslck.2003  mylib        simulation

2

Ls –a 显示所有文件以及颜色[redhat3@localhost redhat3]$ ls -a.               CDS.log              .gtkrc             .redhat3.swp..              CDS.log.1            .gtkrc-1.2-gnome2  .rhn-applet.conf123             CDS.log.1.cdslck     .ICEauthority      Screenshot.png20150202        CDS.log.cdslck       .iscape            simulation.artist_states  CDS.log.cdslck.2003  .java              .thumbnails.bash_history   .emacs               .kde               tmp.bash_logout    .esd_auth            .libmgr            .Trash.bash_profile   .flexlmrc            .libsel            .viminfo.bashrc         .fonts.cache-1       .metacity          .ws_state.cache          .gconf               .mozilla           .Xauthoritycadence         .gconfd              mydesign           .xemacs.canna          .gnome               mydesigntmp        .xsession-errors.cdpcache       .gnome2              mylib              .zshrc.cdsdoc         .gnome2_private      .nautilus.cdsenv         .gnome-desktop       panic.logcds.lib         .gstreamer           .recently-used[redhat3@localhost redhat3]$

3

ls -l 显示非隐藏文件和目录及其颜色以及属性和权限[redhat3@localhost redhat3]$ ls -ltotal 432-rw-r--r--    1 redhat3  redhat3       761 Mar 24 14:46 123drwxrwxr-x   45 redhat3  redhat3      4096 May  6 10:45 20150202drwxrwxr-x    3 redhat3  redhat3      4096 Mar 23 11:37 cadence-rw-rw-r--    1 redhat3  redhat3        87 Feb  2 16:33 cds.lib-rw-rw-r--    1 redhat3  redhat3    196608 May 11 16:57 CDS.log-rw-rw-r--    1 redhat3  redhat3      8402 May  4 18:17 CDS.log.1-rw-rw-rw-    1 redhat3  redhat3       650 May  4 18:15 CDS.log.1.cdslck-rw-rw-rw-    1 redhat3  redhat3       648 May  4 18:21 CDS.log.cdslck-rw-rw-rw-    1 redhat3  redhat3         0 May  4 18:15 CDS.log.cdslck.2003drwxrwxr-x    3 redhat3  redhat3      4096 Mar 26 16:00 mydesigndrwxrwxr-x    2 redhat3  redhat3      4096 Mar 25 14:22 mydesigntmpdrwxrwxr-x    7 redhat3  redhat3      4096 Mar 26 10:29 mylib-rw-rw-r--    1 redhat3  redhat3         0 May  4 18:17 panic.log-rw-r--r--    1 redhat3  redhat3    180057 Mar 21 11:17 Screenshot.pngdrwxrwxr-x   24 redhat3  redhat3      4096 Apr 14 15:29 simulation

4

ls -al显示所有文件的属性、权限及其颜色[redhat3@localhost redhat3]$ ls -altotal 648drwx------   29 redhat3  redhat3      4096 May 24 11:40 .drwxr-xr-x    5 root     root         4096 Feb  2 16:39 ..-rw-r--r--    1 redhat3  redhat3       761 Mar 24 14:46 123drwxrwxr-x   45 redhat3  redhat3      4096 May  6 10:45 20150202drwxrwxr-x    3 redhat3  redhat3      4096 Apr 18 20:35 .artist_states-rw-------    1 redhat3  redhat3      9192 May  8 16:52 .bash_history-rw-r--r--    1 redhat3  redhat3        24 May 30  2006 .bash_logout-rw-r--r--    1 redhat3  redhat3       191 May 30  2006 .bash_profile-rw-r--r--    1 redhat3  redhat3       851 Mar 28 17:57 .bashrcdrwx------    3 redhat3  redhat3      4096 Mar 23 10:13 .cachedrwxrwxr-x    3 redhat3  redhat3      4096 Mar 23 11:37 cadence-rw-r--r--    1 redhat3  redhat3      5542 Sep 17  2003 .cannadrwx------    2 redhat3  redhat3      4096 Apr 17 15:32 .cdpcachedrwxrwxrwx    3 redhat3  redhat3      4096 Apr 17 15:32 .cdsdoc-rw-rw-r--    1 redhat3  redhat3        73 Mar 15 13:46 .cdsenv-rw-rw-r--    1 redhat3  redhat3        87 Feb  2 16:33 cds.lib-rw-rw-r--    1 redhat3  redhat3    196608 May 11 16:57 CDS.log-rw-rw-r--    1 redhat3  redhat3      8402 May  4 18:17 CDS.log.1-rw-rw-rw-    1 redhat3  redhat3       650 May  4 18:15 CDS.log.1.cdslck-rw-rw-rw-    1 redhat3  redhat3       648 May  4 18:21 CDS.log.cdslck-rw-rw-rw-    1 redhat3  redhat3         0 May  4 18:15 CDS.log.cdslck.2003-rw-r--r--    1 redhat3  redhat3       237 May  4  2006 .emacs-rw-------    1 redhat3  redhat3        16 Feb  2 13:44 .esd_auth-rwxrwxr-x    1 redhat3  redhat3        78 Feb  4 11:11 .flexlmrc-rw-rw-r--    1 redhat3  redhat3     12558 May  4 18:21 .fonts.cache-1drwx------    5 redhat3  redhat3      4096 Apr 12 11:34 .gconfdrwx------    3 redhat3  redhat3      4096 May  8 16:37 .gconfddrwx------    5 redhat3  redhat3      4096 Feb  2 13:26 .gnomedrwxr-xr-x    7 redhat3  redhat3      4096 Mar 26 21:56 .gnome2drwx------    2 redhat3  redhat3      4096 Feb  2 13:26 .gnome2_privatedrwxr-xr-x    2 redhat3  redhat3      4096 Feb  2 13:44 .gnome-desktopdrwxr-xr-x    2 redhat3  redhat3      4096 Mar 23 23:29 .gstreamer-rw-r--r--    1 redhat3  redhat3       120 Jul 26  2005 .gtkrc-rw-rw-r--    1 redhat3  redhat3       138 Feb  2 13:26 .gtkrc-1.2-gnome2-rw-------    1 redhat3  redhat3       567 Apr 12 11:34 .ICEauthoritydrwxrwxr-x    4 redhat3  redhat3      4096 Mar 15 11:26 .iscapedrwxrwxr-x    3 redhat3  redhat3      4096 Feb  2 19:22 .javadrwxr-xr-x    3 redhat3  redhat3      4096 Feb  2 12:33 .kde-rw-rw-r--    1 redhat3  redhat3       271 May  4 18:37 .libmgr-rw-rw-r--    1 redhat3  redhat3       134 May  7 14:25 .libseldrwx------    3 redhat3  redhat3      4096 Feb  2 13:26 .metacitydrwx------    3 redhat3  redhat3      4096 Apr 17 15:32 .mozilladrwxrwxr-x    3 redhat3  redhat3      4096 Mar 26 16:00 mydesigndrwxrwxr-x    2 redhat3  redhat3      4096 Mar 25 14:22 mydesigntmpdrwxrwxr-x    7 redhat3  redhat3      4096 Mar 26 10:29 mylibdrwxr-xr-x    3 redhat3  redhat3      4096 Feb  2 13:26 .nautilus-rw-rw-r--    1 redhat3  redhat3         0 May  4 18:17 panic.log-rw-------    1 redhat3  redhat3      4727 Mar 28 17:43 .recently-used-rw-------    1 redhat3  redhat3     12288 Mar 24 14:45 .redhat3.swp-rw-------    1 redhat3  redhat3       558 Mar  5 12:02 .rhn-applet.conf-rw-r--r--    1 redhat3  redhat3    180057 Mar 21 11:17 Screenshot.pngdrwxrwxr-x   24 redhat3  redhat3      4096 Apr 14 15:29 simulationdrwx------    4 redhat3  redhat3      4096 Mar 23 11:17 .thumbnailsdrwxrwxr-x    4 redhat3  redhat3      4096 May  8 16:37 tmpdrwx------    2 redhat3  redhat3      4096 Mar 24 14:31 .Trash-rw-------    1 redhat3  redhat3         0 May  8 16:51 .viminfo-rw-rw-r--    1 redhat3  redhat3       798 May  6 16:27 .ws_state-rw-------    1 redhat3  redhat3       213 Apr 12 11:34 .Xauthoritydrwxr-xr-x    2 redhat3  redhat3      4096 Feb  2 12:34 .xemacs-rw-------    1 redhat3  redhat3      8192 May 24 11:40 .xsession-errors-rw-r--r--    1 redhat3  redhat3       136 Jan 17  2005 .zshrc

5

ls -al --full-time 显示所有文件的属性、权限、颜色及其输出访问时间[redhat3@localhost redhat3]$ ls -al --full-timetotal 648drwx------   29 redhat3  redhat3      4096 2015-05-24 11:40:12. +0800 .drwxr-xr-x    5 root     root         4096 2015-02-02 16:39:57. +0800 ..-rw-r--r--    1 redhat3  redhat3       761 2015-03-24 14:46:14. +0800 123drwxrwxr-x   45 redhat3  redhat3      4096 2015-05-06 10:45:16. +drwxrwxr-x    3 redhat3  redhat3      4096 2015-04-18 20:35:16. +0800 .artist_states-rw-------    1 redhat3  redhat3      9192 2015-05-08 16:52:02. +0800 .bash_history-rw-r--r--    1 redhat3  redhat3        24 2006-05-30 22:51:55. +0800 .bash_logout-rw-r--r--    1 redhat3  redhat3       191 2006-05-30 22:51:55. +0800 .bash_profile-rw-r--r--    1 redhat3  redhat3       851 2015-03-28 17:57:57. +0800 .bashrcdrwx------    3 redhat3  redhat3      4096 2015-03-23 10:13:08. +0800 .cachedrwxrwxr-x    3 redhat3  redhat3      4096 2015-03-23 11:37:47. +0800 cadence-rw-r--r--    1 redhat3  redhat3      5542 2003-09-17 09:54:44. +0800 .cannadrwx------    2 redhat3  redhat3      4096 2015-04-17 15:32:14. +0800 .cdpcachedrwxrwxrwx    3 redhat3  redhat3      4096 2015-04-17 15:32:10. +0800 .cdsdoc-rw-rw-r--    1 redhat3  redhat3        73 2015-03-15 13:46:55. +0800 .cdsenv

推荐信息