FreeBSD Commands

From HyperSecurity Wiki
Jump to: navigation, search
  1. Make Paths:
    • PATH=$PATH:/dir
  2. Create local Database:
    • /etc/cron.daily/slocate.cron
  3. Updated Local Database:
    • /usr/libexec/locate.updatedb
  4. Change file mode (- for take away/+ to add):
    • chmod -rwx
  5. Uncompress foo.z files:
    • uncompress filename.z
  6. Ping Floods:
    • ping -f hostname/IP
  7. Mount a CDROM:
    • mount /mnt/cdrom
  8. Unmount a CDROM:
    • umount /mnt/cdrom
  9. Restart inetd:
    • inetd -W
  10. Install Programs from Ports:
    • cd /usr/ports/category/app && make install clean
  11. Find Files:
    • find / -name foo
  12. Remove a User:
    • rmuser -y username
  13. System Config Utility:
    • /stand/sysinstall
  14. See who is on FTP:
    • netstat|grep ftp
  15. Install Software Manually:
    • make all install restart
  16. Stop/Start Apache:
    • apachectl stop/start
  17. Add a User to Samba:
    • smbpasswd -a username
  18. Search For Text in Directory:
    • grep -r foo ./*
  19. Search Files Extention in a Directory:
    • grep -r foo ./*.foo
  20. List Install Packages:
    • ls /var/db/pkg
  21. Show Install Packages:
    • pkg_info
  22. Delete Installed Package:
    • pkg_delete foo
  23. Add Package:
    • add_delete foo
  24. Change File Ownership to all Files in a Directory:
    • chown -R user.user foo
  25. Change the Date:
    • date 200603251927
  26. Start Apache SSL:
    • apachectl startssl
  27. Edit Port Number:
    • pico /etc/services
  28. Restart init Services:
    • killall -HUP inetd
  29. Update Ports:
    • cvsup ports-supfile
  30. Make Encrypted Password:
    • mkpasswd username
  31. Edit Password File:
    • vipw
  32. Diskspace:
    • df -h
  33. Kill Named:
    • pkill -1 named
  34. Start Named:
    • /usr/sbin/named -u bind -t /var/named
  35. Set User Quota:
    • edquota (-u)(-g) username
  36. File Check and Defrag:
    • fsck
  37. Show System Messages:
    • dmesg
  38. Update FreeBSD:
    • /usr/local/sbin/freebsd-update fetch
  39. Install Update FreeBSD:
    • /usr/local/sbin/freebsd-update install
  40. Unzip .gz Files:
    • gzip -d foo.gz
  41. Create System Links:
    • ln -s source target
  42. Show Network Bandwidth:
    • netstat -m
  43. Release DHCP Client:
    • dhclient -r eth0
  44. Renew DHCP Client:
    • dhclient eth0
  45. Rebuild Command Database:
    • rehash
  46. Crontab Editor:
    • crontab -e
  47. Create a htpasswd file:
    • htpasswd -bc .htpasswd username password
  48. Show IP/PID/Ports of all Listening Network Devices:
    • socketstat -4
  49. Launch CPAN Updates:
    • perl -MCPAN -e Shell
  50. Install DBI or Software:
    • intall "foo"
  51. Untar Files:
    • tar zxvf foo.tar.gz
  52. Change User's Password:
    • chpass username
  53. Change User's Password:
    • passwd username
  54. Change Shell:
    • chsh
  55. Edit Sudo Users:
    • visudo
  56. Install MySQL Database:
    • mysql_install_db
  57. Start MySQL in Safe-Mode:
    • mysql_safe
  58. Checks current Qmail Queue List:
    • vi /var/log/qmail/qmail-send/current
  59. Clean out Qmail queue list (Qmail must be stopped before running command):
    • qmail-remove -s 211 -p 'pattern-to-match' -i -d (to delete)