Algemene Linux commando’s

Indien een scherm ogenschijlijk hangt

Ctrl+C
Ctrl+D
Ctrl+Z

Server performance

top
Afsluiten = q

Het bekijken van de ruimte op de diver drive volume's

df -h of du -hl | sort -n | less

of  probeer

du -h | grep [0-9]G | less

je ziet alles van 1 Giga en grootter

Het vinden van een string

find . | xargs grep 'string' -sl
Another common search for me, is to just look at the recently updated files:

find . -iname '*php' -mtime -1 | xargs grep 'string' -sl
would find only files edited today, whilst the following finds the files older than today:

find . -iname '*php' -mtime +1 | xargs grep 'string' -sl

Het vinden van grote bestanden

find / -type d -size +50k
Resultaat:
/var/lib/dpkg/info
/var/log/ksymoops
/usr/share/doc/HOWTO/en-html
/usr/share/man/man3

(D) Finding all large files on a Linux

find / -type f -size +20000k
Resultaat:
/var/log/kern.log
/sys/devices/pci0000:00/0000:00:02.0/resource0
/sys/devices/pci0000:00/0000:00:00.0/resource0
/opt/03Jun05/firefox-1.0.4-source.tar.bz2

However my favorite hack to above command is as follows:

find / -type f -size +20000k -exec ls -lh {} ; | awk ‘{ print $8 “: ” $5 }’
Resultaat:
/var/log/kern.log: 22M
/sys/devices/pci0000:00/0000:00:02.0/resource0: 128M
/sys/devices/pci0000:00/0000:00:00.0/resource0: 256M
/opt/03Jun05/firefox-1.0.4-source.tar.bz2: 32M

Comments are closed.