Entfernt Verzeichnispfad von Dateinamen.
basename NAME [SUFFIX]
basename /path/to/file.txt
basename /path/to/file.txt .txt
Umgekehrt zu dirname
Ändere Besitzer und Gruppe von Dateien.
chown [BENUTZER][:GRUPPE] DATEI
chown www-data:www-data /var/www -R
chown john file.txt
chmod -R 755 /var/www (rekursiv für Web-Verzeichnis)
chown -R www-data:www-data /var/www
Rekursiv mit -R.
Entfernt Dateiname von Pfad.
dirname PFAD
dirname /path/to/file.txt
Umgekehrt zu basename
Erkenne Dateityp anhand von Inhalten.
file [OPTIONEN] DATEI
file /bin/sh
file *.gz
Hilfreich beim Debuggen von Binärdateien und Archiven.
Erstelle symbolische oder harte Links.
ln [-s] TARGET LINKNAME
ln -s /usr/bin/python3 /usr/bin/python
ln file1 file2
-s erstellt symbolische Links, ohne -s harte Links.
Schnelle Dateisuche mittels Datenbank (mlocate).
locate MUSTER
locate passwd
locate '*.conf'
Benötigt aktualisierte Datenbank (updatedb).
Zeigt Ziel von symbolischen Links.
readlink [OPTIONEN] DATEI...
readlink /usr/bin/python
readlink -f /usr/bin/python
-f für kanonischen Pfad
Zeigt absoluten kanonischen Pfad.
realpath [OPTIONEN] PFAD...
realpath .
realpath ../file.txt
Auflösung von Links und relativen Pfaden
Zeigt detaillierte Dateiinformationen.
stat [OPTIONEN] DATEI...
stat datei.txt
stat -c '%a %n' datei.txt
Ähnlich zu ls -l, aber detaillierter
Mountet Dateisysteme an Mountpunkte.
mount [OPTIONEN] GERÄT VERZEICHNIS
mount /dev/sda1 /mnt
mount -t nfs server:/share /mnt
Erfordert Root-Rechte. Verschiedene Dateisystem-Typen unterstützt.