Basic Ubuntu commands for myself

  • 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 /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
    */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)
    cp -i /home/mkavici/file.txt /media/sda3/Dropbox/
  • Find all files larger then 49 bytes find /home/admin/web/ -type f -size +49b -exec ls -lh {} \;
  • Disk usage: df -h


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

(No HTML, Textile help only please.)