ls
Programm: ls
Zeigt, was in einem Verzeichnis liegt.
Aufruf
ls [OPTION]... [FILE]...
Beschreibung
List the entries of each FILE that is a directory, and the name of each other FILE. Without FILE, list the current directory. Names are sorted by their bytes unless -t or -S is given.
Optionen im Simulator
46 weitere Optionen des echten Programms, im Simulator noch nicht
Beispiele
ls
Bilder Dokumente Downloads notizen.txt projekte ls Downloads/*.pdf
Downloads/rechnung.pdf ls -l Downloads
total 636
-rw-r--r-- 1 lerner lerner 3000 Nov 2 2025 film.mp4.part
-rw-r--r-- 1 lerner lerner 52000 Mar 1 2026 mietvertrag.pdf
-rw-r--r-- 1 lerner lerner 41000 Aug 31 10:00 rechnung-2026-08.pdf
-rw-r--r-- 1 lerner lerner 42000 Sep 30 10:00 rechnung-2026-09.pdf
-rw-r--r-- 1 lerner lerner 43000 Oct 15 10:02 'rechnung-2026-10(1).pdf'
-rw-r--r-- 1 lerner lerner 43000 Oct 15 10:00 rechnung-2026-10.pdf
-rw-r--r-- 1 lerner lerner 95000 Aug 11 20:30 sonnenuntergang.jpg
-rw-r--r-- 1 lerner lerner 64000 May 20 09:00 steuererklaerung-2025.pdf
-rw-r--r-- 1 lerner lerner 120000 Aug 10 18:05 'strand(1).jpg'
-rw-r--r-- 1 lerner lerner 120000 Aug 10 18:00 strand.jpg
-rw-r--r-- 1 lerner lerner 1200 Dec 19 2025 update.zip.part ls -la
total 40
drwxr-xr-x 6 lerner lerner 4096 Oct 17 08:58 .
drwxr-xr-x 3 root root 4096 Oct 17 08:58 ..
-rw-r--r-- 1 lerner lerner 12 Sep 1 12:00 .bashrc
-rw------- 1 lerner lerner 61 Oct 2 08:00 .geheim
-rw-r--r-- 1 lerner lerner 13 Sep 1 12:00 .profile
drwxr-xr-x 2 lerner lerner 4096 Oct 14 10:30 Dokumente
drwxr-xr-x 2 lerner lerner 4096 Oct 1 03:00 archiv
drwxr-xr-x 2 lerner lerner 4096 Oct 17 09:41 logs
-rw-r--r-- 1 lerner lerner 76 Oct 17 08:15 notizen.txt
drwxr-xr-x 3 lerner lerner 4096 Oct 13 14:00 projekte ls logs nope > all.txt
ls: cannot access 'nope': No such file or directory
cat all.txt
logs:
app.log
app.log.1
ls logs nope > all.txt 2>&1
cat all.txt
ls: cannot access 'nope': No such file or directory
logs:
app.log
app.log.1 ls cache | tee inventar.txt
a.tmp
b.tmp
keep.log
old report.tmp
echo "geprüft 09:45" | tee -a inventar.txt
geprüft 09:45
cat inventar.txt
a.tmp
b.tmp
keep.log
old report.tmp
geprüft 09:45 ls Dokumente
alter-entwurf.txt notizen.txt ls Dokumente
alter-entwurf.txt notizen.txt ls -la Dokumente
total 16
drwxr-xr-x 2 lerner lerner 4096 Oct 16 18:00 .
drwxr-xr-x 6 lerner lerner 4096 Oct 17 08:58 ..
-rw-r--r-- 1 lerner lerner 61 Oct 14 10:30 bericht.txt
-rw-r--r-- 1 lerner lerner 147 Oct 16 18:00 notizen.txt ls -lh Downloads
total 2.4M
-rw-r--r-- 1 lerner lerner 147K Oct 15 20:00 foto.jpg
-rw-r--r-- 1 lerner lerner 2.2M Oct 8 16:00 handbuch.pdf
-rwxr-xr-x 1 lerner lerner 26 Oct 12 09:00 setup.sh ls -lt Downloads
total 2400
-rw-r--r-- 1 lerner lerner 150000 Oct 15 20:00 foto.jpg
-rwxr-xr-x 1 lerner lerner 26 Oct 12 09:00 setup.sh
-rw-r--r-- 1 lerner lerner 2300000 Oct 8 16:00 handbuch.pdf ls Downloads
foto.jpg handbuch.pdf setup.sh
rm -i Downloads/setup.sh
rm: remove regular file 'Downloads/setup.sh'? y
ls Downloads
foto.jpg handbuch.pdf Wo du ihn lernst
Lektionen
- Wo bin ich? pwd, ls und cd Terminal-Start
- Löschen ohne Reue Terminal-Start
- Abschluss-Szenario: Aufräumen im Downloads-Ordner Terminal-Start
- Auf einem fremden Server zurechtfinden Linux-Grundlagen, Modul 1: Survival-Basics
- Ströme lenken Linux-Grundlagen, Modul 4: Pipes und Umleitungen
- Abzweigen und weiterreichen Linux-Grundlagen, Modul 4: Pipes und Umleitungen
- Beispiel: einen Ordner aufräumen Werkstatt
- Beispiel: Schritte in der richtigen Reihenfolge Werkstatt