Linux Commands

Prefix with sudo if the current user is not root (admin)

  • ll ~ list files (simliar to DIR)
  • la ~ list files¬†horizontally
  • rm -r [DIRECTORY NAME] ~ delete directory
  • rm -fm [DIRECTORY NAME]¬†~ delete directory with files in it
  • mkdir [DIRECTORY NAME] ~ create¬†directory
  • sudo ./sbin/shutdown -r now ~ reboot
  • sudo ./sbin/shutdown -h now ~ omit now to schedule a shutdown
  • sudo -i ~ switch to the root user

Hardware Related

  • grep -c ^processor /proc/cpuinfo
  • sudo free -m ~ displays memory usage
  • top ~ this is like the windows task manager
    • CRTL C ~ to quit

ZIP

  • sudo apt-get update
  • sudo apt-get install zip unzip
  • Example usage:
    • sudo unzip content.zip

Text Editor

Nano is installed with ubuntu by default.

https://wiki.gentoo.org/wiki/Nano/Basics_Guide

  • sudo nano postgres.sh
  • sudo chmod +x postgres.sh
    • ~ This marks its as mark executable
  • sudo ./postgres.sh
    • ~ runs the script

 

Leave a Reply

Your email address will not be published. Required fields are marked *