Exam Flashcards
True or False?
One of the tasks that an operating system must perform is to manage the resources.
Four resources that an operating system must manage are: the file system,
input/output, processes and memory.
True
The “cd ~” and “cd” commands in Linux will make your home directory
your home directory.
False
The “cat” command can NOT be used to create a file.
False
The “cat” command in Linux can be used to create a file. You can use the “cat > filename” command to create a new file and start entering text into it. The “>” symbol is used to redirect the output of the “cat” command to a file with the specified filename.
In Linux the “..” directory refers to the parent of the current working
directory.
True
The “root directory” in Linux is represented by “\”.
False
False. In Linux, the root directory is represented by the forward slash (“/”) symbol, not the backslash (“”) symbol. The forward slash is used as the directory separator in Linux and UNIX-based systems, while the backslash is used as the directory separator in Microsoft Windows operating systems.
The “rm” command can NOT be used to delete directories.
False. The “rm” command in Linux can be used to delete directories. However, if you try to delete a directory using the “rm” command, you will get an error message stating that the directory is not empty. To remove a directory and its contents, you can use the “rm -r” command, which will recursively remove all files and subdirectories within the specified directory.
The commands “less filename” and “cat filename|less” both accomplish
the same task.
True
Bash has a construct similar to switch in java which is called case and
proper syntax dictates that you must close a case construct with “endcase”.
False. Bash does have a construct similar to a switch statement in Java, which is called the “case” statement. However, in Bash, you do not need to use “endcase” to close a “case” block. Instead, you can use the “esac” keyword to signify the end of a “case” block.
In class we discussed redirection of output and redirection of input. We
use the symbols»_space; and > for redirection of output and < for redirection
of input.
True
nano, vi and sed are examples of editors found on most linux systems that
can be used to create and edit text files.
True
There are two ways to execute a linux script file. One way is to make the file
executable using “chmod” and the second way is to use the “bash” command.
True
. Regex can NOT be used with sed.
False. Regular expressions (regex) can be used with sed, which is a stream editor used for filtering and transforming text.
egrep ‘.$’ science.txt |wc –l will count the number of lines that end with
with a period
True
sed in an interactive editor
False. Sed is not an interactive editor, it is a stream editor used for filtering and transforming text.
ps –l displays all the processes currently running on the system.
True
Bash does not support floating point (decimal fraction) data types.
True
. It is possible to have two files with the same absolute name on a disk.
False. It is not possible to have two files with the same absolute name on a disk.
Regex’s is an abbreviation for Regular Examples
False. “Regex” is an abbreviation for “Regular Expressions.”
Regular expressions (regex) are a powerful tool used to match and manipulate text patterns.
The command “chmod 511 filename” would make the file executable for the
owner
True
To input a value into a bash program you use the command “input”.
False. the command to read input from the user is “read”.
Before you use a variable in bash programming you must first declare the
variable type.
False. In Bash, you don’t need to declare the variable type before using a variable. Bash variables are dynamically typed, which means that the type of a variable is determined by the value assigned to it at runtime.
Which of the following commands would you use to determine the number of words
in the file.
a) head b) tail c) wc d) uniq e) none of these
C)
The command you would use to determine the number of words in a file is wc.
.
. The printenv command is used to show a list of:
a) script variables b) environment variables c) shell operators
d) prototypes for a script. e) none of these
B)
The printenv command is used to show a list of environment variables.
Which of the following commands will show all the processes on atlas:
a) ps -l b) ps -ef c) ls -la d) ps -all e) none of these
B)
The ps -ef command will show all the processes on Atlas.