Linux Command Line 1

Approved & Edited by ProProfs Editorial Team
The editorial team at ProProfs Quizzes consists of a select group of subject experts, trivia writers, and quiz masters who have authored over 10,000 quizzes taken by more than 100 million users. This team includes our in-house seasoned quiz moderators and subject matter experts. Our editorial experts, spread across the world, are rigorously trained using our comprehensive guidelines to ensure that you receive the highest quality quizzes.
Learn about Our Editorial Process
| By Tpotter
T
Tpotter
Community Contributor
Quizzes Created: 2 | Total Attempts: 4,337
Questions: 25 | Attempts: 3,807

SettingsSettingsSettings
Linux Command Line 1 - Quiz

Basic Linux commands.


Questions and Answers
  • 1. 

    What command shows you what directory you are in?

    Explanation
    The "pwd" command stands for "print working directory". When you run this command in a terminal or command prompt, it displays the full path of the current directory you are in. It is a useful command to quickly check your current location in the file system hierarchy.

    Rate this question:

  • 2. 

    What command(s) shows you disk partitions and percentage of disk space used?

    Explanation
    The command that shows disk partitions and the percentage of disk space used is "df -h". This command displays information about the file system, including the total size, used space, available space, and the percentage of disk space used for each partition. The "-h" flag is used to display the sizes in a more human-readable format.

    Rate this question:

  • 3. 

    What command shows you memory utilization?

    Explanation
    The command "free" shows the memory utilization by displaying the total amount of free and used memory in the system, as well as the amount of memory used by buffers and cached data. On the other hand, the command "top" provides real-time information about various system resources, including memory utilization. It displays the total memory, used memory, free memory, and memory usage by individual processes, allowing users to monitor the memory usage and identify any potential issues or bottlenecks.

    Rate this question:

  • 4. 

    What command shows you how long it has been since the server was rebooted?

    Explanation
    The correct answer is "uptime, w". The uptime command is used to display the time since the server was last rebooted. It provides information about the current time, how long the system has been running, the number of users currently logged in, and the system load averages for the past 1, 5, and 15 minutes. The "w" command is also used to display the uptime of the system along with other information like the current time, number of users logged in, and their activities.

    Rate this question:

  • 5. 

    What command creates an empty directory?

    Explanation
    The "mkdir" command is used to create a new directory or folder in a file system. By executing this command, an empty directory is created with the specified name. This allows the user to organize and store files and other directories within the newly created directory.

    Rate this question:

  • 6. 

    What command clears the contents of your terminal display?

    Explanation
    The command "clear" is used to clear the contents of the terminal display. It removes all the text and commands that have been entered, providing a clean and empty screen. This command is commonly used to declutter the terminal and start with a fresh workspace.

    Rate this question:

  • 7. 

    What command is used to change the permissions of a file?

    Explanation
    The command "chmod" is used to change the permissions of a file. It allows the user to modify the permissions for the owner, group, and others, granting or revoking the ability to read, write, or execute the file. By using the "chmod" command, the user can control the level of access and security for a specific file.

    Rate this question:

  • 8. 

    What command is used to change ownership of a file?

    Explanation
    The command "chown" is used to change the ownership of a file. By using this command, the user can transfer the ownership of a file to another user or group. This command is commonly used in Unix-like operating systems to manage file permissions and access control.

    Rate this question:

  • 9. 

    What command allows you to view a file one page at a time?

    Explanation
    The "less" and "more" commands both allow you to view a file one page at a time. These commands are commonly used in Unix-like operating systems to display the contents of a file in a scrollable manner. The "less" command is more advanced and provides additional features such as backward scrolling and searching within the file. On the other hand, the "more" command is simpler and only allows forward scrolling through the file. Both commands are useful for viewing large files without overwhelming the screen with too much information at once.

    Rate this question:

  • 10. 

    What is the default directory path for system log files?

    Explanation
    The default directory path for system log files is /var/log or /var/log/. This is the standard location where log files are stored in many Unix-like operating systems. The /var/log directory is commonly used to store various system logs, including logs for the kernel, system daemons, and application programs. The trailing slash (/) in /var/log/ indicates that it is a directory path.

    Rate this question:

  • 11. 

    What is the command to change your password?

    Explanation
    The command "passwd" is used to change the password.

    Rate this question:

  • 12. 

    What command is used to copy a file?

    Explanation
    The command "cp" is used to copy a file. This command is short for "copy" and is commonly used in Unix-like operating systems to create a duplicate of a file. By using the "cp" command, users can easily make copies of files, either in the same directory or in a different directory. This command is followed by the name of the file to be copied and the destination where the copy should be placed.

    Rate this question:

  • 13. 

    What command is used to change a file name?

    Explanation
    The "mv" command is used to move or rename files and directories in Unix-like operating systems. It can be used to change the name of a file by specifying the current name and the desired new name. The "rename" command is another option that can be used to rename files in certain operating systems. Both commands allow for easy file renaming without the need for complex procedures or manual changes.

    Rate this question:

  • 14. 

    What command is used to get the ip address of all interfaces on a server?

    Explanation
    The command "ifconfig" is used to get the IP address of all interfaces on a server. It is a commonly used command in Unix-like operating systems to configure network interfaces and display their current settings. By running the "ifconfig" command, the user can obtain information about the IP addresses assigned to each network interface on the server, including the loopback interface and any Ethernet or wireless interfaces.

    Rate this question:

  • 15. 

    What command will tell you the location and path to a command?

    Explanation
    The "which" and "whereis" commands are used to determine the location and path to a command in a Unix-like operating system. The "which" command displays the path of the executable file associated with a given command, while the "whereis" command provides information about the binary, source, and manual page files for a command. Both commands are useful for locating the exact location of a command in the system's directory structure.

    Rate this question:

  • 16. 

    What command is used to change directories?

    Explanation
    The command "cd" is used to change directories in a command-line interface. It allows the user to navigate through the file system by moving from one directory to another. By typing "cd" followed by the desired directory name, the user can switch to that directory and access its contents. This command is commonly used in operating systems like Unix, Linux, and Windows.

    Rate this question:

  • 17. 

    What do you type in to move to the parent directory

    Explanation
    To move to the parent directory, you can type "cd .." or "cd ../". The ".." represents the parent directory, so using this command will navigate you up one level in the directory structure. Similarly, "cd ../" can also be used to move to the parent directory. The "." represents the current directory, so using this command will move you up one level in the directory structure as well.

    Rate this question:

  • 18. 

    What command is used to display your previous commands?

    Explanation
    The command "history" is used to display a list of previous commands that have been entered in the terminal. It provides a convenient way to view and access past commands, allowing users to easily repeat or modify them as needed. This command is particularly useful for recalling and reusing complex or frequently used commands, saving time and effort in the command-line interface.

    Rate this question:

  • 19. 

    What command and parameter (or switch) will force a program to quit?

    Explanation
    The given answer suggests that the command "kill -9" along with the parameters "pkill" and "pkill -f" can be used to force a program to quit. "kill -9" is a command used to send a signal to terminate a process forcefully. "pkill" is a command used to send a signal to terminate a process based on its name, and "pkill -f" is a command used to send a signal to terminate a process based on its full command line. These commands and parameters provide options to forcefully quit a program when necessary.

    Rate this question:

  • 20. 

    What command is used to verify network connectivity between two systems?

    Explanation
    Ping, mtr, and traceroute are all commands used to verify network connectivity between two systems. The ping command sends a small packet to the destination system and waits for a response, indicating whether the system is reachable. Mtr (My traceroute) combines the functionality of ping and traceroute, continuously sending packets to the destination and providing detailed information about the network path. Traceroute is used to trace the route taken by packets from the source to the destination, showing each hop along the way. These commands help in diagnosing network issues and determining if two systems can communicate with each other.

    Rate this question:

  • 21. 

    What is the command to delete a file?

    Explanation
    The command "rm" is used to delete a file in Unix-based operating systems. By simply typing "rm" followed by the file name, the file will be permanently deleted. The option "-f" can be added to force the deletion of a file without prompting for confirmation. Therefore, both "rm" and "rm -f" are correct commands to delete a file.

    Rate this question:

  • 22. 

    What is the command to run a program with elevated permissions?

    Explanation
    The command "sudo" is used to run a program with elevated permissions. "sudo" stands for "superuser do" and allows a user with administrative privileges to execute commands as the root user or another specified user. By using "sudo" before a command, the user can bypass normal permission restrictions and perform actions that require elevated privileges. This command is commonly used in Unix-like operating systems, including Linux, to carry out administrative tasks or run programs that require root access.

    Rate this question:

  • 23. 

    What is the command to switch to the root user account?

    Explanation
    The command "su" is used to switch to the root user account. Additionally, "sudo su root" and "sudo su" can also be used to switch to the root user account. "sudo su root" specifically switches to the root user account with the "root" username, while "sudo su" switches to the root user account without specifying a username.

    Rate this question:

  • 24. 

    Which command(s) show users that are logged in?

    • A.

      Users

    • B.

      Userhelper

    • C.

      Who

    • D.

      Logger

    • E.

      W

    Correct Answer(s)
    A. Users
    C. Who
    E. W
    Explanation
    The commands "users", "who", and "w" can be used to display the users that are currently logged in. The "users" command shows a list of users currently logged in, "who" command displays information about currently logged in users including their username, terminal, and login time, and the "w" command provides detailed information about the currently logged in users including their username, terminal, login time, idle time, and current process.

    Rate this question:

  • 25. 

    What command displays your current username?

    Correct Answer(s)
    whoami, id
    Explanation
    The "whoami" and "id" commands both display the current username. The "whoami" command specifically shows the effective username of the current user, while the "id" command provides more detailed information about the user, including the user ID and group ID. Both commands can be used to quickly determine the username associated with the current session.

    Rate this question:

Quiz Review Timeline +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Mar 21, 2023
    Quiz Edited by
    ProProfs Editorial Team
  • May 04, 2009
    Quiz Created by
    Tpotter
Back to Top Back to top
Advertisement
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.