Linux ls Command - Chinyorwa Mafaira

I ls rairo rinonyora zvirimo mune yakadomwa dhairekitori. Mune ino posvo tinotsanangura zvese sarudzo dziripo dze ls raira.

ls Commad Sarudzo






































































Sarudzo Tsananguro
-ku Nyora zvese zvakanyorwa zvinosanganisira izvo zvinotanga neine dot
-TO Nyora zvese zvakanyorwa kusasanganisira. uye ..
-c Ronga mafaira nekuchinja nguva
-d Nyora zvinyorwa zvinyorwa
-h Ratidza saizi mumhando inoverengwa nevanhu (kureva K, M)
-H Zvakafanana zviri pamusoro chete nemasimba e1000 panzvimbo pe1024
-l Ratidza zvirimo mune refu-zvinyorwa fomati
-kana Yakareba-yekunyora fomati isina yeboka info
-r Ratidza zvirimo zvakateedzana
-s Dhinda saizi yefaira rega rega mumabhuroko
-S Ronga nehukuru hwefaira
–Sort Ronga zvemukati neshoko. (kureva saizi, vhezheni, chinzvimbo)
-t Sort by modification time
-u Ronga nekupedzisira yekuwana nguva
-v Ronga neshanduro
-1 Nyora faira rimwe pamutsetse

Nyora Mafaira

I ls rairo rinonyora zvirimo mune yakadomwa dhairekitori, kusasanganisira mapikicha. Kana pasina dhairekitori inotsanangurwa ipapo, nekutadza, zvirimo mune dhairekitori razvino zvakanyorwa.

Akanyorwa mafaera akarongedzwa nearufabheti, nekukasira, uye akaenzana mumakoramu kana asingakwani pamutsetse mumwe.

Muenzaniso:

$ ls apt
configs
Documents
Music
workspace bin
Desktop
git

Pictures Public
Videos

Nyora Mafaira mune Yakareba Rondedzero Fomati

I ls raira's -l sarudzo inodhinda zvakatarwa zvemukati dhairekitori mune refu rondedzero fomati. Kana pasina dhairekitori inotsanangurwa ipapo, nekutadza, zvirimo mune dhairekitori razvino zvakanyorwa.

ls -l /etc

Semuenzaniso Kuburitsa:



total 1204 drwxr-xr-x 3 root root 4096 Apr 21 03:44 acpi -rw-r--r-- 1 root root 3028 Apr 21 03:38 adduser.conf drwxr-xr-x 2 root root 4096 Jun 11 20:42 alternatives ...

Nyora iwo Gumi Gumi Achangoshandurwa Mafaira

Aya anotevera anonyora anosvika gumi emafaira achangobva kuchinjwa mune dhairekitori razvino, uchishandisa yakareba rondedzero fomati (-l) uye yakarongedzwa nenguva (-t).

ls -lt | head

Nyora Ese Mafaira Kusanganisira Dotfiles

Dotfile ifaira rine mazita anotanga ne .. Izvi zvinowanzovanzwa ne ls uye isina kunyorwa kunze kwekunge wakumbirwa. Semuenzaniso zvinotevera zvinobuda zve ls haizonyora marondedzero mafaira:

$ ls bin pki

I -a kana --all sarudzo inonyora ese mafaera, kusanganisira madhiraivha.

Muenzaniso:

$ ls -a . .ansible
.bash_logout .bashrc .. .bash_history .bash_profile bin
pki

Nyora Mafaira Mune Muti-Senge Fomati

Iwo muti wekuraira unonyora zvirimo mune yakadomwa dhairekitori mumuti-senge fomati. Kana pasina dhairekitori inotsanangurwa ipapo, nekutadza, zvirimo mune dhairekitori razvino zvakanyorwa.

Semuenzaniso Kuburitsa:

$ tree /tmp /tmp ├── 5037 ├── adb.log └── evince-20965
└── image.FPWTJY.png

Shandisa iro rairo remuti -L sarudzo yekudzora kudzika kwekuratidzira uye -d Sarudzo yekunyora chete madhairekitori.

Semuenzaniso Kuburitsa:

$ tree -L 1 -d /tmp /tmp └── evince-20965

Rondedzero Mafaira Akarongwa nehukuru

I ls raira's -S Sarudzo inorongedza mafaera mukuburuka kwekuraira kwefaira saizi.

$ ls -l -S ./Fruits total 8 -rw-rw-rw- 1 root root 166703 Jan 28 00:09 apples.jpg -rw-rw-rw- 1 root root 134270 Jan 28 00:09 kiwis.jpg -rw-rw-rw- 1 root root 30134 Jan 28 00:09 bananas.jpg

Kana ichishandiswa ne -r sarudzo iyo yemhando odha yakadzoserwa.

$ ls -l -S -r ./Fruits total 8 -rw-rw-rw- 1 root root 30134 Jan 28 00:09 bananas.jpg -rw-rw-rw- 1 root root 134270 Jan 28 00:09 kiwis.jpg -rw-rw-rw- 1 root root 166703 Jan 28 00:09 apples.jpg

Mhedziso

Mune ino posvo isu takadzidza ese akasiyana sarudzo yekunyora mafaira uchishandisa ls raira.