日期:2014-05-16  浏览次数:20985 次

(二)对 Linux 新手非常有用的 20 个命令

1. ls命令

ls命令是列出目录内容(List Directory Contents)的意思。运行它就是列出文件夹里的内容,可能是文件也可能是文件夹。

1 root@tecmint:~# ls
2 ?
3 Android-Games???????????????????? Music
4 Pictures????????????????????????? Public
5 Desktop?????????????????????????? Tecmint.com
6 Documents???????????????????????? TecMint-Sync
7 Downloads???????????????????????? Templates

“ls -l”命令已详情模式(long listing fashion)列出文件夹的内容。

01 root@tecmint:~# ls -l
02 ?
03 total 40588
04 drwxrwxr-x 2 ravisaive ravisaive???? 4096 May? 8 01:06 Android Games
05 drwxr-xr-x 2 ravisaive ravisaive???? 4096 May 15 10:50 Desktop
06 drwxr-xr-x 2 ravisaive ravisaive???? 4096 May 16 16:45 Documents
07 drwxr-xr-x 6 ravisaive ravisaive???? 4096 May 16 14:34 Downloads
08 drwxr-xr-x 2 ravisaive ravisaive???? 4096 Apr 30 20:50 Music
09 drwxr-xr-x 2 ravisaive ravisaive???? 4096 May? 9 17:54 Pictures
10 drwxrwxr-x 5 ravisaive ravisaive???? 4096 May? 3 18:44 Tecmint.com
11 drwxr-xr-x 2 ravisaive ravisaive???? 4096 Apr 30 20:50 Templates

"ls -a"命令会列出文件夹里的所有内容,包括以"."开头