LPI Essentials 3
Which of the following is the dmseg command used for? Choose one: To show the kernel log messages To show the messages for the daemon logs To show the syslog file's informational messages To show the user login and logoff attempts
To show the kernel log messages
True or false: Copyright law governs the distribution of software in most countries. Choose one: True False
True
True or false: You can set a directory's time stamps with the touch command. Choose one: False True
True
What are the three sets of permission for a file? Administrator, group, others User, group, others User, standard user, others Administrator, standard user, others
User, group, others
What is the first character for a file or directory names if they should not be displayed by commands such as ls unless specifically requested? \ (backslash) _ (underscore) . (dot) - (minus)
. (dot)
When a new user is added, where does the user ID get stored? /etc/pass /etc/shpasswd /etc/realm /etc/passwd /etc/users
/etc/passwd
What is the usual absolute path of the personal directory for the user foo?
/home/foo /home/foo/ Most personal user directories in Linux are located at "/home"
Which of the following directories is often used to store log files? /home /dev /var /temp /usr
/var
Which permissions should be given to a file that needs to be opened and edited by the file's owner and opened read-only by the file's group? 0540 0640 0466 0444 0751
0640
Which of the following statements would be used for sending both standard output and standard error to the same location? Choose one: 2 &> 2 >& 2>&1 2 <&
2>&1
What is a Linux distribution? Choose one: A bundling of the Linux kernel, system utilities and other software. The Linux file system as seen from the root account after mounting all file systems. An operating system based on Linux but incompatible to the regular Linux kernel. The set of rules which governs the distribution of Linux kernel source code. A set of changes to Linux which enable Linux to run on another processor architecture.
A bundling of the Linux kernel, system utilities and other software.
The output of the program date should be saved in the variable actdat. What is the correct statement? A. Actdat=$(date) B. Set actdat='date' C. Date | acdat D. Date > $actdat E. Actdat=date
A. Actdat=$(date) ExplanationIn a Linux shell script, you can use the date command to retrieve the current date and time. To save the output of this command into a variable named actdat, you can use command substitution, denoted by $(...).
Which of the following applications are used to play an MP3 file on a Linux system? Choose three answers A. Banshee B. Audacious C. LibreOffice Player D. Amarok E. Xara Xtreme
A. Banshee B. Audacious D. Amarok
What does the shebang line start with? A. $ B. #! C. /bash D. /bin
B. #! The shebang line, which starts with #!, is used to specify the interpreter for the script. In this case, the shebang line indicates that the script should be interpreted by the Bash shell.
Which of the following statements may be used to access the second command line argument to a script? A. "ARG$2" B. $1 C. "$2" D. "$1" E. '$2'
C. "$2" ExplanationThe correct answer is "$2" because in most programming languages, including shell scripting, the dollar sign ($) followed by a number is used to access command line arguments. In this case, "$2" would refer to the second command line argument passed to the script.
Which option will cause the echo command NOT to output a trailing newline? A. -e B. -p C. -n D. -s
C. -n ExplanationThe option "-n" will cause the echo command to not output a trailing newline. This means that when using the echo command with the "-n" option, the text will be displayed without a new line character at the end, allowing the next output to be displayed on the same line.
Which of the following files holds the definition of the local user accounts? A. /etc/secret B. /etc/users C. /etc/passwd D. /etc/id E. /etc/home
C. /etc/passwd ExplanationThe correct answer is /etc/passwd. This file holds the definition of the local user accounts on a Unix-like operating system. It contains important information such as the username, user ID, group ID, home directory, and shell for each user. This file is used by the system to authenticate users and manage their permissions and access privileges.
The following file is found in which system file?root:x:0:0::/root:/bin/bash A. /etc/user.cong B. /etc/shadow C. /etc/passwd D. /usr/bin/shadow E. /etc/password
C. /etc/passwd ExplanationThe correct answer is /etc/passwd. This file is found in the system file directory and contains essential information about user accounts on the system, such as usernames, user IDs, group IDs, home directories, and default shells. It is a plain text file that can be accessed by privileged users and some system processes for authentication purposes.
Which of the following is a Linux based operating system for use on mobile devices? A. IOS B. CentOS C. Android D. Debian
C. Android ExplanationAndroid is a Linux based operating system for use on mobile devices. It was developed by Google and is widely used on smartphones, tablets, and other mobile devices. Android provides a user-friendly interface, supports a wide range of applications, and allows for customization and flexibility. It is known for its open-source nature, which allows developers to modify and enhance the operating system according to their needs.
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, if data.txt is empty now, it must have been empty before C. Because the file gets truncated before the sort is executed D. Because sort detects that both files are the same
C. Because the file gets truncated before the sort is executed
Which of the following will change the group that is associated with a file? A. Chmod B. Chmod -w C. Chown D. Ls -g
C. Chown ExplanationThe command "chown" is used to change the owner of a file, and by extension, it also changes the group associated with that file. This command allows the user to transfer ownership from one user to another, and in doing so, the group association may also be modified. Therefore, "chown" is the correct answer for changing the group associated with a file.
Which of the following Linux distributions use the dpkg package management system? (Choose two correct answers) A. Suse B. Red Hat C. Debian D. Ubuntu E. Mandriva
C. Debian D. Ubuntu ExplanationDebian and Ubuntu both use the dpkg package management system. Dpkg is a package manager used in Debian-based Linux distributions to install, remove, and manage software packages. Suse, Red Hat, and Mandriva use different package management systems such as RPM (Red Hat Package Manager) or Zypper. Therefore, the correct answers are Debian and Ubuntu.
Which is a suitable command to find the next appearance of the word hidden in a man page being viewed from the command line? A. Find hidden B. /? hidden C. CTRL-F hidden D. /hidden
D. /hidden ExplanationThe command "/hidden" is the correct answer because it is the syntax used to search for the next appearance of the word "hidden" in a man page being viewed from the command line. By typing "/hidden" and pressing enter, the command line will search for the next occurrence of the word "hidden" in the man page.
Why is the file data.txt empty after executing sort data.txt > data.txt? A. Because, if data.txt is empty now, it must have been empty before B. Because sort cannot sort text files, only binary files C. Because sort detects that both files are the same D. Because the file gets truncated before the sort is executed
D. Because the file gets truncated before the sort is executed ExplanationWhen the command "sort data.txt > data.txt" is executed, it redirects the sorted output of the "sort" command to the same file "data.txt". However, the ">" operator truncates the file before any data is written to it. Therefore, the file becomes empty before the "sort" command is executed, resulting in an empty "data.txt" file.
How could one search for the file foo.txt under the directory /home? A. Search /home -file foo.txt B. Search /home foo.txt C. Find /home -file foo.txt D. Find /home -name foo.txt E. Find /home foo.txt
D. Find /home -name foo.txt ExplanationThe correct answer is "find /home -name foo.txt". This is because the "find" command is used to search for files and directories within a specified directory. The "-name" option is used to search for files with a specific name, in this case "foo.txt". The "/home" argument specifies the directory in which to search for the file.
Which of the following commands will output all of the lines that contain either the string Fred or fred? (Choose Two correct answers) A. Grep -v fred data_file B. Grep '[f]red' data_file C. Egrep fred data_file D. Grep '[Ff]red' data_file E. Grep -i fred data_file
D. Grep '[Ff]red' data_file E. Grep -i fred data_file ExplanationThe correct answers are "grep '[Ff]red' data_file" and "grep -i fred data_file".The first command, "grep '[Ff]red' data_file", uses a regular expression to search for lines that contain either "Fred" or "fred". The square brackets indicate a character class, so it matches any line that contains either "Fred" or "fred".The second command, "grep -i fred data_file", uses the "-i" option to perform a case-insensitive search. It will match lines that contain either "Fred" or "fred", regardless of the case.
Which command displays the list of groups to which a user belongs? A. Whoami B. Isgroup C. Who D. Id
D. Id The "id" command displays the list of groups to which a user belongs.
What is the ls command used for in Linux? Choose one: It lists all of the shared files on a system It lists the files within a directory It lists all of the saved cookies on a system It lists all the users who are using a file
It lists the files within a directory
Which of the following statements is true about Free Software? Choose one: It is only distributed as a compiled binary. It is developed by volunteers only. It only runs on Linux. It must always be available free of charge. It may be modified by anyone using it.
It may be modified by anyone using it.
What does the "rm -rf" command do in Linux? Choose one: Rename all the files in the current directory Remove all the files in the current directory Rename all the files in the directory and subdirectories Remove all the files in the directory and subdirectories
Remove all the files in the directory and subdirectories
Which of the following commands will create an archive file, named backup.tar, containing all the files from the directory /home? Tar -cf backup.tar /home Tar -cf /home backup.tar Tar -xf /home backup.tar Tar /home backup.tar Tar -xf backup.tar /home
Tar -cf backup.tar /home
How is it possible to determine if an executable file is a shell script which is ready by Bash? The file must end with .sh Scripts are never executable files /bin/bash has to be run in debug mode The file line starts with #!/bin/bash
The file line starts with #!/bin/bash
What type of information will you find in /etc/passwd for ordinary user accounts?(Choose all that apply.) Choose: The path to the account's home directory The path to the account's default GUI desktop environment A complete listing of every group to which the user belongs A user ID (UID) number The path to the account's default text-mode shell
The path to the account's home directory A user ID (UID) number The path to the account's default text-mode shell
Most Linux distributions maintain information on what packages are installed in the ________. a) kernel b) package database c) graphical desktop d) /usr/lib directory e) Software updater
b) package database
What is the purpose of conditional expressions in shell scripts?. a) They prevent scripts from executing if license conditions aren't met. b) They display information about the script's computer environment. c) They enable the script to take different actions in response to variable data. d) They enable scripts to learn in a manner reminiscent of Pavlovian conditioning. e) They cause scripts to run only at specified times of day.
c) They enable the script to take different actions in response to variable data.
Each document in an info page is known as a ________. a) pager b) site c) node d) link e) level
c) node
You can install and manage various Linux software applications via a(n) ________ management system. a) office b) file c) email d) package e) program
d) package
A type of software that's distributed for free but that requires payment on the honor system if a person uses it is called ________. a) open source b) commercial c) freeware d) shareware e) virus
d) shareware
Where did the Linux kernel come from? a) It was derived from Microsoft Windows. b) It was derived from Apple macOS. c) It was derived from AT&T Unix. d) It was derived from BSD Unix. e) It was created by Linus Torvalds.
e) It was created by Linus Torvalds.
A Linux server that handles the SMB/CIFS protocol normally runs the ________ software. a) ProFTPD b) telnetd c) named d) Dovecot e) Samba
e) Samba
Users can motivate programmers to work on open source projects by offering a(n) ________ to whomever completes the project first. a) donation b) salary c) present d) kudos e) bounty
e) bounty
Which command to use to show which shell is being used? Choose one: show SHELL echo $SHELL display SHELL $SHELL
echo $SHELL
What command can you use to both display and set the IP address, netmask, and default router values? Choose one: ifconfig iwconfig ip ifup router
ip
The ls command: Choose one: lists all the users using a file shows the current owner of a file lists the files in a directory
lists the files in a directory
What permissions are set on a file with the command chmod 654 file.txt? Choose one: -rw-r-xr-- d--wxr-x-- -rwxrw--x drw-r-xr-- --wxr-x--x
-rw-r-xr--
What permissions are set on a file with the command chmod 654 file.txt? D--wxr-x-- --wxr-x--x Drw-r-xr-- -rw-r-xr-- -rwxrw--x
-rw-r-xr--
Which option will cause the echo command NOT to output a trailing newline? Choose one: -p -n -e -s
-n
When typing a long command line at the shell, what single character can be used to split a command across multiple lines?
"\"
What two-character sequence is present at the beginning of an interpreted script? Please specify two characters only.
#! ExplanationThe two character sequence present at the beginning of an interpreted script is "#!". This sequence is known as a shebang or hashbang and is used to specify the interpreter for the script. It tells the operating system which interpreter should be used to execute the script.
Which of the following commands will set the variable text to olaf is home? (Select two answers) $text='olaf is home' Text=='olaf is home' Text=olaf\ is\home Text=$olaf is home Text=="olaf is home"
$text='olaf is home' Text=='olaf is home'
Which of the following answers are true for cloud computing? (Choose two correct answers) A. Cloud Computing provides new tools to manage IT resources B. From the business perspective, Cloud Computing means outsourcing or centralization of IT operations C. Cloud Computing is the opposite of the Green IT; i.e., the use of fossil non-regenerative energy for computing D. Cloud Computing implies sharing all information with everyone else in 'the cloud'
A. Cloud Computing provides new tools to manage IT resources B. From the business perspective, Cloud Computing means outsourcing or centralization of IT operations ExplanationCloud Computing provides new tools to manage IT resources, which means that it offers innovative solutions and technologies for handling and optimizing IT resources. From the business perspective, Cloud Computing involves outsourcing or centralization of IT operations, allowing companies to rely on external providers for their IT needs, resulting in cost savings and increased efficiency.
Which command will archive /home and its content to /mnt/backp? (Choose two correct answers.) A. Cp -ar /home /mnt/backp B. Tar -cf /mnt/backup/archive.tar /home C. Sync -r /home /mnt/backp D. Copy -r /home /mnt/backp E. Mv /home /mnt/backp
A. Cp -ar /home /mnt/backp B. Tar -cf /mnt/backup/archive.tar /home
Which of the following commands can be used to view a file and do search operations within it while viewing the contents? A. Less B. Find C. Grep D. Report E. See
A. Less ExplanationThe correct answer is "less" because the "less" command is used to view the contents of a file and allows for searching within the file. It is a pager program that displays text files page by page, and it provides various navigation and search options to easily view and search for specific content within the file.
Which of the following commands can be used to extract content from a tar file? A. Tar -xvf B. Tar -vf C. Tar -e D. Tar -c E. Tar -v
A. Tar -xvf ExplanationThe command "tar -xvf" can be used to extract content from a tar file. The "x" flag stands for extract, the "v" flag stands for verbose (displaying the progress and details of the extraction), and the "f" flag is used to specify the file name. This command will extract the contents of the tar file to the current directory.
Which of the following commands are used to view memory usage (Choose two correct answers). A. Top B. Free C. Ps D. Nice E. Memory
A. Top B. Free the 'top' command is used to view real-time information about system processes including memory useage The command 'free' is used to display the amount of free memory
Which command will display running process information in realtime? A. Top B. Show current C. Ps current D. Process
A. Top ExplanationThe correct answer is "top". The "top" command is used to display real-time information about running processes on a system. It provides a dynamic view of the system's processes, including details such as CPU usage, memory usage, and process IDs. By continuously updating the information, "top" allows users to monitor the system's performance and identify any processes that may be consuming excessive resources.
Which of the following commands can be used to create a file? A. Touch B. Build C. Nico D. Create E. Mkfile
A. Touch ExplanationThe correct answer is touch. The touch command is commonly used in Unix and Linux operating systems to create an empty file. It can also be used to update the access and modification timestamps of an existing file. The other options, build, nico, create, and mkfile, are not valid commands for creating a file.
Which of the following commands increases the number of elements in a directory (choose two answers) A. Touch newfile B. Create newfile C. Ls newfile D. Rmdir newdirectory E. Mkdir newdirectory
A. Touch newfile E. Mkdir newdirectory ExplanationThe command "touch newfile" creates a new file in the current directory, which increases the number of elements in the directory. Similarly, the command "mkdir newdirectory" creates a new directory in the current directory, also increasing the number of elements in the directory.
Which of the following is a requirement of the GPL license but not the BSD license? A. Users who modify and distribute the software under the GPL license, must make the modifications they made, available to the recipients under the same license. B. The GPL license contains a disclaimer of warranty requiring users not to hold the software authors liable to any damage. C. The GPL license requires that any legal disputes be settled with the modification of Free Software Foundation. D. The GPL license forbids the removal of the copyright and license notices from the source code files that are distributed.
A. Users who modify and distribute the software under the GPL license, must make the modifications they made, available to the recipients under the same license.
Which of the following is NOT a Linux desktop environment: Choose: KDE ABC Unity Dwarf XFCE
ABC Dwarf
What is the first character for a file or directory names if they should not be displayed by commands such as ls unless specifically requested? A. \ (backslash) B. . (dot) C. - (minus) D. _ (underscore)
B. . (dot) ExplanationIn Unix-based systems, the dot (.) is used as the first character for file or directory names that should not be displayed by commands like ls unless specifically requested. This convention is commonly used for hidden files or directories, which typically contain configuration files or sensitive data that should not be easily accessible or accidentally modified. By starting the name with a dot, the file or directory is effectively "hidden" from regular directory listings, providing a level of privacy or organization.
Identify the proper device for the third partition, on the second hard disk, on the first IDE controller on a PC system. A. Dev/hdc1a3 B. /dev/hdb3 C. /dev/hdc1d2p3 D. /dev/hd1b3 E. Dev/hdc1b3
B. /dev/hdb3 Linux disk naming convention is: /dev[device][partition] where [partition] represents the device identifier and [partition] represents the partition number
Which of the following are correct commands for changing the current directory to the user's home? (Choose TWO answers) A. Cd /home B. Cd ~ C. Cd .. D. Cd E. Cd /
B. Cd ~ D. Cd ExplanationThe command "cd ~" is used to change the current directory to the user's home directory. The tilde (~) represents the user's home directory. The command "cd" without any arguments also changes the current directory to the user's home directory. Therefore, both "cd ~" and "cd" are correct commands for changing the current directory to the user's home.
Which of the following file systems is most commonly used for Linux distributions? A. HFS+ B. Ext4 C. FAT32 D. NTFS
B. Ext4 Explanationext4 is the most commonly used file system for Linux distributions because it is the default file system for many Linux operating systems. It offers improved performance, reliability, and support for larger file sizes and partitions compared to its predecessor, ext3. Additionally, ext4 supports features such as journaling, which helps to prevent data loss in the event of a system crash. Overall, ext4 is widely adopted and trusted by the Linux community, making it the preferred choice for Linux distributions.
Which of the following commands is used to lookup the current IP address of a system? A. Sysinfo | grep ipaddress B. Ifconfig C. Less/proc/net/ipconfig D. Ipconfig E. Showip
B. Ifconfig
Which of the following commands is used to lookup the current IP address of a system? A. Less/proc/net/ipconfig B. Ifconfig C. Showip D. Ipconfig E. Sysinfo | grep ipaddress
B. Ifconfig ExplanationThe correct answer is "ifconfig". This command is used to lookup the current IP address of a system. It displays the network configuration information of all network interfaces on the system, including the IP address assigned to each interface.
Which of the following can be used to access the command line? A. BIOS B. Terminal C. XWindow D. Firefox E. Xargs
B. Terminal ExplanationTerminal is the correct answer because it is a command line interface that allows users to interact with the operating system by typing commands. It provides a text-based environment where users can execute commands, run scripts, and navigate through directories. Unlike graphical user interfaces like XWindow or Firefox, the terminal provides direct access to the command line, making it a powerful tool for advanced users and system administrators. BIOS and Xargs are not used to access the command line, as BIOS is responsible for booting the computer and Xargs is a command used to build and execute command lines from standard input.
Which function does a shell program serve? A. It provides a graphical environment B. It is responsible for establishing a connection to another computer C. It receives user commands and executes them D. It is responsible for logging a user into the system
C. It receives user commands and executes them ExplanationA shell program serves the function of receiving user commands and executing them. It acts as an interface between the user and the operating system, allowing users to interact with the computer by entering commands. The shell program interprets these commands and executes them, performing various tasks such as running programs, managing files, and controlling system resources. It provides a command-line interface where users can enter commands and receive output or perform actions based on those commands.
Which of the following programs is not a graphical web browser? A. Konqueror B. Firefox C. Links D. Opera E. Chrome
C. Links ExplanationLinks is not a graphical web browser because it is a text-based web browser. Unlike graphical web browsers, Links does not display web pages with images or other visual elements. Instead, it focuses on providing a lightweight and efficient browsing experience by rendering web pages in text format. This makes it suitable for low-resource environments or for users who prefer a minimalist browsing experience.
Which of the following statements concerning the General Public License (GPL) is true? A. GPL software may never be sold for money B. If you changed a program you received under the GPL, you must send your changes to the original author for approval C. The GPL is designed to ensure that the source code of a software remains freely available D. The GPL is identical to the BSD license E. GPL software may not be used to run nuclear reactors or air traffic control systems
C. The GPL is designed to ensure that the source code of a software remains freely available
How is it possible to determine if an executable file is a shell script which is ready by Bash? A. The r bit is set B. The file must end with .sh C. The file line starts with #!/bin/bash D. /bin/bash has to be run in debug mode E. Scripts are never executable files
C. The file line starts with #!/bin/bash ExplanationThe correct answer is "The file line starts with #!/bin/bash". This is because the shebang line, which starts with #!, is used to specify the interpreter for the script. In this case, the shebang line indicates that the script should be interpreted by the Bash shell.
Which statement about the directory /etc/skel are correct? (Choose two answers) A. The personal settings of root are in this directory B. The files from the directory are copied to the home directory of the new user when starting the system C. The files from the directory are copied to the home directory of the new user when the account is created D. The directory contains a default set of configuration files used by the useradd command E. The directory contains the global settings for the Linux system
Correct Answer(s)C. The files from the directory are copied to the home directory of the new user when the account is createdD. The directory contains a default set of configuration files used by the useradd command ExplanationThe directory /etc/skel contains a default set of configuration files used by the useradd command. When a new user account is created, the files from this directory are copied to the home directory of the new user. This ensures that the new user has a set of default configuration files and settings. However, the directory does not contain the personal settings of root and it does not contain the global settings for the Linux system.
Given the following directory permissions:drwxrwxrwt 14 root 36864 2012-03-02 11:17 tmpWhat is the letter t at the end of drwxrwxrwt indicate? A. It is the sticky bit that causes all commands in this directory to be launched as a root. B. It means that even though the directory is global writable only the owner can delete their own files C. It makes the directory accessible for everybody D. It indicates that this directory contains only temporary files that may be deleted E. It is a temporary bit that prevents launching commands in this directory F. Option 6
Correct AnswerB. It means that even though the directory is global writable only the owner can delete their own files ExplanationThe letter "t" at the end of "drwxrwxrwt" indicates the sticky bit. This means that even though the directory is globally writable, only the owner of a file within the directory can delete their own files. This is a security measure that prevents unauthorized deletion of files by other users.
After installing a new package, in which directory are you most likely find its configuration file? A. /lib B. /conf C. /etc D. /usr E. /opt
Correct AnswerC. /etc ExplanationAfter installing a new package, you are most likely to find its configuration file in the /etc directory. The /etc directory is commonly used to store system-wide configuration files in Unix-like operating systems. It is the standard location for various configuration files, including those related to installed packages. Therefore, it is the most probable directory to find the configuration file of a newly installed package.
Which of the following commands moves the directory ~/summer-vacation and it content to ~/vacation/2011? A. Mv ~/vacation/2011 ~/summer-vacation B. Move -R ~/summer-vacation ~/vacation/2011 C. Mv /home/summer-vacation /home/vacation/2011 D. Mv ~/summer-vacation ~/vacation/2011 E. Mv -R ~/summer-vacation ~/vacation/2011
D. Mv ~/summer-vacation ~/vacation/2011 ExplanationThe correct answer is "mv ~/summer-vacation ~/vacation/2011". This command uses the "mv" command to move the directory ~/summer-vacation and its contents to ~/vacation/2011. The "~" symbol represents the home directory, so this command is moving the "summer-vacation" directory from the home directory to the "vacation/2011" directory within the home directory.
Which one of the following statements concerning Linux passwords is true? A. All passwords can be decrypted using the system administrator's master password B. Passwords may never start with a non-letter C. Users cannot change their password once it has been set D. Passwords are only stored in encrypted form E. Passwords may be at most six characters long
D. Passwords are only stored in encrypted form ExplanationPasswords are only stored in encrypted form. This means that when a user sets a password on a Linux system, it is encrypted and stored in a secure manner. The encryption ensures that even if someone gains unauthorized access to the system's password file, they will not be able to easily determine the actual passwords. This is an important security measure to protect user accounts and sensitive information.
Which command lists all files in the current directory that starts with a capital letter? A. Ls [A-Z]* B. Ls A-Z C. Ls A-Z* D. Ls --upercasefiles E. Ls -uppercase-files
D. The combination of Linux, Apache, MySQL, and PHP and other programming languages ExplanationThe correct answer is the combination of Linux, Apache, MySQL, and PHP and other programming languages. LAMP is a popular open-source web development platform that uses these technologies to create dynamic websites and web applications. Linux is the operating system, Apache is the web server software, MySQL is the database management system, and PHP is the programming language. This combination provides a powerful and flexible environment for building and deploying web applications.
What is the output of the following command? tail -n 20 test.txt A. The first 20 lines of test.txt B. The last 20 lines of test.txt omitting the blank lines C. The last 20 lines of test.txt with line numbers D. The last 20 lines of test.txt including the blank lines
D. The last 20 lines of test.txt including the blank lines ExplanationThe command "tail -n 20 test.txt" is used to display the last 20 lines of the file "test.txt". It includes both the non-blank lines and the blank lines present in the file.
What is the command that will show system boot time messages? Dmesg Lspci Display system boot Echo Messages
Dmesg
What permissions are set on a file with the command chmod 654 file.txt? A. Drw-r-xr-- B. D--wxr-x-- C. --wxr-x--x D. -rwxrw--x E. -rw-r-xr--
E. -rw-r-xr-- ExplanationThe command "chmod 654 file.txt" sets the permissions on the file.txt to -rw-r-xr--. In this permission format, the first character represents the file type (- for a regular file). The next three characters (rw-) indicate the permissions for the owner of the file, allowing them to read and write but not execute. The following three characters (r-x) represent the permissions for the group, allowing them to read and execute but not write. The last three characters (r--) represent the permissions for others, allowing them to only read the file.
When a new user is added, where does the user ID get stored? A. /etc/users B. /etc/realm C. /etc/pass D. /etc/shpasswd E. /etc/passwd
E. /etc/passwd ExplanationThe user ID of a new user is stored in the /etc/passwd file. This file is a system file that contains information about user accounts, including their usernames, user IDs, group IDs, home directories, and login shells. The /etc/passwd file is used by the system for user authentication and to determine various permissions and settings for each user.
How can the normal output of a command be written to a file while discarding the error output? A. Command>2>file &1>/dev/null B. Command /dev/null C. Command>2>discard-error>file D. Command> /dev/null 2&>1 output E. Command> file2>/dev/null
E. Command> file2>/dev/null ExplanationThe correct answer is "command> file2>/dev/null". This command redirects the normal output of the command to the file "file" while discarding the error output by redirecting it to /dev/null.
When the free command is run, what does the Mem: line reveal about the system? Choose one: System information CPU statistics RAM statistics Graphics specifications
RAM statistics
While deleting all files beginning with the letter a there was still the file Access.txt left. Assuming that it had the correct ownership, why was it not deleted? A. Files with extensions need a different treatment B. Rm had to be called with the option -R to delete all files C. The file Access.txt was probably opened by another application D. The file Access.txt was hidden E. Linux file names are case sensitive
E. Linux file names are case sensitive ExplanationThe reason the file Access.txt was not deleted is because Linux file names are case sensitive. The command used to delete the files beginning with the letter "a" would only delete files with lowercase "a" as the first letter, while "Access.txt" starts with an uppercase "A". Therefore, it was not deleted.
Which of the following commands will create an archive file, named backup.tar, containing all the files from the directory /home? A. Tar /home backup.tar B. Tar -cf /home backup.tar C. Tar -xf /home backup.tar D. Tar -xf backup.tar /home E. Tar -cf backup.tar /home
E. Tar -cf backup.tar /home ExplanationThe correct answer is "tar -cf backup.tar /home". This command uses the tar utility with the -cf options to create a new archive file named backup.tar. The /home directory is specified as the source directory from which all files will be included in the archive.
Linux users normally download and install applications from the applications' websites. Choose one: True False
False
Which command displays the list of groups to which a user belongs? Whoami Who Id Isgroup
Id
Given the following directory permissions: drwxrwxrwt 14 root 36864 2012-03-02 11:17 tmp What is the letter t at the end of drwxrwxrwt indicate? Choose one: It makes the directory accessible for everybody It is a temporary bit that prevents launching commands in this directory It indicates that this directory contains only temporary files that may be deleted It is the sticky bit that causes all commands in this directory to be launched as a root. It means that even though the directory is global writable only the owner can delete their own files
It means that even though the directory is global writable only the owner can delete their own files
What is true about the "su" command? Choose one: It runs a shell or command as another user. It locks the root account in specific time frames. It changes the name of the main administrator account. It can only be used by the user root. It is the default shell of the root account.
It runs a shell or command as another user.
Which of the following is the core computer program with complete control over everything in the system? Choose one: Command Prompt Startup Windows Kernel
Kernel
Which of the following Ubuntu releases is considered most stable and fit to use for business purposes? Ubuntu Vanilla Xubuntu Server Xubuntu LTS Kubuntu
LTS
Which network interface always exists in a Linux system? Wlan0 Vlan0 Eth0 Lo Sit0
Lo
Which command line can be used to search help files that mention the word "copy"? Man copy Copy help Man -k copy Copy -help Whatis copy
Man -k copy
What is the number called that is used to identify a process? Process Entry Proc Num PIN PID
PID
Passwords may never start with a non-letter All passwords can be decrypted using the system administrator's master password Passwords are only stored in encrypted form Passwords may be at most six characters long Users cannot change their password once it has been set
Passwords are only stored in encrypted form
What type of multitasking does Linux use? Choose one: Multi-user Single-user Preemptive Cooperative
Preemptive
If you want to enable one Linux computer to access files stored on another Linux computer's hard disk, which of the following network protocols is the best choice? a) SMTP b) NFS c) PHP d) DNS e) DHCP
b) NFS
A computer power supply converts electricity from alternating current to ________. (two words) a) direct current b) three-phase current c) magnetic current d) static current e) solar electricity
a) direct current
In order to rename the directory ~/documents/letters to ~/documents/archive, which of the following commands should be used? Choose one: rename ~/documents/letters ~/documents/archive mv ~/documents/letters ~/documents/archive cp -m ~/documents/letters ~/documents/archive copy -m ~/documents/letters ~/documents/archive
mv ~/documents/letters ~/documents/archive