Dr. Mark Humphrys

School of Computing. Dublin City University.

Home      Blog      Teaching      Research      Contact

Search:

CA216      CA249      CA318

CA400      CA651      CA668


Linux Quiz A

NOT for marks. Just for practice.
I give this in the style of a form in which you can organise your answers. But N.B. There is nowhere to "submit" to. Your answers are lost when you log out.
If you want to keep your answers, save them in a text file.


  1. Typing "cd" causes what to happen?

  2. Typing "cd" (then hit return) followed by "cd .." causes what to happen?

  3. Typing "cd /" causes what to happen?

  4. Typing "cd /" followed by "cd .." causes what to happen?

  5. The commands "cd" followed by "mkdir stuff" are run, what happens?

  6. The commands "cd" followed by "mkdir ../stuff" are run, what happens?

  7. The following assumes you have a web directory:
    The commands "cd" followed by "cd public_html" followed by "mkdir ../stuff" are run, what happens?

  8. The commands "cd $HOME" followed by "mkdir stuff" are run, what happens?

  9. The commands "cd $HOME/public_html" followed by "mkdir stuff" are run, what happens?

  10. The commands "cd /public_html" followed by "mkdir stuff" are run, what happens?

  11. Show the value of the variable $PATH using echo.

  12. Show the directories in the variable $PATH separated by spaces rather than by colons.

  13. Find what directory in the previous "ls" is in.

  14. Show the file size of the "ls" program.

  15. The command ls -lF does what?

  16. Typing "ls > file.txt" does what?

  17. Do you see any difference between outputting "ls" to screen and outputting it to a file?

  18. Typing "cd" followed by "ls > public_html/file.txt" does what?

  19. Typing "cd $HOME/public_html" followed by "ls > public_html/file.txt" does what?

  20. Typing "cd $HOME/public_html" followed by "ls > ../public_html/file.txt" does what?

  21. Two programs, in different directories, have the same name. One is a system program. The other is a script that you wrote. What happens when you type that name?

  22. In the previous, if you find the system program is running when you type that name, how can you make sure that your program runs instead?