Question
QUESTION 1 Which one of followings is NOT a component of OS? Hard drive File system Process control Memory management Kernel QUESTION 2 Run script1
QUESTION 1
Which one of followings is NOT a component of OS?
Hard drive
File system
Process control
Memory management
Kernel
QUESTION 2
Run script1 with command: bash script1 root
The output is:
User's name does not match
User's name must be specified
Start running ...
Not safe to run script1 as root
QUESTION 3
Operating system is:
hardware
software
hybrid of hardware and software
QUESTION 4
Application programs are loaded before the OS kernel during the booting process
False
True
QUESTION 5
Remove directory 'test' by running command: rm -rf test, then run command: bash script2 7
What files are in directory 'test'?
Directory 'test does not exist
afile0.txt
afile1.txt afile3.txt afile5.txt afile7.txt
afile0.txt afile1.txt afile2.txt afile3.txt afile4.txt afile5.txt afile6.txt
QUESTION 6
Support the following files are in the current working directory: abc.txt, abcd.txt, bcd.txt, amm.doc, ammc.txt. What is the return result after executing command 'ls a??.*'
abc.txt
abcd.txt
amm.doc
ammc.txt
abc.txt
abcd.txt
ammc.txt
abc.txt
amm.doc
bcd.txt
QUESTION 7
Run script with command: bash script1 $(whoami)
The output is:
User's name must be specified
Start running ...
User's name does not match
Not safe to run script1 as root
QUESTION 8
In Windows, if you wanted to adjust the programs that run during system startup, what utility would you employ?
msconfig
ipconfig
ping
chkdsk
QUESTION 9
In OS, shell is a graphical user interface
True
False
QUESTION 10
In Windows, what command would you employ to see your network configuration?
msconfig
nslookup
ping 0.0.0.1
ipconfig /all
QUESTION 11
OS with monolithic architecture involves heavy overhead in the system call.
False
True
QUESTION 12
How to list contents of the current working directories in Linux?
find
ls
show
echo
QUESTION 13
What does the following command mean 'ls -l | more' ?
Execute 'ls -l' and 'more' commands in sequence.
Redirect the output of 'more' command to the input of the 'ls -l' command.
Execute 'ls -l' and 'more' command in parallel.
Tells the shell to connect the standard output of 'ls -l' to the standard input of 'more' by an inter-process communication mechanism called an anonymous pipe/
QUESTION 14
Remove both directories 'release' and 'test' by running command: rm -rf release test
Then run command: bash script2 2
What files are in directory 'release'? What files are in directory 'test'
Directories 'release' and 'test' do not exist
test: afile0.txt afile1.txt; release: afile0.txt
test: afile0.txt release: afile0.txt afile1.txt
test: afile0.txt afile1.txt; release: afile0.txt afile1.txt
QUESTION 15
The non-volatile storage media include:
Optical disk
Flash memory
Hard disk
Tape
QUESTION 16
If an item in the list result has permission attribute like '-rwxr-xr-x', what does it mean?
The owner of the file can read and execute only, the group can read and execute, others can read and execute.
The owner of the file can read and write only, the group can read and execute, others can read and execute.
The owner of the directory can read, write, the group can read and execute, others can read and execute.
The owner of the file can read, write and execute, the group can read and execute, others can read and execute.
QUESTION 17
Function of OS include:
Resource management
Execute and provide services for applications
Standardization of user interface
QUESTION 18
Run script2 with command: bash script2 $(whoami)
The output is:
err: number of files must be specified
err: input must be a number
Start running ...
err: number can not be larger than 45
QUESTION 19
Suppose a file 'test.txt' has the following lines as its content:
Hello World
What is going to be its content after executing the following two commands:
echo "Introduction to Linux" > test.txt
echo "Hello Linux" >> test.txt
Introduction to Linux; Hello Linux
Hello World; Hello Linux
Hello World; Introduction to Linux; Hello Linux
Hello Linux
QUESTION 20
How to rename a file from 'a.txt' to 'b.txt' in Linux?
rename a.txt b.txt
cp -r a.txt b.txt
cp a.txt b.txt
mv a.txt b.txt
QUESTION 21
Run script2 with command: bash script2 25
The output is:
err: input must be a number
err: number can not be larger than $maxn
Start running ...
err: number can not be larger than 20
QUESTION 22
Run script2 with command: bash script2 7
The output is:
Start running ...
err: number can not be larger than $maxn
err: number of files must be specified
system error: cannot creat dir test
QUESTION 23
OS that is implemented with microkernels can suffer from increased system-function overhead
False
True
QUESTION 24
What is RAID?
Redundant array of independent disks
A set of virtual disks
A set of storage simulators controlled by software
Software implementation of virtual disks
QUESTION 25
Run script2 with command: bash script2
The output is:
err: number of files must be specified
err: number can not be larger than $maxn
User's name must be specified
err: input must be a number
QUESTION 26
In Windows, how to open a command prompt window?
press ctrl-alt-F1
press Shift-F1
press Win+R on your keyboard to open it. Then, type cmd or cmd.exe and press Enter
press ctrl-alt-delete
QUESTION 27
Executable files have special format, which may include:
Header
Data and code
Symbol table
Static link
QUESTION 28
What Windows user interface can show you the programs that are currently active?
Event Viewer
Task Manager
Control Panel
Performance Monitor
QUESTION 29
Suppose the home directory for a user is '/home/usera', and the current working directory is '/home/usera/document/work'. What is the current working directory after executing command 'cd ~/..'
/home/usera/document
/home/usera/document/work
/home/usera
/home
QUESTION 30
Which Windows user interface contains a group of configuration utilities?
Performance Monitor
Event Viewer
Control Panel
Task Manager
QUESTION 31
For an item 'atarget' with permission attribute '-rwxr-xr-x', how to change it to: read/write by the owner, read/execute by the group, execute by others?
chmod 754 atarget
chmod 641 atarget
chmod 651 atarget
chmod 741 atarget
QUESTION 32
What is the different between command "ls -l" and "ls -la"?
"ls -la" list detailed information about files and directories include whose names begin with a dot.
"ls -la" lists detailed information about files and directories, while "ls -l" only shows file names.
"ls -la" only shows files but not sub-directories.
"ls -l" only lists names of sub-directories .
QUESTION 33
Which of the following is the root directory under Linux file system and what is the correct command to go to the root directory?
The root dir is "/", and the command to go to the root dir is "goto /"
The root dir is "/", and the command to go to the root dir is "cd /"
The root dir is "/root", and the command to go to the root dir is "cd ~"
The root dir is "/root", and the command to go to the root dir is "cd /root"
QUESTION 34
A library can be linked to an executable file through:
Hyper-thread link
Static link
Dynamic link
Bottom-up link
QUESTION 35
For a file system, operations of file include:
Creating a file
Reading a file
Writing a file
Appending a file
QUESTION 36
Communication inside of of monolithic kernel is through message passing
True
False
QUESTION 37
Remove directory 'release' by running command: rm -rf release, then run command: bash script2 5
What files are in directory 'release'?
afile0.txt afile2.txt afile4.txt
afile1.txt afile3.txt afile5.txt
There are no files in directory 'release'
Directory 'release' does not exist
QUESTION 38
Command line user interface is not as efficient as the graphical user interface. Therefore, system administrators always prefer GUI
False
True
QUESTION 39
Running script1 using command: bash script1
The output is:
User's name must be specified
Not safe to run script1 as root
User's name does not match
Cannot find the command
QUESTION 40
A program requests a service from an operating system's kernel through:
System call
I/O operations
User interface
Interrupt
The script is below
cis2332fall2015/0000755000175200010010000000000012606620526011615 5ustar xwuNonecis2332fall2015/release/0000755000175200010010000000000012606621466013241 5ustar xwuNonecis2332fall2015/src/0000755000175200010010000000000012606621655012410 5ustar xwuNonecis2332fall2015/src/script10000751000175200010010000000040712606557741013724 0ustar xwuNone#!/usr/bin/bash
usrname=$(whoami)
if [ -z $1 ]; then echo "User's name must be specified" elif [ $1 = 'root' ]; then echo "Not safe to run $0 as root" elif [ $1 != $usrname ]; then echo "User's name does not match" else echo 'Start running ...' fi
cis2332fall2015/src/script20000751000175200010010000000272412606621601013714 0ustar xwuNone#!/usr/bin/bash
if [ $1 = 'clean' ]; then if [ -d ../test ]; then $(rm -rf ../test/*) fi if [ -d ../release ]; then $(rm -rf ../release/*) fi exit fi
re='^[0-9]+$' re4file='^[a-z]+([0-9]+)\.[a-z]+' maxn=20 fstr='afile'
if [ -z $1 ]; then echo "err: number of files must be specified" exit 1 elif ! [[ $1 =~ $re ]]; then echo "err: input must be a number" exit 1 elif [ $1 -gt $maxn ]; then echo "err: number can not be larger than $maxn" exit 1 else echo 'Start running ...' fi
if ! [ -d ../test ]; then echo 'creat test dir' $(mkdir ../test) if [ $? -ne 0 ]; then echo 'system error: cannot creat dir test' exit 1 fi else $(rm -rf ../test/*) fi
for (( cnt=0; cnt<$1; cnt++ )); do fname="$fstr$cnt.txt" $(touch ../test/$fname) if [ $? -ne 0 ]; then echo "system error: cannot create file $fname" fi done
if ! [ -d ../release ]; then echo 'creat release dir' $(mkdir ../release) if [ $? -ne 0 ]; then echo 'system error: cannot creat dir release' exit 1 fi else $(rm -rf ../release/*) fi
allfiles=($(ls ../test)) for afile in ${allfiles[@]}; do if [[ $afile =~ $re4file ]]; then filenum=$(echo ${BASH_REMATCH[1]}) if [ $(echo $filenum % 2 | bc) -eq 0 ]; then $(cp ../test/$afile ../release) if [ $? -ne 0 ]; then echo "system error: cannot cp $afile to dir release" exit 1 fi fi fi done
cis2332fall2015/test/0000755000175200010010000000000012606621466012600 5ustar xwuNone
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started