Modules 1-3 Quizzes
True or false: Linux is an open-source operating system.
True. Linux is indeed an open-source operating system. It is based on the Unix operating system and is distributed under open-source licenses, meaning that its source code is freely available to the public and can be modified and redistributed by anyone.
True or false: The bash shell in Linux offers features like auto-completion and location indication.
True. The Bash shell in Linux offers features like auto-completion and location indication. Auto-completion helps users by automatically completing file names, commands, and other inputs when they press the Tab key. Location indication typically refers to the prompt displaying information about the current directory or other contextual information, helping users understand their current location in the filesystem.
True or false: The "less" command in Linux allows you to navigate forwards and backwards through a file.
True. The less command in Linux allows you to navigate both forwards and backwards through a file. It is a terminal pager program used to view the contents of a file one screen at a time, with the ability to scroll up and down, making it more flexible than the more command.
Which Linux distribution is widely recognized as a preferred choice for cybersecurity professionals, particularly for ethical hackers? a) Kali Linux b) Ubuntu c) RHEL d) Fedora
a) Kali Linux Kali Linux is widely recognized as a preferred choice for cybersecurity professionals, particularly for ethical hackers. It is specifically designed for penetration testing and security auditing, and it comes pre-installed with numerous tools used for these purposes.
Which of the following commands displays the contents of a file? a) cat b) display c) touch d) man
a) cat The cat command is used to concatenate and display the contents of a file in Linux.
Which commands are used for output filtering in Linux? a) head b) touch c) tail d) mkdir
a) head c) tail Commands like head and tail are used for output filtering in Linux. head: Displays the first few lines of a file or input. tail: Displays the last few lines of a file or input. touch and mkdir are used for creating files and directories, respectively, not for output filtering.
Which command creates an empty file if it does not exist? a) touch b) echo c) mkdir d) cat
a) touch The touch command in Linux is used to create an empty file if it does not exist. If the file already exists, it updates the timestamp of the file.
Which of the following is NOT a key feature of Linux? a) Based on UNIX b) Limited to desktop use c) Highly customizable d) Open-source
b) Limited to desktop use Linux is not limited to desktop use. It is widely used across various types of systems, including servers, supercomputers, embedded systems, and more. The other options—being based on UNIX, being highly customizable, and being open-source—are all key features of Linux.
Which of the following commands lists all the files in a directory? a) whoami b) ls c) pwd d) uname
b) ls The ls command in Linux is used to list all the files and directories in the current directory.
Which of the following commands is used for file manipulation in Linux? a) ls b) mv c) whoami d) cp
b) mv d) cp The mv and cp commands are used for file manipulation in Linux. They are primarily used to move files or directories from one location to another. ls is used to list directory contents. whoami is used to display the current user's username.
Which command in Linux is used for real time system performance monitoring? a) awk b) top c) grep d) whoami
b) top The top command in Linux is used for real-time system performance monitoring. It provides a dynamic view of the system's processes, showing information such as CPU usage, memory usage, and process details. This allows users to see how the system's resources are being utilized and which processes are consuming the most resources. awk is a text processing and pattern scanning and processing language. grep is used for searching text using patterns. whoami is used to display the current user's username.
Which data stream in Linux is a special type of output that indicates an error? a) STDBUF b) STDIN c) STDERR d) STDOUT
c) STDERR In Linux and other Unix-like operating systems, there are three standard data streams commonly used in command-line environments: STDIN (Standard Input) - Used for input data, typically coming from the keyboard or a file. STDOUT (Standard Output) - Used for normal output data, typically displayed on the screen. STDERR (Standard Error) - Used for outputting error messages, also typically displayed on the screen. STDERR is specifically used for indicating errors. This separation allows users and programs to distinguish between regular output and error messages, making it easier to handle and redirect them independently.
Which user has the highest permissions in the system? a) NT Authority b) kali c) root d) user
c) root The root user, also known as the superuser or administrator, has the highest permissions in the system. This user has full control over all aspects of the system, including system files, processes, and configurations.
Which operator can be used to run a binary in the background? a) ; b) @ c) | d) &
d) & The & operator in Linux is used to run a command (including binaries) in the background. This allows the user to continue using the terminal while the command executes asynchronously.
Which folder contains all directories for all users except the root user? a) /root b) /users c) /boot d) /home
d) /home The /home directory in Linux typically contains home directories for all users except the root user. Each user has their own subdirectory within /home, where they can store their personal files and configurations.
You found a sensitive file that seems to contain passwords. When you try to read the file, you notice that there is too much data to read. How can you search for passwords in the file? a) Use the "echo" command and the > operator b) Use the "find" command to locate the data in the file c) Use the "search" command to search for a specific word d) Filter with "grep"
d) Filter with "grep" The grep command is commonly used to search for specific patterns or text within files. In this case, you can use grep to search for passwords within the file. For example: bash grep "password" filename This command will search for the word "password" in the file named filename and display the lines containing that word. You can adjust the pattern according to what you're looking for.
Who is credited with the creation of Linux? a) Steve Jobs b) Richard Stallman c) Bill Gates d) Linus Torvald
d) Linus Torvald Linus Torvalds is credited with the creation of the Linux kernel. He began the development of Linux in 1991 while he was a student at the University of Helsinki in Finland.
Which Linux operator only executes the following command if the previous command fails? a) And && b) Background & c) Chain ; d) Or ||
d) Or || In Linux, the || operator executes the following command only if the previous command fails (returns a non-zero exit status). This is useful for handling errors or providing fallback commands. And && executes the following command only if the previous command succeeds (returns a zero exit status). Background & runs the command in the background. Chain ; executes the following command regardless of whether the previous command succeeds or fails.
Which command is commonly used to display text in the terminal and can also be used for file writing through output redirection? a) cat b) grep c) awk d) echo
d) echo The echo command is commonly used to display text in the terminal. It can also be used for file writing through output redirection. For example, the command echo "Hello, World!" > file.txt will write "Hello, World!" to file.txt. cat is used to concatenate and display the content of files, and it can be used to write to files with redirection but is primarily known for displaying file contents. grep is used for searching text using patterns. awk is a text processing and pattern scanning language.
Jacob found a text file that contains content. He wants to overwrite the data in the file and replace it with something else. Which of the following commands can do that? a) echo "Hello!" -f file.txt b) echo "Hello!" >> file.txt c) rm file.txt d) echo "Hello!" > file.txt
d) echo "Hello!" > file.txt This command will overwrite the contents of the file named file.txt with the text "Hello!". Explanation of the options: a) echo "Hello!" -f file.txt: The -f option is not valid for the echo command. The correct syntax to write to a file is echo "Hello!" > file.txt. b) echo "Hello!" >> file.txt: This command appends the text "Hello!" to the end of the file, rather than overwriting it. c) rm file.txt: This command removes (deletes) the file named file.txt, it does not write to it.