Practical 4 - Linux 1
4️⃣

Practical 4 - Linux 1


Introduction To Linux

  • Operating System ⇒ manages computer resources (i.e. software and hardware)
    • It is an interface between computer programs (software) and physical devices (hardware)
      • Hardware = CPU, RAM, H/SDD, GPU, …
      • Software = computer programs are processes or tasks that run inside the OS
        • End-user applications (e.g. browser, Words, …)
        • Window Manager (OS-mediated access to resources via a GUI)
        • CLI or shell which is a text interface between the user and the OS
  • UNIX = OS designed to be multi-task and multi-user
  • Why a shell?
    • Some programs (i.e. on remote computers such as the HPC) do not provide a GUI or are not amenable to GUIs
    • Keeping track of what you do
    • Possible to solve complex tasks by combining simple commands
  • Unix File System
    • Hierarchical structure (i.e. inverted tree) where files are places in directories and the top of the hierarchy is “/
  • Helpful text-file commands
    • head [FILE] → read the first lines of a file
    • tail [FILE] → read the last lines of a file
    • less [FILE] → dosed viewing of a file
      • Use q to quit
      • Use <space> to go to next page
      • Use h for help
    • > pipes output to a file
      • >> appends to an existing file
  • Helpful commands for packing/unpacking groups of file
    • gzip FILE → compress file into gzip file
    • gunzip FILE → decompress file from gzip file
    • zip F1 F2 ... FN → creates a zip file for all appended files
      • zip -r FILE.zip DIR → creates a zip file with all files contained within DIR
    • unzip FILE → extracts the contents of a zip file to the current directory
    •