File System #
A file system (FS) is the way an operating system organizes and manages data on a storage device, such as a hard drive or USB stick. It keeps track of files and directories, allowing users to store, retrieve, and modify data efficiently. A file system provides a structured way to name files, control access, and manage storage space. Common file systems include NTFS (Windows), ext4 (Linux), and FAT32 (USB drives). It works like a digital filing cabinet, ensuring that data is stored in an orderly way and can be accessed quickly when needed.
Directory Structure:
- UNIX has a single-root hierarchy (
/
), where all files and drives are mounted under the root. - Windows uses drive letters (
C:\
,D:\
) to separate storage devices.
Case Sensitivity:
- UNIX file systems are case-sensitive:
File.txt
andfile.txt
are different files. - Windows file systems (NTFS) are case-insensitive by default:
File.txt
andfile.txt
are treated as the same file.
Visual Studio Code #
- Editor
- IDE (Integrated Development Environment)
- Free, powerful and popular
- Many plugins
Most important commands:
- File / Open Folder
- File / Autosave
- CTRL+P / Command+P
- Run (with Python plugin on a
.py
file) - Ctrl+Shift+P / Command+Shift+P
- UNIX: Terminal / New Terminal
- Win: Use Ctrl+Shift+P and select
CMD
(not Powershell)
Terminal #
A terminal in the context of an operating system is a text-based interface that allows users to interact with the system by typing commands. It provides access to the command-line interface (CLI), where users can run programs, manage files, configure the system, and perform administrative tasks without a graphical interface. The terminal acts as a bridge between the user and the OS’s shell (e.g., Bash in UNIX/Linux or Command Prompt/PowerShell in Windows), which interprets the commands and executes them. Originally, terminals were physical devices connected to mainframes, but today they are software applications like GNOME Terminal, Konsole, iTerm2, and Windows Terminal that emulate the same functionality.
Action | Linux/macOS Command | Windows Command (CMD) |
---|---|---|
Show current directory | pwd | cd |
List files in a directory | ls | dir |
Change directory | cd <folder> | cd <folder> |
Go up one directory | cd .. | cd .. |
Execute a Python script | python3 script.py | python script.py |
.
stands for current directory..
stands for parent directory~
(UNIX) or%HOMEPATH%
(Windows CMD) stands for home directory- Try not to use spaces in directory name, if you have, use
"
around the directory name, e.g.cd "My Documents"
- Use
<TAB>
key for autocompletion
Tips #
- the more shortcuts you learn the more proficient you’ll be
- IDE is like a knife for the chef