WorksheetsSystem Programming -Exam One
Total questions: 93
Worksheet time: 2hrs 40mins
What is system programming?
Which of the following is Not considered system programming?
Managing system resources
Performing I/O operations
File manipulation
Querying a database
Process control and inter-process communication
Define Managing system resources?
Managing CPU, memory and file systems.
Deals with input/output operations at a low level(working with system calls for reading/ writing files, interacting with devices)
Working with files, using system calls like open(), read(), write(), and close()
Deals with creating, managing, and synchronizing processes using system calls fork(), exec(), and IPC mechanisms.
Define Performing I/O?
Managing CPU, memory and file systems.
Deals with input/output operations at a low level(working with system calls for reading/ writing files, interacting with devices)
Working with files, using system calls like open(), read(), write(), and close()
Deals with creating, managing, and synchronizing processes using system calls fork(), exec(), and IPC mechanisms.
Define File manipulation?
Managing CPU, memory and file systems.
Deals with input/output operations at a low level(working with system calls for reading/ writing files, interacting with devices)
Working with files, using system calls like open(), read(), write(), and close()
Deals with creating, managing, and synchronizing processes using system calls fork(), exec(), and IPC mechanisms.
Define Process control and inter-process communication?
Managing CPU, memory and file systems.
Deals with input/output operations at a low level(working with system calls for reading/ writing files, interacting with devices)
Working with files, using system calls like open(), read(), write(), and close()
Deals with creating, managing, and synchronizing processes using system calls fork(), exec(), and IPC mechanisms.
Which one is TRUE in terms of logical organization of a computer system?
Application programs lie between users and computer hardware.
Operating systems lie between Users and computer hardware.
Users lie between OS and hardware.
OS coordinates between applications and computer hardware.
The Application Programming Interface (API) in the system's logical organization acts as a bridge between application programs and the (a) .
The kernel is the core component of the operating system that directly manages _________________ and __________________.
Hardware
System resources
User interface
Application Programming Interface
Which component directly interacts with the hardware in the given diagram?
(a)
Which component manages file-related operations in the system?
File management system
I/O Drivers
Network module
Which component acts as an interface between application programs and the kernel?
User Interface
Application Programming Interface
Network module
File Management System
Which system component is directly responsible for managing hardware resources?
User Interface
Application Programming Interface
Kernel
Application Programming
The user directly interacts with the kernel.
True
False
I/O drivers are part of the hardware layer.
True
False
What is the role of I/O drivers in the system?
Write how would you log-in to the snowball server.
Order the steps involved in using SFTP to upload files from your local machine to a remote server.
1. put filename.txt
2. sftp username@snowball.cs.gsu.edu
3. exit
4. cd /path/to/local/directory
5. ls
2,4,1,5,3
1,2,3,4,5
5,3,4,2,1
3,1,5,2,4
To download a file, use the following command:
sftp> (a) filename
To download a directory, use the following command:
sftp> get (a) remote_directory
Which of the following utility commands is used to clear the terminal screen in Unix?
clear
stty
man
date
what does the man utility provide in UNIX?
A way to search for files
A detailed manual page for commands and utilities
A tool to manage network connections
A way to monitor system resources
Which of the following would you type to display the current date and time in the format
date -yymmddhhmm
date
date [yymmddhhmm]
date [yymmddhhmm.ss]
Explain how you would use the man command to get help on a specific utility, like passwd.
stty in Linux is a utility that modifies and prints terminal line settings. Please provide an example of a situation where you might use it.
To log out of a terminal session, you can either type exit or press CTRL - (a) .
The (a) utility can be used to change your password in Unix.
The date utility can be used to change the system date and time.
True
False
The man command can only display manual pages for commands, not for utilities.
True
False
You need to use the stty utility to set up your terminal screen for specific applications.
True
False
What special character erases a character before cursor
CTRL - H
CTRL - W
CTRL - U
CTRL - R
What special character erases a word before cursor
CTRL - H
CTRL - W
CTRL - U
CTRL - R
What special character erases an entire line
CTRL - H
CTRL - W
CTRL - U
CTRL - R
What special character reprints a line
CTRL - H
CTRL - W
CTRL - U
CTRL - R
What special character suspends a running program?
CTRL - C
CTRL - Z
CTRL - S
CTRL - Q
CTRL - D
What special character stops printing to screen?
CTRL - C
CTRL - Z
CTRL - S
CTRL - Q
CTRL - D
which of the following commands is used to list all the files in the current directory?
cat
pwd
ls
head
which of the following commands is used to create a new directory in Unix?
mkdir
rmdir
cd
pwd
Which command allows you to display the first 10lines of a file?
more
head
tail
cat
which command is used to move or rename files in UNIX?
mv
cp
rm
file
To count the number of lines, words, and characters in a file, which command would you use?
wc
cat
more
file
which of the following commands changes the group ownership of a file?
chmod
chgrp
file
groups
The (a) command is used to show the contents of a file in the terminal, one page at a time.
To remove a files from the system, you would use the (a) command
The (a) command allows you to change file permissions in UNIX
If you want to move to the home dirctory, you would use the (a) command.
The (a) command shows the full path of the current working directory.
The tail command shows the last 10 lines of a file.
True
False
The vi and emacs commands are used to show file contents in the terminal
True
False
You have a file named report.txt. You want to copy this file to a directory named /backup. What command would you use
You want to list all files, including hidden ones, in your current directory. What command should you use?
What does the -a option in the ls command do?
Lists only directories
List hidden files and directories
Lists files with long details
Sorts files by date
What is the purpose of the -F option in the ls command?
Shows file sizes in a human-readable format
Adds a character to indicate the file type
Lists files recursively
Displays file permissions
Which option in the ls command will show details of directories but not their contents?
-R
-d
-l
-s
What does the -R option do in the ls command?
Shows disk usage for each file
Lists files recursively, including subdirectories
Shows hidden files
Lists file groups
The ls -algFsdR command does the following:
The -g option in the ls command displays the group name of each file without displaying the owner
True
False
The -s option displays the disk usage in blocks for each file
True
False
What does the -l option do in the ls command?
Lists files in long format, showing details like permissions, owner, and size
Lists only hidden files
Lists files in columns
Lists only directories
Is the following path absolute or relative?
(a)
You are in /home/user/. What relative path would you use to access notes.txt located in /home/user/docs/?
You are in /home/user/docs/. What relative path command would you use to move to /home/user/music/?
What command takes you back to your home directory from anywhere?
What is an absolute pathname?
A path that starts from the current working directory
A path that starts from the root (/) directory
A path that uses .. or . to navigate directories
A path that starts from the root(/) directory
Which of the following is an example of an absolute path?
Test.txt
./Test.txt
/home/csc3320/Test.txt
../../bin/try
What does .. represent in a path?
Current directory
Parent directory
Root directory
hidden directory
What does . represent in a path?
Current directory
Parent directory
Root directory
hidden directory
What does / represent in a path?
Current directory
Parent directory
Root directory
hidden directory
What does the r permission represent?
Read
Write
Execute
No Permission
What does the w permission represent?
Read
Write
Execute
No Permission
What does the x permission represent?
Read
Write
Execute
No Permission
What does the - permission represent?
Read
Write
Execute
No Permission
If the permissions of a file are rwxr-xr--, what is the octal representation?
754
744
775
777
If the permissions of a file.txt is rwxr-xr-- and you want to give execute permission to other what command would you use?
Explain what the permission string rwxr--r-- means for a file. Who has access and what are they allowed to do?
What command will you use to move the cursor to the begining of the current line in vi
0
^
G
H
In vi, how do you delete a word?
d
dw
dd
d2w
Which command writes changes to a file and exits the Vi editor?
:w
:q
:wq
:x
Explain the difference between the :q and :wq commands in vi.
You want to replace all occurrences of the word "apple" with "Orange" in the current file. What vi command would you use?
The command to copy (yank) a line in Vi is (a) .
To move the cursor to the next occurrence of a word in Vi, you would use the command (a) .
In vi, the regular expression ^abc matches any line that starts with (a) .
The command dd deletes an entire line in vi
True
False
In Vi, the + symbol in a regular expression matches the previous character one or more times.
True
False
Which of the following regular expressions correctly matches a phone number in the format ###-###-####?
\d{3}\s\d{3}\s\d{4}
\d{3}-\d{3}-\d{4}
\d{3}.\d{3}.\d{4}
\d{10}
Which of the following regular expressions correctly matches a date in the format MM/DD/YYYY?
\d{2}/\d{2}/\d{4}
(0[1-9]|1[0-2])/(0[1-9]|[12][0-9]|3[01])/\d{4}
\d{1,2}/\d{1,2}/\d{4}
[0-9]{2}/[0-9]{2}/[0-9]{4}
Which of the following passwords would be matched by the regex (?=.*[a-z])(?=.*[A-Z])(?=.*\d).+?
password
PAASWORD
Password1
123456
Which strings match the regex (a(bc)+de)?
abcde
ade
abcbcde
abc
Which strings match the regex [a-z\s]*hello?
Othello
hello
2hello
say hello
An email address (Format: username@domain.com, where the username consists of letters, digits, underscores, or dots, and the domain consists of letters and dots).
Write names of five system calls.
What is an application programming interface (API)?
