Test Questions Flashcards
(19 cards)
Which of the following commands can be used to resolve a DNS name to an IP address?
a. dns
b. query
c. host
d. iplookup
c. The host command is used for DNS (Domain Name System) lookup operations. It is used to find the IP address of a particular domain name or the domain name of a particular IP address. Nslookup and dig are also commands that can be used to lookup a domain name and convert it to an IP address within a Linux system.
Which of the following is used as a virtual or pseudo filesystem used to interface with the kernel and system as a whole but not with individual processes?
a. /boot
b. /proc
c. /sys
d. /dev
c. The /sys virtual filesystem is used to interact with the kernel and system as a whole. It did not provide any method to interact with individual processes and was created to move some of the original functions from /proc to /sys to clean up the /proc structure.
Which of the following software packages is a mail server?
a. Thunderbird
b. Apache
c. Postfix
d. GIMP
c. Postfix is a free and open-source mail transfer agent that routes and delivers electronic mail. Thunderbird is a mail client, Apache is a web server, and GIMP is an image manipulation program.
What is the maximum amount of memory accessible by a 32-bit operating system?
a. 1gb
b. 2gb
c. 4gb
d. 8gb
c. A 32-bit operating system can only access 4GB of memory. If you need to access larger amounts of memory, you need to install an x64 (64-bit) Linux OS.
Which network device serves as the gateway between your internal network and external network?
a. switch
b. router
c. wireless access point
d. hub
b. A router is a device used to connect two networks, such as your internal and external networks. A router also usually serves as your default gateway in the network.
Why is the file data.txt empty after executing sort data.txt > data.txt?
a. Because sort cannot sort text files, only binary files
b. Because sort detects that both files are the same
c. Because the file gets truncated before sort is executed
d. Because the file gets executed before sort is truncated
c. This is because the redirection is carried out first. This means that the > data.txt truncates the file so that sort finds nothing.
You have been asked to create a script will present the user with a onboard menu in which they can select 4 different commands to run by entering 1, 2, 3, or 4. Which of the following statements should you use to create the simplest and most effective method of choosing the command to run based on the user’s input?
a. if
b. case
c. for
d. while
b. A case statement uses a variable, and each pattern shown before the right parenthesis is a possible value of that variable. If the user’s entry is equal to the value before the parenthesis, the case is run. Using a series of nested if-then-else statements will work, but it is rather clumsy and confusing to understand. A case statement is a much more efficient choice.
What is the correct statement to be used for comparison in a Linux shell script?
a. if [ $x -gt $y ]
b. if $x -gt $y
c. if ( $x -gt $y) if { $x -gt $y }
a. The standard syntax for an if statement is “if [ condition ].” In this case, the comparison is testing if the variable X is greater than the variable Y.
Which option can be used with tail to print the last X bytes of a file to the screen?
a. -n
b. -b
c. -c
d. -x
c. The -c option is used with tail to print only the last X bytes of data to the screen.
Which of the following options is used with tar to create a new .tar archive file?
a. -c
b. -v
c. -f
d. -n
a. The -c option is used to create a new tar file archive.
Which of the following is the UNIX device name for a physical or virtual terminal connection?
a. dev
b. virt
c. phy
d. tty
d. A tty is the Unix device name for a physical or virtual terminal connection. It essentially represents a singular text/computer interface. On Linux, there are multiple tty interfaces (tty0, tty1, tty2, etc.). tty7 is the graphical interface.
Which of the following is a suite of client-server software for creating and using file hosting services?
a. ownHost
b. FileOwn
c. DropCloud
d. ownCloud
d. ownCloud is a suite of client-server software for creating and using file hosting services. ownCloud functionally has similarities to the widely used Dropbox. The primary functional difference between ownCloud and Dropbox is that ownCloud does not offer data center capacity to host stored files. The Server Edition of ownCloud is free and open-source, thereby allowing anyone to install and operate it without charge on their own private server.
What is a set of pages that explain every command available on the system?
a. Man pages
b. Help pages
c. Master pages
d. Informational pages
a. The man pages are a set of pages that explain every command available on the system. This includes information on what they do, the specifics of how to execute them, and what command-line arguments or syntax they accept.
Which option of the command history can be used to clear the user’s history?
a. -clr
b. /c
c. -c
d. $clear
c. Using history -c will clear the current users’ history.
Which of the following is true about environment variable names by convention?
a. Contains all uppercase letters
b. Contains all lowercase letters
c. Contains only numbers
d. Contains only symbols
a. By convention, all environmental variable names should contain only uppercase letters.
Which of the following commands will output all of the lines with the name Fred in upper or lower case but not the word red from the file data_file?
a. grep ‘[Ff]red’ data_file
b. grep -v fred data_file
c. grep ‘[f]red’ data_file
d. egrep fred data_file
a. The command “grep ‘[Ff]red’ data_file will display all occurrences of Fred and fred from the data_file. The options with “fred” will only display the lowercase version, and so will the one with “[f]red”.
What is a special permission bit set on a file or a directory that lets only the owner of the file/directory or the root user delete or rename the file?
a. SGID
b. Sticky bit
c. SUID
d. Special bit
b. A sticky bit is a special permission bit set on a file or a directory that lets only the owner of the file/directory or the root user delete or rename the file. No other user is given privileges to delete the file created by some other user.
Which type of link is used to points to another file like a shortcut in Windows or a Macintosh alias?
a. Hard link
b. Symbolic link
c. Sticky link
d. Smooth link
b. A symbolic link, also termed a soft link, is a special kind of file that points to another file, much like a shortcut in Windows or a Macintosh alias. Unlike a hard link, a symbolic link does not contain the data in the target file.