Operating Sys Test 1 Flashcards
What is UNIX and why is it considered a multi-user operating system?
UNIX is an operating system that is the parent of many operating systems, including MINIX. It is considered a multi-user operating system because it allows multiple users to interact with the system simultaneously. Also because it has there is user mode and a kernel mode.
Define the term “super-user” in the context of Unix systems. Why is the super-user also called the system admin?
The super-user, also known as the system admin, is a special user in Unix systems with elevated privileges. This user can perform administrative tasks, configure the system, and has unrestricted access to system resources.
Explain the concept of virtual terminals and how they are used in Unix systems.
Virtual terminals in Unix allow users to access the system remotely or simultaneously from different locations. Users can open multiple virtual terminals, each running a separate Unix shell, to interact with the system.
Why is studying the Unix shell important? List three reasons mentioned in the lecture.
Not every computer system has a GUI.
GUIs offer limited automation capabilities; the shell can be scripted.
There are more than 1000 system tools and utilities available on the command line compared to the GUI.
Briefly describe the role of the shell in a Unix system.
The shell is a program that allows users to launch other programs, efficiently navigate the filesystem, and provides conveniences for increased system usability. It enables users to write and execute scripts, making automation possible.
What is the basic Unix prompt for normal users and the root user? Can the prompt be customized?
The basic Unix prompt for normal users is typically $ or %, and for the root user, it is #. The prompt can be customized to include user names, current directory, time, machine name, or other combinations.
Explain the significance of stdin and stdout in command-line programs. Provide an example.
Command-line programs receive input from stdin (standard input) and produce output to stdout (standard output). For example, the command wc -l myfile uses stdin to read the contents of myfile and stdout to display the line count.
How can you redirect stdin and stdout using the < and > operators?
You can redirect stdin using the < operator, and stdout using the > operator. For instance, wc -l myfile > output.txt redirects the output of the wc command to a file called output.txt.
Describe the structure of the macOS filesystem. What is the root directory, and what are folders called in the shell?
The macOS filesystem is an upside-down tree of directories and files. The root directory is represented by “/”, and directories in the shell are called directories, not folders.
Explain the purpose of the cd, ls, and pwd commands in Unix shell navigation.
cd: Change directory, used to move to a different directory.
ls: List files and directories in the current directory.
pwd: Print working directory, displays the current working directory.
What does the tilde (~) symbol represent in the shell? How can you use it in commands?
The tilde (~) symbol represents a user’s home directory. For example, ls ~ lists files in the user’s home directory, and cd ~ takes the user to their home directory.
Define and provide examples of wildcard characters in Unix shell commands.
Wildcards are symbols representing groups of characters in filenames. Examples include * (matches zero or more characters) and ? (matches a single character).
How does wildcard expansion work in Unix, and why is it useful?
Wildcard expansion converts wildcard specifiers to lists of files by the shell before executing the associated command. It allows users to specify groups of files conveniently.
What is the purpose of the search path in Unix? How can you display the current search path?
The search path is where the shell looks for executable commands. You can display the current search path using the command echo $PATH.
Explain the concept of pipes in Unix. Provide an example of using a pipe to connect two commands.
Pipes (|) allow redirecting the output of one program as the input of another. For example, ls -l *.txt | wc -l lists all .txt files, and the output is counted by wc -l.
What is a filter in Unix, and how does it differ from a regular command? What are there filters you have learned?
A filter is a Unix command that accepts text input, manipulates it, and produces output. Not all Unix commands are filters; filters specifically transform input text.
Three filters I have learned are awk, grep and wc
Give an example of using the awk command as a filter. What does the provided example command achieve?
An example of using awk as a filter is ls -l | awk ‘{print $5}’, which prints the size of files in the current directory, as the size appears in column #5 of the ls -l output.
What is the difference between * and ?
- matches zero or more characters
/ - matches a single character
- matches zero or more characters
What are the three groups of file permissions? What are the permissions?
users, group and others. read, write and execute (rwx)
Describe the meaning of file permissions in Unix. How can you use the chmod command to change file permissions?
File permissions in Unix determine who can read, write, and execute a file. The chmod command is used to change permissions, e.g., chmod myProg o+w grants write permission to others on myProg.
Compare the two methods of specifying file permissions using numbers and symbols.
Using numbers: chmod 751 someFile sets permissions to 7 (rwx) for the owner, 5 (r-x) for the group, and 1 (–) for others. Using symbols: chmod u=rwx,g=rx,o=x someFile achieves the same result.
Briefly explain five shell commands, providing their primary functionalities.
cd, ls, pwd, cp, and echo
change directory, list files and directories, print working directory, copy files or directories print text to the screen
Define the following terms: OS, Super user, Terminal, Shell, GUI.
OS: Operating System; intermediary between software applications and hardware.
Super user: User with special privileges, often the system admin.
Terminal: Program allowing users to execute a shell.
Shell: Program enabling users to launch other programs, navigate the filesystem, and script.
GUI: Graphical User Interface; visual interaction with a system.
Explain the significance of stdin and stdout in command-line programs. Provide an example.
stdin (standard input) is the keyboard, and stdout (standard output) is the screen. Example: wc -l myfile reads from stdin (keyboard) and writes to stdout (screen).
Differentiate between the root directory, sub-directory, and parent directory in the Unix filesystem.
root directory: Top of the directory tree, represented by “/”.
Sub-directory: A directory within another directory.
Parent directory: The directory containing a sub-directory.
What is the purpose of the wildcard expansion? Provide an example.
Wildcard expansion converts wildcard specifiers to file lists before executing a command. Example: echo * lists all files in the current directory.
Define and give an example of a filter in Unix.
A filter is a command that accepts text input, manipulates it, and produces output. Example: grep “pattern” filename filters lines containing a specific pattern from a file.
What is the primary function of an Operating System?
A. Running application programs
B. Providing hardware abstraction
C. Managing data files
D. Handling network interfaces
B. Providing hardware abstraction
Where does the Operating System fit into the computer system?
A. Realm of Mere Mortal Users
B. Realm of Software Developers
C. Realm of Computer Engineers
D. All of the above
D. All of the above
freebie
freebie
What are the components of a modern computer?
A. CPU, RAM, Disks, I/O devices
B. Monitor, Keyboard, Mouse, Printer
C. Software, Hardware, Firmware, Network
D. Database, Compiler, Operating System, Web Browser
A. CPU, RAM, Disks, I/O devices
Explain the CPU instruction cycle.
A. Fetch, Execute, Decode
B. Execute, Decode, Fetch
C. Fetch, Decode, Execute
D. Decode, Fetch, Execute
C. Fetch, Decode, Execute
A. A wire that carries electricity in the motherboard.
B. A wire used to pass information between devices one bit at a time.
C. A wire that connects the CPU to the RAM.
D. A wire responsible for data storage in hard drives.
B. A wire used to pass information between devices one bit at a time.
Define and give examples of conceptual and logical abstractions.
A. Conceptual: Real system complexities; Logical: Framework for data organization.
B. Conceptual: Framework for data organization; Logical: Real system complexities.
C. Conceptual: Hides complexities; Logical: Discusses complexities.
D. Conceptual: Discusses complexities; Logical: Hides complexities.
A. Conceptual: Real system complexities; Logical: Framework for data organization.
Which of the following is NOT part of the Operating System?
A. Utilities like ls, cd, rm, etc.
B. Graphical User Interface
C. Compilers
D. Web Browsers
D. Web Browsers