ls komutu, Linux ve Unix gibi işletim sistemleri altında dizin içeriğini listelemek için kullanılır. Herhangi bir seçenek verilmeden ls komutu ile alfabetik sıralama yapılır.
1 |
# ls |
Varsayılan ls komut çıktısı:
1 2 3 |
[root@omeroner /mnt/data]$ls archive backup blogtema bounced_logs download license old_unitednations omer scripts slow_logs slow_logs_full SSL sw_backup ugur unitednation_www |
-l seçeneği ile liste şeklinde ayrıntılı olarak dizin içeriğini listeyebiliriz.
1 |
# ls -l |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
[root@unitednations /mnt/data]$ls -l total 92 drwxr-xr-x 10 root root 4096 Jun 18 2014 archive drwxr-xr-x 6 root root 4096 Sep 22 2014 backup drwxr-xr-x 2 root root 4096 Apr 9 13:09 blogtema drwxr-xr-x 2 root root 4096 May 14 23:44 bounced_logs drwxr-xr-x 5 root root 4096 Aug 5 2014 download drwxr-xr-x 3 root root 4096 Jun 23 2014 license drwxr-xr-x 22 root root 4096 Jun 19 2014 old_unitednations drwxr-xr-x 2 root root 4096 Sep 11 2014 omer drwxr-xr-x 3 root root 4096 May 13 17:48 scripts drwxr-xr-x 219 root root 20480 Mar 23 05:59 slow_logs drwxr-xr-x 213 root root 16384 Mar 23 05:59 slow_logs_full drwxr-xr-x 3 root root 4096 Apr 9 11:27 SSL drwxr-xr-x 4 root root 4096 Jun 20 2014 sw_backup drwxr-xr-x 2 root root 4096 Jun 29 2014 ugur drwxr-xr-x 15 root root 4096 Mar 18 14:55 unitednation_www [root@unitednations /mnt/data]$ |
Dizin içeriğini Büyüklüğüne Göre Dosyaları Sıralama için:
1 2 3 4 5 |
# ls -S # ls -S -l # ls --sort=size -l # ls --sort=size *.sh # ls -S -l *.sh |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
[root@omeroner /mnt/data/scripts]$ls -lS total 80 -rwxr-xr-x 1 root root 13437 Apr 24 15:26 ssh_select.sh drwxr-xr-x 5 root root 4096 Aug 5 2014 node_modules -rwxr-xr-x 1 root root 2519 Apr 30 15:33 fw.ex -rwxr-xr-x 1 root root 2515 Jul 2 2014 video_get_status.sh -rwxr-xr-x 1 root root 2487 Nov 18 16:13 jnprconfig.ex -rwxr-xr-x 1 root root 2359 Aug 27 2014 driver_info.sh -rwxr-xr-x 1 root root 1821 Jun 28 2014 mysql_slow_analiz.sh -rwxr-xr-x 1 root root 1368 Jun 28 2014 run.sh -rwxr-xr-x 1 root root 1345 Apr 24 10:40 arecordupdate.sh -rwxr-xr-x 1 root root 1096 Aug 15 2014 error_page_count.sh -rwxr-xr-x 1 root root 1039 Aug 7 2014 server.js -rwxr-xr-x 1 root root 1030 Sep 10 2014 server_check.sh -rwxr-xr-x 1 root root 856 Jun 23 2014 f5.ex -rwxr-xr-x 1 root root 615 Nov 18 16:17 move.sh -rwxr-xr-x 1 root root 483 Aug 5 2014 ptr_control.sh -rwxr-xr-x 1 root root 201 Nov 18 16:20 move_ssl.sh -rwxr-xr-x 1 root root 172 Jun 20 2014 ankara_config_backup.sh [root@omeroner /mnt/data/scripts]$ |
Dosya boyutlarını küçükten büyüğe sıralam için:
1 2 |
# ls -l -S -r # ls -lSr |
1 2 3 4 5 6 7 8 9 10 11 12 13 |
[root@unitednations /mnt/data/scripts]$ls -lSr *.sh -rwxr-xr-x 1 root root 172 Jun 20 2014 ankara_config_backup.sh -rwxr-xr-x 1 root root 201 Nov 18 16:20 move_ssl.sh -rwxr-xr-x 1 root root 483 Aug 5 2014 ptr_control.sh -rwxr-xr-x 1 root root 615 Nov 18 16:17 move.sh -rwxr-xr-x 1 root root 1030 Sep 10 2014 server_check.sh -rwxr-xr-x 1 root root 1096 Aug 15 2014 error_page_count.sh -rwxr-xr-x 1 root root 1345 Apr 24 10:40 arecordupdate.sh -rwxr-xr-x 1 root root 1368 Jun 28 2014 run.sh -rwxr-xr-x 1 root root 1821 Jun 28 2014 mysql_slow_analiz.sh -rwxr-xr-x 1 root root 2359 Aug 27 2014 driver_info.sh -rwxr-xr-x 1 root root 2515 Jul 2 2014 video_get_status.sh -rwxr-xr-x 1 root root 13437 Apr 24 15:26 ssh_select.sh |