Hbwsl - Linux Basic Commands

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 Gauravjoshi
G
Gauravjoshi
Community Contributor
Quizzes Created: 1 | Total Attempts: 602
Questions: 65 | Attempts: 602

SettingsSettingsSettings
Hbwsl - Linux Basic Commands - Quiz

Basic Linux commands.


Questions and Answers
  • 1. 

    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. On the other hand, the command "top" provides a dynamic real-time view of the system, including information about memory usage, CPU usage, and other system statistics. Both commands can be used to monitor memory utilization, but "free" specifically focuses on memory while "top" provides a broader overview of system performance.

    Rate this question:

  • 2. 

    What command clears the contents of your terminal display?

    Explanation
    The correct answer is "clear". This command is used to clear the contents of the terminal display, removing all previous commands and output from the screen. The "reset" command, on the other hand, resets the terminal to its default settings, but does not clear the display.

    Rate this question:

  • 3. 

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

    Explanation
    The command "chmod" is used to change the permissions of a file. This command allows the user to modify the permissions for the owner, group, and others on the file. By using different options and parameters with the "chmod" command, the user can grant or revoke read, write, and execute permissions for the file. This command is commonly used in Unix-like operating systems to manage file permissions and ensure the security and accessibility of files.

    Rate this question:

  • 4. 

    What command is used to change ownership of a file?

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

    Rate this question:

  • 5. 

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

    Explanation
    The correct answer is "less". The "less" command allows you to view a file one page at a time. It is a pager program that displays text files or the output of other commands on the terminal. It allows you to scroll through the file using the arrow keys or specific commands, making it easier to navigate through large files without overwhelming the screen with too much information at once. The "more" command is similar but has fewer features compared to "less".

    Rate this question:

  • 6. 

    What is the default directory path for system log files?

    Explanation
    The default directory path for system log files is typically "/var/log" or "/var/log/". This is where various log files are stored on a Unix-like operating system. The logs contain important information about system events, errors, and activities, which can be useful for troubleshooting and monitoring the system's performance. The "/var/log" directory is commonly used by many Linux distributions and Unix-based systems to organize and store log files.

    Rate this question:

  • 7. 

    What command is used to copy a file?

    Explanation
    The command "cp" is used to copy a file. This command allows the user to make a duplicate copy of a file or directory. By using the "cp" command followed by the source file and destination file, the file is copied from the source location to the specified destination.

    Rate this question:

  • 8. 

    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 different directories or folders on the computer's file system. 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 Command Prompt.

    Rate this question:

  • 9. 

    What do you type in to move to the parent directory

    Explanation
    The correct answer is "cd ..". This command is used to move to the parent directory in the command line interface. The ".." represents the directory immediately above the current directory. Another option, "cd ../", is also correct as it achieves the same result. However, the second option provided, "cd ../", is incorrect as it includes an extra forward slash ("/") which is not necessary.

    Rate this question:

  • 10. 

    What is the command to delete a file?

    Explanation
    The command "rm" is used to delete a file in a Unix/Linux system. It stands for "remove" and is a basic command for deleting files. The command "rm -f" is a more forceful version of the "rm" command, where the "-f" flag is used to forcefully remove the file without prompting for confirmation. Both commands can be used to delete files, but "rm -f" is more commonly used when you want to delete files without any confirmation prompts.

    Rate this question:

  • 11. 

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

    Explanation
    The command "sudo" is used to run a program with elevated permissions. It allows a user to execute a command as a superuser or another user, granting them temporary administrative privileges. This is commonly used in Unix-based operating systems to perform tasks that require higher privileges, such as installing software or making system changes.

    Rate this question:

  • 12. 

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

    Explanation
    The correct answer is "su". This command is used to switch to the root user account in Unix-like operating systems. "sudo su root" is also a valid command to switch to the root user account using the sudo command. "sudo su" alone can also be used to switch to the root user account, but it is not recommended as it can potentially cause security risks.

    Rate this question:

  • 13. 

    If you want to protect files from deletion, you have to

    • A.

      Change the file write permission

    • B.

      Change the file read permission

    • C.

      Change the file's directory write permission

    • D.

      Change the file's directory read permission

    Correct Answer
    C. Change the file's directory write permission
    Explanation
    To protect files from deletion, you need to change the file's directory write permission. By modifying the directory write permission, you can prevent users from deleting or modifying files within that directory. This means that even if someone has write permission for the file itself, they won't be able to delete it if they don't have write permission for the directory containing it.

    Rate this question:

  • 14. 

    If you want to protect files from content modifications, you have to

    • A.

      Change the file write permission

    • B.

      Change the file read permission

    • C.

      Change the file's directory write permission

    • D.

      Change the file's directory read permission

    Correct Answer
    A. Change the file write permission
    Explanation
    To protect files from content modifications, you need to change the file write permission. By changing the write permission, you can restrict users from making any changes to the file, ensuring its integrity and preventing unauthorized modifications. This allows you to maintain the original content and prevent any accidental or intentional alterations to the file. Changing the file read permission or the directory permissions would not directly address the issue of content modifications.

    Rate this question:

  • 15. 

    If you want to restrict users from directory content listing, you have to

    • A.

      Change the file write permission

    • B.

      Change the file read permission

    • C.

      Change the directory write permission

    • D.

      Change the directory read permission

    Correct Answer
    D. Change the directory read permission
    Explanation
    To restrict users from directory content listing, you need to change the directory read permission. By changing the directory read permission, you can prevent users from viewing the contents of the directory, including any files or subdirectories within it. This ensures that the directory's content remains private and inaccessible to unauthorized users.

    Rate this question:

  • 16. 

    Chmod 644 finance.doc644 equals to

    • A.

      Rwx r-x r-x

    • B.

      Rw- r-x r-x

    • C.

      R-- r-- ---

    • D.

      Rw- r-- r--

    • E.

      Rw- rw- rw-

    Correct Answer
    D. Rw- r-- r--
    Explanation
    The given answer, "rw- r-- r--", represents the permission settings for the file "finance.doc" when using the chmod command with the argument "644". In this case, "rw-" indicates that the owner of the file has read and write permissions, while "r--" indicates that the group and other users only have read permissions. This means that the owner can read and modify the file, while the group and other users can only read the file.

    Rate this question:

  • 17. 

    The difference between "x" permission in file and directory, is

    • A.

      Both means execute permission in directory and file

    • B.

      Execute permission in directory, enter permission in file

    • C.

      Enter permission in directory, execute permission in file

    • D.

      Execute permission in file, not applicable in directory

    Correct Answer
    C. Enter permission in directory, execute permission in file
    Explanation
    The correct answer is enter permission in directory, execute permission in file. In Unix-like operating systems, the "x" permission for a directory allows a user to enter (i.e., access) the directory, while the "x" permission for a file allows a user to execute (i.e., run) the file as a program. So, the difference between the "x" permission in a file and a directory is that it grants enter permission in a directory and execute permission in a file.

    Rate this question:

  • 18. 

    The command to restrict user not to delete finance.doc within directory /home/budi

    • A.

      Chmod +w finance.doc

    • B.

      Chmod -w finance.doc

    • C.

      Chmod +w /home/budi

    • D.

      Chmod -w /home/budi

    Correct Answer
    D. Chmod -w /home/budi
    Explanation
    The correct answer is "chmod -w /home/budi". This command removes the write permission for the directory "/home/budi", which means that users will not be able to delete the file "finance.doc" within that directory. The other options either only modify the permissions of the file "finance.doc" or change the permissions of the entire directory without specifically targeting the file.

    Rate this question:

  • 19. 

    You're now in directory X1 (see below). Moving to directory X3 using command:X1 <--- You're here |__     X2      |__          X3

    • A.

      Cd X3/

    • B.

      Cd /X3

    • C.

      Cd /X2/X3

    • D.

      Cd X2/X3/

    Correct Answer
    D. Cd X2/X3/
    Explanation
    The correct answer is "cd X2/X3/" because it correctly navigates to directory X3, which is located inside directory X2. The command "cd X2/X3/" specifies the path to directory X3 relative to the current directory X1.

    Rate this question:

  • 20. 

    One single command to completely remove directory X1 and all it's contents (see below)X1 |__     X2      |__          X3

    • A.

      Rm X1

    • B.

      Rmdir X1

    • C.

      Rm -f X1

    • D.

      Rm -rf X1

    Correct Answer
    D. Rm -rf X1
    Explanation
    The correct answer is "rm -rf X1" because the "rm" command is used to remove files and directories, and the "-rf" options are used to forcefully remove directories and their contents recursively. This means that the command will remove directory X1 and all its contents, including directory X2 and file X3.

    Rate this question:

  • 21. 

    You're now in directory X3 (see below). Moving to directory X1 using command:X1  |__     X2      |__          X3 <--- You're here

    • A.

      Cd .

    • B.

      Cd ..

    • C.

      Cd ../..

    • D.

      Cd ../../..

    Correct Answer
    C. Cd ../..
    Explanation
    The command "cd ../.." is used to move up two levels in the directory structure. The ".." represents the parent directory, so using it twice moves up two levels. In this case, it will take you from directory X3 to the root directory.

    Rate this question:

  • 22. 

    One single command to create new directory X3 inside new directory X2 inside new directory X1 (see below)X1 |__     X2      |__          X3

    • A.

      Mkdir X1 X2 X3

    • B.

      Mkdir X1/X2/X3

    • C.

      Mkdir X1 X1/X2 X1/X2/X3

    • D.

      Mkdir X3 X3/X2 X3/X2/X1

    Correct Answer
    C. Mkdir X1 X1/X2 X1/X2/X3
    Explanation
    The correct answer is "mkdir X1 X1/X2 X1/X2/X3" because this command creates a new directory called X1, then creates a new directory called X2 inside X1, and finally creates a new directory called X3 inside X2. This sequence of commands follows the given directory structure.

    Rate this question:

  • 23. 

    The symbol represents home directory is?

    • A.

      ~

    • B.

      .

    • C.

      ..

    • D.

      -

    Correct Answer
    A. ~
    Explanation
    The symbol "~" is commonly used to represent the home directory in various operating systems, including Unix and Unix-like systems. The home directory is the default directory for a user when they log in, and it typically contains their personal files and settings. Using "~" as a shortcut allows users to quickly navigate to their home directory without having to specify the full path.

    Rate this question:

  • 24. 

    The symbol represents current directory is?

    • A.

      ~

    • B.

      .

    • C.

      ..

    • D.

      -

    Correct Answer
    B. .
    Explanation
    The symbol "." represents the current directory in a file system. It is commonly used in command line interfaces to refer to the current working directory. This symbol allows users to navigate and access files and directories within the current directory without having to specify the full path.

    Rate this question:

  • 25. 

    __________ command used to create an empty file.

    • A.

      Mtfile

    • B.

      Touch

    • C.

      File

    • D.

      Intouch

    • E.

      Create

    Correct Answer
    B. Touch
    Explanation
    The touch command is used to create an empty file.

    Rate this question:

  • 26. 

    You want to change the permissions on the file named “fifteen” so that owner has all permissions while all other users don't have any permissions. Which command should you use?

    • A.

      Chmod fifteen 700

    • B.

      Chmod 100 fifteen

    • C.

      Chmod 700 fifteen

    • D.

      Chmod fifteen 100

    • E.

      Chmod 770 fifteen

    Correct Answer
    C. Chmod 700 fifteen
    Explanation
    The correct answer is "chmod 700 fifteen". This command will change the permissions of the file named "fifteen" so that the owner has all permissions (read, write, and execute), while all other users (group and others) don't have any permissions. The number "700" represents the permission settings, where the first digit (7) represents the owner's permissions, the second digit (0) represents the group's permissions, and the third digit (0) represents the permissions for others.

    Rate this question:

  • 27. 

    How would you show a list of files and directories that are inside the current directory?

    • A.

      List

    • B.

      Ls

    • C.

      Dir

    • D.

      Listfiles

    • E.

      Listout

    Correct Answer
    B. Ls
    Explanation
    The correct answer for this question is "ls". In Unix-based systems, the "ls" command is used to list the files and directories that are inside the current directory. It provides a simple and concise way to view the contents of the current directory without displaying any additional information. This command is widely used by users to navigate and explore the file system.

    Rate this question:

  • 28. 

    Which command to use for complete details of a command on the shell?

    • A.

      Help

    • B.

      ?

    • C.

      Man

    • D.

      Hlp

    • E.

      Info

    Correct Answer
    C. Man
    Explanation
    The correct answer is "man". The "man" command is used to display the manual page for a given command on the shell. It provides detailed information about the command, including its syntax, options, and examples. By using the "man" command, users can access comprehensive documentation and get a complete understanding of how a specific command works.

    Rate this question:

  • 29. 

    tail file

    • A.

      Show top 10 lines

    • B.

      Show bottom 10 lines

    • C.

      Show contents of files

    Correct Answer
    B. Show bottom 10 lines
    Explanation
    The correct answer is "show bottom 10 lines" because the command "tail file" is used to display the last few lines of a file. By default, it displays the last 10 lines of the file. Therefore, the command "tail file" is equivalent to "show bottom 10 lines".

    Rate this question:

  • 30. 

    head file

    • A.

      Show contents of files

    • B.

      Show top 10 lines

    • C.

      Show bottom 10 lines

    Correct Answer
    B. Show top 10 lines
    Explanation
    The correct answer is "show top 10 lines" because the command "head" is used to display the beginning or top portion of a file. By typing "head file", it will show the first 10 lines of the file "file".

    Rate this question:

  • 31. 

    mv file1 file2

    • A.

      Rename or move file 1 to file 2

    • B.

      Delete file 1 and file 2

    • C.

      Copy file 1 to file 2

    Correct Answer
    A. Rename or move file 1 to file 2
    Explanation
    The given command "mv file1 file2" is used to rename or move file1 to file2. It does not delete the files or copy file1 to file2.

    Rate this question:

  • 32. 

    cp -r dir1 dir2

    • A.

      Copy file 1 to file 2

    • B.

      Delete files 1 and 2

    • C.

      Copy dir1 to dir 2, create dir 2 if it doesn't exist

    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 directory "dir1" and all its contents to the directory "dir2". If "dir2" does not exist, it will be created. This command does not involve copying or deleting individual files, it specifically deals with copying directories.

    Rate this question:

  • 33. 

    pwd

    • A.

      Create or update file

    • B.

      Show current directory

    • C.

      Delete file

    • D.

      Change password

    Correct Answer
    B. Show current directory
    Explanation
    The command "pwd" is used to show the current directory in a command line interface. It displays the full path of the current working directory, allowing the user to see where they are located within the file system. This can be helpful for navigating and organizing files and directories.

    Rate this question:

  • 34. 

    ls -al

    • A.

      Create or update file

    • B.

      Change directory

    • C.

      Formatted listing with hidden files

    Correct Answer
    C. Formatted listing with hidden files
    Explanation
    The command "ls -al" is used to display a formatted listing of files and directories in the current directory. The "-a" option includes hidden files in the listing, while the "-l" option provides detailed information about each file or directory, such as permissions, owner, size, and modification date. Therefore, the correct answer is "formatted listing with hidden files".

    Rate this question:

  • 35. 

    ps

    • A.

      Display date and time

    • B.

      Show months calendar

    • C.

      Display currenty active processes

    Correct Answer
    C. Display currenty active processes
    Explanation
    The correct answer is "display current active processes" because out of the given options, it is the only one that pertains to showing the currently running processes on a system. The other options, such as displaying the date and time or showing a monthly calendar, are unrelated to displaying active processes.

    Rate this question:

  • 36. 

    You want to the command foo to take its input from the file foobar and send its output to the program bar. Which of the following command lines will do this?

    • A.

      Foo < foobar | bar

    • B.

      Foo < foobar > bar

    • C.

      Foo | foobar > bar

    • D.

      Foo | bar < foobar

    • E.

      Foo > bar < foobar

    Correct Answer
    B. Foo < foobar > bar
    Explanation
    Command> file : Redirect the standard Output to file.
    Command>>file : Append the standard output to file.
    Commandfile à Redirect the standard error to file.
    Command 2>>file àAppend the Standard Error to file.
    In B foo taking the input from foobar using < symbol and redirecting the output to >bar
    file.

    Rate this question:

  • 37. 

    You have just typed the following three commands and got the following output: prompt> echo $PATH /usr/bin:/usr/local/bin:usr/sbin:opt/kde/bin prompt> pwd /home/anna/games prompt> ls game1 game2 game3 You want to run the program game1, but get the response that it is not found. What did you forget to do?

    • A.

      To type ./game1 rather than game1.

    • B.

      To switch the directory /home/anna first.

    • C.

      To unset your PATH before running the program.

    • D.

      To set execution permissions for the program game1.

    Correct Answer
    A. To type ./game1 rather than game1.
    Explanation
    /home/anna directory is not set on path. So to execute the program
    from the directory not set in path, should execute by givin full path or use the ./ .
    If you are in /home/anna use ./ means under current directory.
    To set the directory on path
    PATH=$PATH:/home/anna/

    Rate this question:

  • 38. 

    You want to search the file myfile for all occurrences of a string containing at leastfive characters, where character number 2 and 5 are "a" and character number 3 isNOT "b". Which command would you use?

    • A.

      Grep a*^b*a myfile

    • B.

      Grep .a[^b].a myfile

    • C.

      Grep .[a].*.[a] myfile

    • D.

      Grep .a*^b..a myfile

    Correct Answer
    B. Grep .a[^b].a myfile
    Explanation
    String Processing Tools like grep, sed, awk uses wildcard characters.
    . à Any Single character from the range
    [abc] à Any Single Character from the set
    [a-c] à Any Single Character from the Range
    [^abc] à Any Single Character except from the set.
    [^a-c] àAny Single Character except from the range.
    According to QUESTION, in 2nd and 5th position must be a and in 3rd position not b.
    B. . means any single character in first postion., a means a must be in second postions,
    [^b] means b must not be in third postion, . means any single character in fourth position
    and a in fifth position.

    Rate this question:

  • 39. 

    In order to append the output of ls to a file called bazz, which of the following command lines would you use?

    • A.

      Ls > bazz

    • B.

      Ls >& bazz

    • C.

      Ls &> bazz

    • D.

      Ls >> bazz

    Correct Answer
    D. Ls >> bazz
    Explanation
    The correct answer is "ls >> bazz". This command line appends the output of the "ls" command to a file called "bazz". The ">>" symbol is used for appending output to a file, while ">" symbol is used for overwriting the file with the new output. The other options are incorrect because they either redirect the output to a file without appending it (">" and ">&") or use the incorrect syntax ("&>").

    Rate this question:

  • 40. 

    You want to view a listing of previously entered commands. What command wouldyou use?

    • A.

      Hist

    • B.

      Histfile

    • C.

      Showbuff

    • D.

      History

    Correct Answer
    D. History
    Explanation
    history command lists all commands in history. All history commands
    stored in ~/.bash_history file.

    Rate this question:

  • 41. 

    Which command will list the contents of a directory, listed by file modification time, in reverse order (last modified file shows up at the bottom of a listing)?

    • A.

      Ls

    • B.

      Ls -al

    • C.

      Ll

    • D.

      Ls -lart

    Correct Answer
    D. Ls -lart
    Explanation
    The command "ls -lart" will list the contents of a directory, listed by file modification time, in reverse order. The "-l" option displays the files in a long format, including the modification time. The "-a" option includes hidden files in the listing. The "-r" option reverses the order of the listing, so that the last modified file shows up at the bottom. Finally, the "-t" option sorts the files by modification time.

    Rate this question:

  • 42. 

    What is the command to take you to your home directory?

    • A.

      Cd ~

    • B.

      Cd $HOME

    • C.

      Cd

    • D.

      All the above.

    Correct Answer
    D. All the above.
    Explanation
    The command "cd ~" takes you to your home directory by using the tilde symbol (~) as a shortcut for the home directory. The command "cd $HOME" also takes you to your home directory by using the environment variable $HOME, which represents the path to the home directory. Finally, the command "cd" without any arguments also takes you to your home directory, as it is the default behavior of the "cd" command when no directory is specified. Therefore, all the given options are correct ways to navigate to your home directory.

    Rate this question:

  • 43. 

    How would you remove a directory that is not empty?

    • A.

      Rm -r

    • B.

      Rm -f

    • C.

      Rmdir -f

    • D.

      Rmdir -le

    Correct Answer
    A. Rm -r
    Explanation
    The correct answer is "rm -r". The "rm" command is used to remove files and directories in Unix-like operating systems. The "-r" option stands for "recursive", which means it will remove the specified directory and its contents, including any subdirectories and files within it. By using "rm -r", you can remove a directory that is not empty.

    Rate this question:

  • 44. 

    How do you see hidden files in your home directory?

    • A.

      Ls -h

    • B.

      Ls -la

    • C.

      Ls -hn

    • D.

      Ls -R

    Correct Answer
    B. Ls -la
    Explanation
    The correct answer is "ls -la". This command lists all files and directories, including hidden ones, in a detailed format. The "-l" option displays the files in a long format, showing permissions, owner, size, and other details. The "-a" option shows all files, including hidden ones that start with a dot. Therefore, using "ls -la" allows you to see hidden files in your home directory.

    Rate this question:

  • 45. 

    How would you avoid accidentally removing files?

    • A.

      Rm -i

    • B.

      Rm -chk

    • C.

      Rm -a

    • D.

      Rm -r

    Correct Answer
    A. Rm -i
    Explanation
    The option "rm -i" is the correct answer because it prompts the user for confirmation before deleting each file. This allows the user to double-check and avoid accidentally removing files. The other options, "rm -chk," "rm -a," and "rm -r," do not provide any confirmation and can lead to unintentional file removal.

    Rate this question:

  • 46. 

    How do you copy an entire directory structure? E.g. from Project to Project.backup

    • A.

      Cp Project Project.backup

    • B.

      Mv -r Project Project.backup

    • C.

      Cp -r Project Project.backup

    • D.

      Mv Project Project.backup

    Correct Answer
    C. Cp -r Project Project.backup
    Explanation
    To copy an entire directory structure from "Project" to "Project.backup", the correct command is "cp -r Project Project.backup". The "-r" flag is used to recursively copy all files and directories within the "Project" directory to the "Project.backup" directory. This ensures that the entire directory structure is copied over. The other options, "cp Project Project.backup" and "mv Project Project.backup", do not include the "-r" flag and would only copy or move the top-level directory, without its contents. The option "mv -r Project Project.backup" is incorrect as the "-r" flag is not valid for the "mv" command.

    Rate this question:

  • 47. 

    Which one of the following commands is equivalent to the following command for user jdoe whose home directory is /home/jdoe?# chmod 754 ~/file1

    • A.

      Chmod u=rwx,g=rx,o=r /home/jdoe/file1

    • B.

      Chmod ugo=rwx ~/file1

    • C.

      Chmod u=7,g=5,o=4 ~/file1

    • D.

      Chmod 754 \home\jdoe\file1

    • E.

      Chmod 754 /usr/jdoe/file1

    Correct Answer
    A. Chmod u=rwx,g=rx,o=r /home/jdoe/file1
    Explanation
    a. User mode 7 is the same as u=rwx, group mode 5 is the same as g=rx, and other mode 4 is the same as o=r. The ~/ syntax implies the user's home directory.

    Rate this question:

  • 48. 

    Which command will display the last lines of the text file file1?

    • A.

      Head -b file1

    • B.

      Head --bottom file1

    • C.

      Head -v file1

    • D.

      Tail file1

    • E.

      Tail -n 1 file1

    Correct Answer
    D. Tail file1
    Explanation
    d. The tail command is used for checking the last lines of a text file. By default, it displays 10 lines.

    Rate this question:

  • 49. 

    What two commands display the status of processes on a Linux system?

    • A.

      Ls and df

    • B.

      Ps and top

    • C.

      Ps and df

    • D.

      Df and top

    • E.

      Du and df

    Correct Answer
    B. Ps and top
    Explanation
    b. Both ps and top yield process status. None of the other listed commands are related to processes.

    Rate this question:

  • 50. 

    Which one of the following statements correctly describes the > and >> symbols in the context of the bash shell?

    • A.

      > appends standard output to an existing file, and >> writes standard output to a new file.

    • B.

      > writes standard output to a new file, and >> appends standard output to an existing file.

    • C.

      > writes standard error to a new file, and >> appends standard error to an existing file.

    • D.

      > pipes standard output to a new file, and >> pipes standard output to an existing file.

    • E.

      > pipes standard output to an existing file and >> pipes standard error to a new file.

    Correct Answer
    B. > writes standard output to a new file, and >> appends standard output to an existing file.
    Explanation
    b. The > character opens and writes to a new file, while >> appends to an existing file, unless that file doesn't exist, in which case it is opened first.

    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
  • Aug 03, 2013
    Quiz Created by
    Gauravjoshi
Back to Top Back to top
Advertisement
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.