Ls
ls je Unix naredba (od list), obično dostupna na svim *nix operacijskim sustavima kao naredba sustava. Služi za ispis sadržaja tekućeg direktorija.
Primjeri
Naredba ls bez parametara stupčano ispisuje imena datoteka u tekućem direktoriju, što je informativno, ali najčešće ne previše korisno. Zato postoji zaista velik broj opcija ove naredbe kojima se ispis može prilagoditi potrebama odnosno specifikaciji.
ls -al --color=auto
Gornja naredba ispisuje sve datoteke u direktoriju (-a), jednu datoteku po retku u punom (-l long odnosno dugom) formatu koji obično uključuje sljedećih 9 stupaca :
brw-r--r-- 1 unixguy staff 64, 64 Jan 27 05:52 block
crw-r--r-- 1 unixguy staff 64, 255 Jan 26 13:57 character
-rw-r--r-- 1 unixguy staff 290 Jan 26 14:08 compressed.gz
-rw-r--r-- 1 unixguy staff 331836 Jan 26 14:06 data.ppm
drwxrwxr-x 2 unixguy staff 48 Jan 26 11:28 directory
-rwxrwxr-x 1 unixguy staff 29 Jan 26 14:03 executable
prw-r--r-- 1 unixguy staff 0 Jan 26 11:50 fifo
srw-rw-rw- 1 unixguy staff 0 Jan 26 12:00 socket
lrwxrwxrwx 1 unixguy staff 3 Jan 26 11:44 link -> dir
-rw-rw---- 1 unixguy staff 217 Jan 26 14:08 regularfile
- stupac - tip datoteke i prava pristupa, 10 znakova
- stupac - broj hardlinkova na inode datoteke
- stupac - vlasnik datoteke
- stupac - grupa datoteke
- stupac - veličina datoteke (defaultno) u bajtovima (može biti zadana neka druga jedinica), za specijalne (c) datoteke njihovi major i minor označitelji
- stupac - vrijeme zadnje promjene datoteke, prvi stupac - mjesec
- stupac - vrijeme zadnje promjene datoteke, drugi stupac - dan u mjesecu
- stupac - vrijeme zadnje promjene datoteke, treći stupac - sat i minuta ako je unutar zadnjih 365 dana, inače godina
- stupac - ime datoteke
ls -Alh
Ispis svih datoteka osim tekućeg i nadređenog direktorija . i .. (-A), dugi format (-l), veličina datoteka u bajtovima za one manje od 1KB, u kilobajtima za one manje od 1MB, u megabajtima za one manje od 1GB itd. Ova opcija nije dio POSIX standarda, ali svejedno je implementirana u GNU coreutils paketu, FreeBSD-u i Solarisu.[1]
Izvori
- ↑ docs.oracle.com, Sun Microsystems, 2002., pristupljeno 14. kolovoza 2016.
Vanjske poveznice
Content Disclaimer
Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.
- The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
- There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
- It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
- Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
- Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.