Some Linux Tips

  • How to list all the open ports and programs:
    [linux]$ netstat -apne --inet
    [freebsd]$ sockstat
  • How to list all the open files and programs:
    [linux]$ lsof
    [freebsd]$ fstat
  • How to find information about an ip (i.e. 10.0.0.0):
    [unix]$ host 10.0.0.0
    [unix]$ dig -x 10.0.0.0
  • How to find information about an ip owner (i.e. 10.0.0.0):
    [unix]$ whois -h whois.arin.net 10.0.0.0
  • How to find out the mailserver for an ip:
    [unix]$ dig mx some.domain.name.net
  • How to generate a filename with yesterdays date (i.e. for logfiles/backups):
    [linux]$ touch logfile-`date -dyesterday '+%Y-%m-%d'`
    [freebsd]$ touch logfile-`date -v-1d '+%Y-%m-%d'`

Post a Comment

0 Comments