Linux Command Line 2

23 Questions | Total Attempts: 429

SettingsSettingsSettings
Please wait...
Linux Quizzes & Trivia

Command line. Several of the questions require you to log into the training server to get your answers. If you have any problems or need help, let me know.


Questions and Answers
  • 1. 
    What command lists files in current directory?
  • 2. 
    What command lists files in current directory including owner and group information?
  • 3. 
    If you are in your home directory, how do you list list files in the current directory and sub directories?
  • 4. 
    If you are in your home directory, how do you list files with user, group and size of file including hidden files?
  • 5. 
    How do you list files in your current directory and all files 2 levels deep?
  • 6. 
    From the root directory, find files in /var/test/ directory with the name test3.txt
  • 7. 
    How do you find files in your current directory modified more than 48 hours ago
  • 8. 
    How do you find files in your current directory modified less than 60 minutes ago.
  • 9. 
    How do you find files in your current directory that are world writable.Note: use short syntax (ogw)
  • 10. 
    Which commands will list all files and folders in your home directory.
    • A. 

      Ls ~

    • B. 

      Dir ~

    • C. 

      Ls -la ~

    • D. 

      Ls -la ~/*

    • E. 

      Find ~

  • 11. 
    How do you view the entire contents of a file and make each line display the line number?
  • 12. 
    How do you view the last 100 lines of a file?
  • 13. 
    What is the command to find the line with "ERROR" in the file /var/test/data/test. Copy the results of the command into your answer.
  • 14. 
      Assuming you are in the folder /var/test/data/, what is the command to find the line with "ERROR" in the file /var/test/data/test and in all files in folders below /var/test/data/. Enter the command into your answer.
  • 15. 
    What is the command to forcibly delete all files in the current directory?
  • 16. 
    What is the command to forcibly delete all files in the current directory ending in .sh?
  • 17. 
    What is the command to create an empty file named emptyfile.txt?
  • 18. 
    What is the command to display the first 5 lines of /var/test/data/test ?
  • 19. 
    Which methods are correct for querying 10.2.4.42 for the ip address of lyris.com
    • A. 

      Dig -x @10.2.4.42 lyris.com

    • B. 

      Dig @10.2.4.42 lyris.com

    • C. 

      Nslookup 10.2.4.42 lyris.com

    • D. 

      Nslookup -10.2.4.42 lyris.com

  • 20. 
    What is the dig command to get a hostname by supplying the ipaddress?
  • 21. 
    What is the command to view data in real time as it is being added to a file (log file)
  • 22. 
    Using tail and grep, how do you view only lines with the word ERROR as they are being added to the file "test" (assuming test is a log file that is constantly being written to).
  • 23. 
    What is the command to update all software packages on a server?
Back to Top Back to top