Operating Sys. Quiz 2 Flashcards
Difference between “normal” user and “super-user/root”
- “normal” users with a limited set of privileges on the system
- “root” user is the system admin
What is the shell?
The shell is essentially a program that allows you to launch other programs
What symbol is used for normal users and what symbol is used for root users
$ or % for normals users
# for root users
What do command-line programs receive their inputs and outputs from
stdin for inputs
stdout to write their output
How can you redirect stdin and stdout
with the < (input) and > (output) redirection operators
what does wc -l my file > output.txt do?
sends the output of the wc command to a file called output.txt
What do we call “folders” in Finder and similar graphical file navigation tools?
Directories
How can every file or directory in the filesystem can be located?
Using its full path name
What does pwd, ls and cd do?
- pwd stands for “print working directory”
- ls stands for list the files. Use ls -l to get a “long” detailed listing
- cd stands for “change directory”.
What is a shell wildcard?
A wildcard is a symbol that represents a group pf characters in a filename.
The bash offers two wildcards: “*” and “?”
What is the difference between the :*” wildcard and the “?” wildcard.
“*” wildcard is a stand-in for zero or more consecutive characters
“?” wildcard is a stand-in for a single character
What does echo * do? What about echo../???
- list all the files ( and directories) in the current directory
-lists all the 3 letter files in the parent directory
How do you find the search path
Type “echo path” to display the places the shell searches when you type a command
What are pipes?
”|”, pipes allow you to redirect the output of one program and make it the input of another
What does ls -l *.txt | wc -l do?
this lists all .txt file one line at a time. wc then counts the number of input lines
What does ls -l | awk ‘{print $5}’ do?
prints the size of the files in the directory because that appears in column #5 of the output ls -l
what is awk -F ‘ ‘ ‘{print $n}’
Where n is the column of interest. And, optionally, the -F is the firstly separator
what does this do:
cat etc/passwd | awk -F’:’{print $5}’ |sort
The cat command dumps the output of the file. The pipe redirects that output to the input of the awk filter which extracts the 5th column. The output of awk is redirected to the input of the sort filter which sorts it
What are the file permission groups? In what order are the permissions? Each group starts at every __ letters?
- user, group, other permissions
- 3
How do you change the permissions of a file? How would you take away or give a permission?
- chmod myProg o+w
- would give others write permission on the file myProg
What is an operating system?
A program that acts as an intermediary between software applications and the hardware of a computer
What is the CPU Instruction Cycle?
fetch, decode, execute
What is a data wire?
- a data wire is an electric wire used to pass inofrmation between two or more devices one bit at a time
- a wire may hold voltage ( a binary 1) or may have no voltage ( a binary 0)
What is a databus?
- When multiple data wires connect a set of components is called a databus
- A bus can simultaneously transfer as many bits of data as there are wires
- the number of wires is called the bus width