The Missing Semester on Computer Science Notes

In computer programming, web development, and Linux system administration, understanding absolute and relative paths is crucial for identifying the location of files and directories. Let’s dive into the differences between them:

  1. Absolute Path:

  2. Relative Path:

    • A relative path describes the location of a file or directory relative to your current working directory.

    • It doesn’t start from the root directory; instead, it uses the context of your current location.

    • Relative paths are more flexible because they adapt to different starting points.

    • They use special symbols like . (current directory) and .. (parent directory) to navigate.

    • For example:

      • If your current directory is /home/user, a relative path like Documents/report.txt refers to /home/user/Documents/report.txt.

      • If you’re in /home/user/projects, the same relative path points to /home/user/projects/Documents/report.txt.

Difference between folders and directories

On the surface, folder on the C: drive of Windows, is the same place as the C:\ directory in MS-DOS ( Microsoftsoft Disk Operating System ), therefore in the location sense there is no difference.

  • Though Folders, in a GUI like windows, don't necessarily map a folder to a hard-drive location.

  • With a command-line interface (e.g., MS-DOS or Linux), you would say directory instead of folder as a directory is mapped to a physical location on a storage medium.

What is a Kernal?

  • Kernel is central component of an operating system that manages operations of computer and hardware. It basically manages operations of memory and CPU time. It is core component of an operating system. Kernel acts as a bridge between applications and data processing performed at hardware level using inter-process communication and system calls.

Shebang (Unix)

  • Character sequence consisting of the characters number sign and exclamination mark at the beginning of a script

Different commands in GitBash:

  • Touch

    • Updating Timestamps without changing content

      • You can literally make it so you updated it in the 2000s

        • touch -d 'day month year time' file_name

    • Or it can be used to create an empty file

      • touch file_name

  • sh

    • Bourne Shell -> Command language interpreter

      • Executes commands from a command line string, standard input, or specified files

  • chmod

For editing text documents.

  • ! and many other characters have special meanings in double quotations which often means single quotations are just better.

  • >--> Is redirecting the output stream, and < is redirecting the inptu stream

  • appending to a file is >>

  • Pipes

    • | opereator lets you chain programs

      • The output of one command is the input of the next one chained over

        • ls -l / | tail -n1

Last updated