Dit deel is nog niet vertaald. Je ziet de Engelse tekst.
Wat het doet
Zo schrijf je het
lsattr [-RVadlpv] [FILE]...Opties 7
Meest gebruikt
Niets past bij dit filter.
Voorbeelden 10
$ als gewone gebruiker# als root (of met sudo)
1Attributes of one file
lsattr /etc/resolv.conf ---------------------- /etc/resolv.confNo attributes set.
2Long names
lsattr -l /var/log/app/audit.log /var/log/app/audit.log Append_OnlyEasier to read.
3A directory itself
lsattr -d /srv/archiveWithout -d you see the files inside.
4All files, also hidden ones
lsattr -a ~Includes .bashrc and others.
5Search a tree for immutable files
lsattr -R /etc 2>/dev/null | grep -- '-i-'Explains failing updates or config tools.
6Check SSH files for attacker tricks (security)
lsattr /root/.ssh/authorized_keys /home/*/.ssh/authorized_keysion authorized_keys can hide a backdoor key.7Check before a package update
lsattr /usr/bin/* 2>/dev/null | grep -v -- '^-*e*-* 'Any attribute other than e (extents) is unusual in /usr/bin.
8Show the project number
lsattr -p /srv/projectsUsed with project quotas on ext4/XFS.
9Compare with ls
ls -l /etc/resolv.conf; lsattr /etc/resolv.confls shows the mode; lsattr shows the attributes.
10Errors on special files
lsattr /dev/null lsattr: Operation not supported While reading flags on /dev/nullOnly normal files and folders have attributes.
Niets past bij dit filter.
Exitcodes
0 | Done. |
1 | Error. |