Podcast
Questions and Answers
What is a significant difference between Unix/Linux and Windows in terms of file naming?
What is a significant difference between Unix/Linux and Windows in terms of file naming?
What is the primary purpose of the /usr directory in a standard Linux distribution?
What is the primary purpose of the /usr directory in a standard Linux distribution?
Why is it recommended to avoid using spaces in file names?
Why is it recommended to avoid using spaces in file names?
What is the benefit of adopting a consistent file naming scheme?
What is the benefit of adopting a consistent file naming scheme?
Signup and view all the answers
What is the purpose of the /bin directory in a standard Linux distribution?
What is the purpose of the /bin directory in a standard Linux distribution?
Signup and view all the answers
What is the primary purpose of a folder in a computer system?
What is the primary purpose of a folder in a computer system?
Signup and view all the answers
Which of the following file types is typically used to store user data?
Which of the following file types is typically used to store user data?
Signup and view all the answers
What is the primary function of a file extension in a Windows operating system?
What is the primary function of a file extension in a Windows operating system?
Signup and view all the answers
Which operating system does not rely heavily on file extensions to identify file types?
Which operating system does not rely heavily on file extensions to identify file types?
Signup and view all the answers
What is required to open a specific type of file in a Windows operating system?
What is required to open a specific type of file in a Windows operating system?
Signup and view all the answers
What does the command ls do in Linux?
What does the command ls do in Linux?
Signup and view all the answers
What is indicated by the first character in a detailed listing with ls -l in Linux?
What is indicated by the first character in a detailed listing with ls -l in Linux?
Signup and view all the answers
What is the equivalent command to ls in Windows?
What is the equivalent command to ls in Windows?
Signup and view all the answers
What information does the ls -l command provide in Linux?
What information does the ls -l command provide in Linux?
Signup and view all the answers
What is indicated by the character 'd' in a detailed listing with ls -l in Linux?
What is indicated by the character 'd' in a detailed listing with ls -l in Linux?
Signup and view all the answers
What type of files are typically stored in the /var directory?
What type of files are typically stored in the /var directory?
Signup and view all the answers
What is the purpose of the /tmp directory?
What is the purpose of the /tmp directory?
Signup and view all the answers
What is the path separator used in Windows?
What is the path separator used in Windows?
Signup and view all the answers
What is the topmost directory in a Linux file system?
What is the topmost directory in a Linux file system?
Signup and view all the answers
What is a key difference between Windows and Linux file systems?
What is a key difference between Windows and Linux file systems?
Signup and view all the answers
What is the purpose of the tilde (~) in Linux/Unix pathnames?
What is the purpose of the tilde (~) in Linux/Unix pathnames?
Signup and view all the answers
What type of pathname starts from the root of the hierarchy?
What type of pathname starts from the root of the hierarchy?
Signup and view all the answers
What command is used to display the folder hierarchy in a tree format?
What command is used to display the folder hierarchy in a tree format?
Signup and view all the answers
What is the command used to print the name of the current user in Windows?
What is the command used to print the name of the current user in Windows?
Signup and view all the answers
What is the purpose of the date command in Linux?
What is the purpose of the date command in Linux?
Signup and view all the answers
What is the default current working directory when a user opens a terminal?
What is the default current working directory when a user opens a terminal?
Signup and view all the answers
What type of path can be used as an argument for the cd command?
What type of path can be used as an argument for the cd command?
Signup and view all the answers
What is the purpose of the cd command?
What is the purpose of the cd command?
Signup and view all the answers
What is the current working directory if you are viewing the Pictures folder in the file explorer?
What is the current working directory if you are viewing the Pictures folder in the file explorer?
Signup and view all the answers
What is the function of the command cd ~ in Linux?
What is the function of the command cd ~ in Linux?
Signup and view all the answers
What is the significance of the course OPS102 for software developers?
What is the significance of the course OPS102 for software developers?
Signup and view all the answers
What is the total percentage of labs in the course OPS102?
What is the total percentage of labs in the course OPS102?
Signup and view all the answers
When is the Mid-Term Test scheduled in the OPS102 course?
When is the Mid-Term Test scheduled in the OPS102 course?
Signup and view all the answers
What is the significance of swapping Weeks 1 and 2 for OPS102 sections ZBB and NCC?
What is the significance of swapping Weeks 1 and 2 for OPS102 sections ZBB and NCC?
Signup and view all the answers
How many quizzes are there in the OPS102 course?
How many quizzes are there in the OPS102 course?
Signup and view all the answers
When is the Final Test scheduled in the OPS102 course?
When is the Final Test scheduled in the OPS102 course?
Signup and view all the answers
What is the primary purpose of the course OPS102?
What is the primary purpose of the course OPS102?
Signup and view all the answers
How many lab results are used to calculate the final lab mark in OPS102?
How many lab results are used to calculate the final lab mark in OPS102?
Signup and view all the answers
When was the OPS102 course first offered?
When was the OPS102 course first offered?
Signup and view all the answers
Study Notes
File Systems
- A file system is a method of organizing and retrieving files efficiently from a storage medium, e.g., a hard disk.
- Both Linux and Windows use hierarchical file systems, where files are organized in folders and subfolders.
- The original (pre-GUI) name for folders is "directories".
- In Windows File System, the hierarchy starts from drives: C, D, etc.
- There are no drive letters like C, or D in Linux.
- In Linux, the topmost directory is the root (/), and all files and directories appear under root.
- Windows has a per-drive root directory, e.g., D:.
Files and Folders (Directories)
- Virtually everything in a modern computer system is a file or a folder.
- Folders are containers that can have files and other folders (called sub-folders).
- Files are used to save user data (or any data) and can be of many different types, e.g., Word DOC document file, C programming language source file, compiled object code file, SQLite database file.
- File types are identified from their extensions – the 3 or 4 last characters after a period/dot.
- Examples of file extensions: .docx – Microsoft Word documents, .exe – an executable program on Windows, .txt – a text file.
Paths: Absolute, Relative, Relative to Home
- A path specifies a unique location of a file or directory in the file system.
- The file system location is found by following the directory tree hierarchy.
- A path is written as a string of characters in which directories are separated by the path separator: a forward slash “/” in Linux and MacOS, or a backslash “\” in Windows.
- There are multiple ways of specifying pathnames: Absolute pathnames, Relative pathnames, Relative to home pathnames.
- Examples of absolute pathnames: /home/jones/Desktop/paris.jpg, D:\Trips\Paris\Louvre.
- Relative pathname: A pathname that does not start with a slash is a relative pathname, and is interpreted relative to the current directory.
- Example of a relative pathname: The argument to cat is relative to CWD: [jane@machine: /home/jane/Documents/]$ cat ./Math/marks.txt.
- Relative to home pathname – on Linux/Unix, a tilde (“∼”) is used as a shorthand for the user’s home directory.
- Example: from anywhere show the contents in Documents folder: [jane@machine: /var/log/]$ ls ~/Documents/.
Current Working Directory
- The current working directory is the folder/directory where you are working at a given time.
- If you are viewing Documents folder in file explorer, then Documents is your current working directory.
- The current working directory is a more important concept when you are interacting with your system through a command-line interface.
- Whenever a user opens a terminal, their home directory is their current working directory.
- We can navigate in the file system and change our current working directory any time using the cd (change directory) command (Linux and Windows).
Changing the Current Working Directory
- In a command-line interface (CLI), we use the command cd to change our current working directory.
- The argument can be any type of path (absolute, relative, or relative to home).
- Examples of cd in Linux: cd /bin, change directory to "/bin", cd, change directory to your home directory, cd ~, change directory to your home directory, cd .., change to parent directory.
- Examples of cd in Windows: cd D:\Courses\OPS102, change directory to "D:\Courses\OPS102", cd, display current directory, cd .., change to parent directory.
File and Folder Names
- Unix/Linux is case sensitive!
- Windows is not case sensitive for file names.
- Adopt a consistent file naming scheme – this will help you find your files later.
- Make your file and folder/directory names meaningful.
- Avoid non-alphanumeric characters, as they may have a special meaning to the system that will make your work more difficult.
- Avoid using spaces in file names – consider periods, hyphens, and underscores instead, spaces in file names can lead to inconsistent results while working in the command-line interface.
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.
Related Documents
Description
Learn about file systems, folders, and files in computer systems. Understand the concepts of home folders, desktop folders, and root folders. Discover how files are used to save user data and more.