C program test 1
Which of the following represents the root directory, i.e., the directory at the very top of the directory hierarchy?
/
When using absolute permissions, what number can be used to grant permissions to view and modify the contents of a file and also to run it if it is a program? Do not use the symbolic mode to answer this question, you must provide a number.
7
What is a computer system?
A combination of hardware and system software
What does the von Neumann architecture use?
A stored-program model
What does the ALU in the processing unit consist of?
Circuitry to perform mathematical operations on binary values
Suppose that you have opened a file named myvifile.txt using the vi editor. Match the commands provided below with their expected function. what does esc do
Come out of the edit mode
Suppose that you have opened a file named myvifile.txt using the vi editor. Match the commands provided below with their expected function. what does Shift+ZZ do
Come out of the file completely
When using the -l (dash-ell) option within the command to see a list of files and directories, what type of file does "d" in the first column represent?
Directory file
Suppose that you have opened a file named myvifile.txt using the vi editor. Match the commands provided below with their expected function. what does i do
Enter the edit mode
User with execute permissions can run a file as a program.
Execute
What are the four phases of instruction execution by the von Neumann architecture?
Fetch, Decode, Execute, Store
What does the program counter (PC) in the control unit do?
Keeps the memory address of the next instruction to execute
What is the size of the smallest addressable unit of memory in modern systems?
One byte (8 bits)
What is the main software part of the computer system?
Operating System
What do all modern computer systems have?
Operating systems that provide programming abstractions and interfaces
What component stores program instructions and data in a computer?
RAM
Grants the capability to view the contents of the file.
Read
What does the rm command do?
Removes / deletes a file
What does the following command do? mv opt1 opt2
Renames the file opt1 to opt2
What does the OS in a computer system do?
Takes information from the environment
Grants the capability to modify, or remove the content of the file.
Write
Which of the following commands can you use to display the contents of a file?
cat
What command can you use to go into your last directory?
cd -
Suppose that you want to navigate to the parent directory of whichever directory you are currently in. Provide the Unix/Linux command to achieve this.
cd ..
Suppose that you want to navigate to a directory named myrcella that is within a directory named cersei, which is housed in a directory named tywin, which in turn is in the root directory. Provide a single Unix/Linux command to achieve this, regardless of what your current directory is.
cd /tywin/cersei/myrcella
What is the Unix command to change file or directory permissions?
chmod
Suppose that you want to add "read" permission for everyone on a file named readme within the current directory, while keeping other existing permissions intact. Provide the Unix/Linux command to achieve this.
chmod a+r readme
Suppose that you want to remove "write" permission for users in a group on a file named touch_me_not within the current directory, while keeping other existing permissions intact. Provide the Unix/Linux command to achieve this.
chmod g-w touch_me_not
Suppose that you want to set"read" and "write" permissions only for the owner of a file named i_am_editable within the current directory. Provide the Unix/Linux command to achieve this.
chmod u+rw i_am_editable
What is the Unix command to change the owner or a file or directory?
chown
What is the basic command to see a list of the files and directories that are within the current directory?
ls
Which command shows me all files with the .doc extension?
ls *.doc
What is the command used to create a new directory?
mkdir
Suppose that you want to delete the file tobedeleted.pdf . Provide the Unix/Linux command to achieve this.
rm tobedeleted.pdf
Which of the following represents the home directory, i.e., the directory at the very top of the directory hierarchy?
~