1/35
A set of question-and-answer flashcards covering key concepts from Lecture 02 on Unix fundamentals, including navigation, permissions, processes, kernel, shell, redirection, piping, and related commands.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
What is the primary role of an operating system?
To handle low-level tasks such as device communication, scheduling/running programs, and task management.
According to the Unix design philosophy, what is the fundamental concept that "everything" is treated as?
A file.
Why is Unix often preferred by programmers and advanced users over Windows or macOS?
It provides lower-level access and greater control over the system, without many of the restrictions found in more consumer-oriented OSes.
What symbol represents the top-level (root) directory in Unix?
/
Which command shows your current directory path?
pwd
Which command lists the contents of the current directory?
ls
Which command is used to change directories?
cd
In every directory, what does the single dot (.) represent?
The current directory.
In every directory, what does the double-dot (..) represent?
The parent directory.
What is the difference between an absolute and a relative path?
An absolute path starts from the root (/) and specifies the full location; a relative path is specified from the current directory.
Which command instantly returns you to the root directory?
cd /
What are the three Unix permission categories applied to a file?
User (owner), Group, and Other.
What three operations can be granted or denied in Unix file permissions?
Read, Write, and Execute.
In the permission string "-rwxr-xr--", what does the leading dash (-) indicate?
The file is not a directory (a directory would show a 'd').
In "-rwxr-xr--", what permissions does the owner (user) have?
Read, Write, and Execute (rwx).
In "-rwxr-xr--", what permissions does the group have?
Read and Execute (r-x).
In "-rwxr-xr--", what permissions does Other have?
Read only (r--).
Why must submitted bash scripts have global execute permission for assignments?
Because the automatic marking script needs to run (execute) them; without global execute, it will fail.
What is the basic function of the command chmod?
To change a file’s permission settings.
What does the command "chmod +x my_script.sh" do?
Adds (grants) execute permission to all users for the file my_script.sh.
In octal notation, what permissions does 7 represent?
Read, Write, and Execute (rwx).
What is the meaning of the octal permission 755?
User: rwx (7); Group: r-x (5); Other: r-x (5).
Define the kernel in the context of an operating system.
The core program that boots first, interfaces directly with CPU, memory and devices, and provides services to all other software.
Name two commands useful for listing system devices.
lsblk and lspci (lsusb is another).
What is the difference between a program and a process?
A program is static code (like a recipe); a process is a running instance of that code (the act of cooking).
If a parent process is terminated, what usually happens to its child processes?
They also terminate (though they can be configured to survive).
What is a Unix shell?
An interactive process that starts and manages other processes, providing a command-line interface to the user.
Which command lets you switch user (often to admin) in a terminal?
su (requires the target user’s password).
What happens if you start a GUI program from a terminal and then close the terminal window?
The GUI program (child process) usually closes as well, demonstrating parent-child dependency.
What does the command cp do?
Copies a file from one location to another.
What does the command mv do?
Moves or renames a file.
What does the command grep do?
Searches files for lines that match a given text pattern.
Which command counts lines, words, and characters in input text?
wc
What symbol is used for output redirection, and what does it do?
— sends (redirects) a program’s output to a file or another destination.
What symbol denotes a pipe, and what does piping accomplish?
| — connects the output of one command directly into the input of another.
Why is the C programming language closely linked with Unix?
Most of Unix was rewritten in C, and C provides many system calls (e.g., system(), execvp()) that interface directly with Unix features.