CS202 Linux Tutorial

🐧

Ian Innes, Robert Lawrence, Caleb Murray, Seth Flanders
August 2024


What is Linux? 🖥️

Linux is an operating system, which means that it is a collection of underlying software that supports the computer’s basic functions.


The Interface 🎛️

Linux uses a command line interface. This interface is in a shell, which acts as an environment for the user to interact with the system. bash, Linux’s default shell, has its own programming language for the terminal. Users can use bash as a scripting language to string Unix commands together. Command line interface is different from modern day systems such as MacOs and Windows, which use a graphical user interface where the user navigates the computer by using a cursor and icons. For example, to open a document named “downloads” in the command line interface, we would type “cd downloads”, whereas with graphical user interface we would click on the file icon named “downloads”.


Command Line Prompt >_

When you access the terminal on your device, you will be greeted with a line of text and a blinking cursor. The text jargon will vary depending on your terminal of choice, but they are (mostly) the same functionality wise.


Graphical User Interface 📱

Graphical interfaces differ from the traditional CLI interface used by most Linux operating systems. Rather than using commands to access the contents of the computer, the mouse is used to interact with icons to allow for a simpler and more straightforward user interface.


Commands within the linux operating system 🐧

Due to Linux primarily being used with a command-line interface, knowing the commands is of the utmost importance.
  1. ls
  2. mkdir(name)
  3. pwd
  4. (child directory name)
  5. rm (name)
  6. whoami
  7. clear
  8. cp (file1 file2)
  9. mv (file, name or directory)
  10. chmod (u g w)
  11. ssh (username@hostname)
  12. scp (username@remoteMachine:directoryPathToFile localDirectoryPath)

Absolute vs. Relative Path🛣️

Using the commands seen above, we can use these to create paths to and from directories or documents we might need to access. In Linux a path can be either absolute or relative, here’s the difference between the two.

  1. Absolute Path
  2. Relative Path

Vim⌨️

Vim is an extremely efficient text editor that comes packaged with shortcuts and commands to make the editing experience much easier. Vim minimizes the text editing experience by being key input based (no clicking required) and by having the command line present at all times. A downside to the simplicity is that there is much more memorization required to quickly navigate through the text editor, as compared to other software like Microsoft Word where a GUI is present.

Some useful Vim shortcuts:

  1. yy (yank)
  2. p (put)
  3. dd (delete)
  4. u (undo)
  5. ctrl/cmd + r (redo)
  6. gg

Some useful Vim commands:

  1. :w (write)
  2. :q (quit)
  3. :wq (write and quit)
  4. :q! (force quit)
  5. :sp (split screen)
  6. :(number)
8-28-2024 never doing web design