Basic Ubuntu commands for myself

09/17/13
  • sudo reboot -> reboots system
  • sudo shutdown -h now ->poweroff system
  • service mysql restart -> restart mysql service
  • service apache2 start -> start apache service
  • service apache2 status -> apache service status
  • zip -r file.zip /folder -> zip a folder recursively
  • du -hs /folder -> determine a folder’s size -h human readable -s summary
  • chown owner:group tmpfile -> Change both owner and the group of a file
  • Add a cronjob that runs ever five minutes
    PATH=/usr/sbin:/usr/bin:/sbin:/bin
    */5 * * * * service mysql start
  • Create a user account
    useradd username
  • Change password of a user
    passwd username
  • Rename a folder mv /home/user/oldname /home/user/newname
  • Install updates sudo apt-get update # Fetches the list of available updates sudo apt-get upgrade # Strictly upgrades the current packages sudo apt-get dist-upgrade # Installs updates (new ones)
  • Find all files larger then 49 bytes find /home/admin/web/kavici.com -type f -size +49b -exec ls -lh {} \;
  • Disk usage: df -h

Yorumlar

Görüşünüzü paylaşın

(No HTML, Textile help only please.)