在 Linux 是一個經常使用的命令。咱們這裏說一些經常使用的命令參數,讓你對linux操做更方便html
# ls
file1 file2 file3 file4 file5 simplyadir linux
# ls -l
total 24
-rw-r--r-- 1 root root 42 2014-01-29 09:25 file1
-rw-r--r-- 1 root root 42 2014-01-29 09:25 file2
-rw-r--r-- 1 root root 42 2014-01-29 09:37 file3
-rw-r--r-- 1 root root 42 2014-01-29 09:28 file4
-rw-r--r-- 1 root root 42 2014-01-29 09:28 file5
drwxr-xr-x 4 root root 4096 2014-01-29 11:49 simplyadir redis
# ls -lS
total 24K
drwxr-xr-x 4 root root 4.0K 2014-01-29 11:49 simplyadir
-rw-r--r-- 1 root root 42 2014-01-29 09:25 file1
-rw-r--r-- 1 root root 42 2014-01-29 09:25 file2
-rw-r--r-- 1 root root 42 2014-01-29 09:37 file3
-rw-r--r-- 1 root root 42 2014-01-29 09:28 file4
-rw-r--r-- 1 root root 42 2014-01-29 09:28 file5 .net
# ls --version
ls (GNU coreutils) 8.5
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. serverWritten by Richard M. Stallman and David MacKenzie. htm
# ls -lt
-rw-r--r-- 1 root root 42 2014-01-29 09:37 file3
-rw-r--r-- 1 root root 42 2014-01-29 09:28 file5
-rw-r--r-- 1 root root 42 2014-01-29 09:28 file4
-rw-r--r-- 1 root root 42 2014-01-29 09:25 file2
-rw-r--r-- 1 root root 42 2014-01-29 09:25 file1 遞歸
# vi ls -t | head -1 get
# ls -1
file1
file2
file3
file4
file5 it
# ls -al
total 28
drwxr-xr-x 2 root root 4096 2014-01-29 09:42 .
drwxr-xr-x 38 root root 4096 2014-01-29 09:19 ..
-rw-r--r-- 1 root root 42 2014-01-29 09:25 file1
-rw-r--r-- 1 root root 42 2014-01-29 09:25 file2
-rw-r--r-- 1 root root 42 2014-01-29 09:37 file3
-rw-r--r-- 1 root root 42 2014-01-29 09:28 file4
-rw-r--r-- 1 root root 42 2014-01-29 09:28 file5
-rw-r--r-- 1 root root 0 2014-01-29 11:43 .test> io
root@server :~# ls -R /root/test/simplyadir
/root/test/simplyadir:
dir1 dir2/root/test/simplyadir/dir1:
1.txt 2.txt/root/test/simplyadir/dir2:
abc xyz
# ls --help