1.
Ls
Correct Answer
C. Directory listing
Explanation
The answer "directory listing" is correct because the command "ls" is used to display the contents of a directory. It provides a list of files and directories within the current directory.
2.
Ls -al
Correct Answer
C. Formatted listing with hidden files
Explanation
The command "ls -al" is used to display a formatted listing of all files and directories in the current directory, including hidden files. The "-a" flag is used to show all files, including hidden files, and the "-l" flag is used to display the files in a long format, providing additional information such as permissions, owner, size, and modification date. Therefore, the correct answer is "formatted listing with hidden files".
3.
Pwd
Correct Answer
B. Show current directory
Explanation
The command "pwd" stands for "print working directory" and is used to display the current directory that the user is in. It does not create or update files, nor does it delete files. Its sole purpose is to provide information about the current directory.
4.
Cd dir
Correct Answer
A. Change directory to dir
Explanation
The command "cd dir" is used to change the current directory to the directory named "dir". It does not refer to renaming a file or creating a new directory.
5.
Cd
Correct Answer
B. Change to home
Explanation
The command "cd" is used to change the current directory in a command line interface. In this case, the correct answer suggests that the command "cd" should be used to change the current directory to the "home" directory. This means that the user wants to navigate to the "home" directory from their current location.
6.
Mkdir dir
Correct Answer
B. Create directory dir
Explanation
The correct answer is "create directory dir" because the command "mkdir dir" is used to create a new directory named "dir". The other options do not accurately describe the action of creating a directory.
7.
Rm file
Correct Answer
A. Delete file
Explanation
The correct answer is "delete file" because the command "rm" is used to remove or delete a file in Unix-based operating systems. It is a commonly used command to permanently delete a file from the system.
8.
Rm -r dir
Correct Answer
C. Delete directory dir
Explanation
The given command "rm -r dir" is used to delete a directory named "dir". The "-r" option is used to recursively delete all the files and subdirectories within the specified directory. Therefore, the correct answer is "delete directory dir".
9.
Rm -f file
Correct Answer
A. Force remove file
Explanation
The command "rm -f file" is used to forcefully remove a file. The "-f" flag stands for "force" and it allows the deletion of the file without prompting for confirmation. Therefore, the correct answer is "force remove file".
10.
cp file1 file2
Correct Answer
A. Copy file1 to file 2
Explanation
The given command "cp file1 file2" is used to copy the contents of "file1" and paste them into "file2". It does not move or delete any files. Therefore, the correct answer is "copy file1 to file2".
11.
cp -r dir1 dir2
Correct Answer
C. Copy dir1 to dir 2, create dir 2 if it doesn't exist
Explanation
The given command "cp -r dir1 dir2" is used to copy the contents of "dir1" to "dir2". The "-r" option is used to copy directories recursively, meaning it will copy all the files and subdirectories within "dir1" to "dir2". If "dir2" does not exist, it will be created during the copying process.
12.
mv file1 file2
Correct Answer
A. Rename or move file 1 to file 2
Explanation
The command "mv file1 file2" is used to rename or move "file1" to "file2". It does not delete any files or copy "file1" to "file2".
13.
Touch
Correct Answer
C. Create or update file
Explanation
The correct answer is "create or update file" because the action of "touch" in computing refers to creating a new file or updating the timestamp of an existing file. It does not involve deleting or moving a file.
14.
more file
Correct Answer
C. Show contents of files
Explanation
The correct answer is "show contents of files" because the question is asking for a command that will display the contents of files. The other options, "show top 10 lines" and "show bottom 10 lines," suggest commands that would only display a portion of the file, rather than the entire contents.
15.
head file
Correct Answer
B. Show top 10 lines
Explanation
The command "head file" is used to display the top 10 lines of a file. It is a command-line tool commonly used in Unix-like operating systems to view the beginning portion of a file. By default, it displays the first 10 lines of the specified file. This command is helpful when you want to quickly preview the contents of a file without having to open the entire file.
16.
tail file
Correct Answer
B. Show bottom 10 lines
Explanation
The correct answer is "show bottom 10 lines" because the command "tail" is used to display the last few lines of a file, and the instruction specifically asks for the bottom 10 lines.
17.
ps
Correct Answer
C. Display currenty active processes
Explanation
The correct answer is "display currenty active processes" because the question asks for a command that will show the currently active processes. The other options, "display date and time" and "show months calendar," do not fulfill this requirement.
18.
Top
Correct Answer
A. Displays all running processes
Explanation
The correct answer is "display all running processes." This option suggests that the command or action will show a list of all the processes that are currently running on a system. This can be useful for monitoring system activity, identifying resource usage, and troubleshooting any issues related to specific processes. It allows users to get an overview of the processes that are running at a given time.
19.
Which command is used to list all files and directories in the current directory in Linux?
Correct Answer
C. Ls
Explanation
pwd: This command stands for "print working directory" and is used to display the current directory path.
cd: This command stands for "change directory" and is used to change the current directory to a specified one.
ls: This command stands for "list" and is used to list all files and directories in the current directory.
rm: This command stands for "remove" and is used to delete files or directories.
The correct command to list all files and directories in the current directory is ls.
20.
kill all proc
Correct Answer
C. Kill all processes named proc
Explanation
The correct answer is "kill all processes named proc" because it accurately describes the action of terminating all running processes that have the name "proc". The other options either do not specify the name of the processes to be killed or do not mention killing all processes.
21.
date
Correct Answer
C. Show date and time
Explanation
The correct answer is "show date and time" because it is the option that includes both the date and the time. The other options only include either the month calendar or just the date. Therefore, "show date and time" is the most comprehensive choice that displays both the current date and time.
22.
cal
Correct Answer
B. Show months calendar
Explanation
The correct answer is "show months calendar" because the word "cal" is a common abbreviation for "calendar." Therefore, when the user inputs "cal," the expected action would be to display the months calendar.
23.
uptime
Correct Answer
B. Show current uptime
Explanation
The correct answer is "show current uptime" because the command "uptime" is used to display the current uptime of a system. It provides information about how long the system has been running since it was last booted up or restarted. By using this command, users can quickly check the duration of the system's uptime without having to go through other commands or menus.
24.
W
Correct Answer
A. Who is online
Explanation
The basic Linux command w is used to show who is online. It displays information about the users currently on the machine, along with their activities, including the login time, idle time, and the command they are currently executing.
25.
whoami
Correct Answer
C. Who are you logged in as
Explanation
The given answer "who are you logged in as" is a possible response to the question "whoami". It is asking for the username or identity of the current user who is logged into the system.
26.
finger user
Correct Answer
B. Display information about user
Explanation
The command "finger user" is used to display information about a specific user. It provides details such as the user's login name, full name, login time, idle time, and terminal location. By executing this command, you can retrieve specific information about the user you are interested in.
27.
uname -a
Correct Answer
B. Show kernal information
Explanation
The correct answer is "show kernel information." The command "uname -a" is used to display detailed information about the kernel of the operating system, including the version, release, and other relevant information.
28.
man command
Correct Answer
A. Show manual for command
Explanation
The correct answer is "show manual for command". The "man" command is used in Unix and Unix-like operating systems to display the manual pages for a specific command. By typing "man command" in the terminal, the user can access detailed information about the usage, options, and examples of the specified command. This helps users understand how to use the command effectively and troubleshoot any issues they may encounter.
29.
df
Correct Answer
A. Disk usage
Explanation
The correct answer is "disk usage." This command is used to display the amount of disk space used by files and directories on a file system. It provides information about the total disk space, the amount of space used, and the amount of free space available. By using this command, users can easily identify which directories or files are taking up the most space on their disk and take appropriate actions to manage their storage efficiently.
30.
Which of the following commands is used to display the current directory in Linux?
Correct Answer
C. Pwd
Explanation
ls: Lists directory contents.
cd: Changes the current directory.
pwd: Prints the current working directory.
mkdir: Creates a new directory.
31.
free
Correct Answer
C. Show memory or swap usage
Explanation
The correct answer is "show memory or swap usage" because the question is asking for a command that displays information about memory or swap usage. The other options mentioned, such as "show directory space usage" and "disk usage," are not relevant to the question as they pertain to different aspects of system monitoring.
32.
whereis app
Correct Answer
C. Show possible locations of app
Explanation
The correct answer is "show possible locations of app". This option suggests that it will display the various locations where the app can be found or accessed. It implies that the user wants to know the possible locations of the app, which could be helpful if they are unable to locate it or want to ensure that it is installed in the correct place.
33.
Which of the following describes the function of setting an application as the default for certain actions in an operating system?
Correct Answer
C. Show which app will be run by default
Explanation
Setting an application as the default means specifying which application automatically opens when performing a certain type of action, such as opening a web page or viewing a photo. This setting tells the operating system to always use the selected application to open all files of a particular type unless specified otherwise. The correct option, "Show which app will be run by default," directly addresses the function of default applications in managing file associations and ensuring a seamless user experience by automatically using the preferred app.
34.
tar cf file.tar files
Correct Answer
B. Create a tar named file.tar containing files
Explanation
The given command "tar cf file.tar files" creates a tar file named "file.tar" and includes the files specified in the command. The "c" option is used to create a new archive, and the "f" option is used to specify the name of the archive file. The "files" parameter represents the files that will be included in the tar file. Therefore, the command creates a tar file named "file.tar" containing the specified files.
35.
tar xf file.tar
Correct Answer
B. Extract the files
Explanation
The command "tar xf file.tar" is used to extract the files from a tar file named "file.tar". It does not create a tar file or specify any specific files to be included in the extraction.
36.
ping host
Correct Answer
A. Ping host and output results
Explanation
The correct answer is "ping host and output results" because the command "ping" is used to check the connectivity between a source and a destination host. By specifying "host" after the ping command, it indicates that the user wants to test the connectivity with a specific host. Additionally, the phrase "and output results" suggests that the command should display the results of the ping test, allowing the user to see if there is a successful connection or any potential issues.