Some useful sysadmin commands

by Stephen on September 8, 2008

Some useful sysadmin commands:

  1. Show the disk usage per directory one level:
    FreeBSD: du -h -d 1
    Linux: du -h --max-depth=1
  2. How to create a Symlink/Softlink?
    ln -s realpath fakepath
  3. Emptying a file without deleting it:(i.e. quick way to empty system logs)
    cp /dev/null filename
  4. This command will show exim processes including the path to the script being utilized to send mail. Very useful in locating a spamming script.
    ps -C exim -fH eww
  5. To trace through the hops the email gets delivered. This is useful to determine if the message can reach its destination or not.
    exim -bt username@domain.com
  6. Watching logs:
    tail -f /path/to/log-file

Leave a Comment

Previous post:

Next post: