Linux OS Notes - robbiehume/CS-Notes GitHub Wiki

Things to look into

How programs get run

Directory Structure

  • Common Directories Explained
  • FHS (Filesystem Hierarchy Standard)
  • /bin: essential user binaries (programs); important system programs and utilities
    • /usr/bin: non-essential command binaries
  • /sbin: similar to /bin; contains essential binaries generally intended to be run by root for sysadmin stuff
    • /usr/sbin: non-essential system administration binaries
  • /lib: libraries essential for binaries in /bin and /sbin
  • /etc: contains system-wide configuration files
  • /opt: contains subdirectories for optional software packages
    • Commonly used by proprietary software that doesn't obey the standard file system hierarchy
  • /proc: contains special files that represent system / kernel and process information
  • /tmp: used by applications to store temporary files. The files are generally deleted whenever the system is restarted
  • /usr: contains apps and files used by users, as opposed to by the system
    • Holds things that are read-only in normal operation
  • /usr/local: where locally compiled apps install to by default
  • /var: contains variable files, i.e. files whose content is expected to continually change during normal operation of the system, such as logs and temporary e-mail files

systemd, systemctl, and service

systemctl

  • using systemctl to manage systems services
  • Service application actions
    • Status: sudo systemctl status <application>; Starting: sudo systemctl start <application>; Stopping: sudo systemctl stop <application>; Start on boot: sudo systemctl enable <application> // run disable to no longer start at boot; Restart: sudo systemctl restart <application>
    • Reload: sudo systemctl reload <application>
    • Reload config w/o restarting if possible, if not then restart: sudo systemctl reload-or-restart <application>
      • Some services don't support reload, so this is a good command if you're not sure if it does or doesn't

service

  • Can do similar commands as systemctl^ (start, stop, restart, try-restart, reload, force-reload, status)
  • Syntax is sudo service <application> <command>

systemd

Processes & Jobs

Processes

  • ps aux: see list of all running processes

Jobs

  • jobs: see list of current jobs
  • Jobs have three possible states in Linux: foreground, background, and stopped Processes

logrotate

Crons

⚠️ **GitHub.com Fallback** ⚠️