Command line basics. cd.
  • 1. A directory is equivalent to a
A) Any document
B) Folder
C) Word Document
D) File
E) File System
  • 2. A path is a chain of ______
A) Hard Drives
B) Directories
C) Teddy Bears
D) Documents
E) Files
  • 3. Your home directory is
A) A default path that looks like a house
B) The default directory to store your files
C) The default directory where programs are
D) Your home address
E) A special system directory that stores my passwords
  • 4. the path / stands for
A) Root directory
B) down one level
C) up one level
D) empty path
E) the current directory
  • 5. the path ~ stands for
A) Root directory
B) down one level
C) empty path
D) up one level
E) Home directory
  • 6. if pwd outputs /User/james/test/" you are in what directory?
A) james under root under test
B) Test under james
C) User under james under test
D) test under james under User
E) test under root
  • 7. if pwd outputs /User/jane/programs/output then cd .. will take you to
A) /User/jane/
B) programs/
C) /User/jane/programs/
D) /User/
E) /User/jane/programs/data
  • 8. if pwd outputs /myfiles/modeling/airplanes/biplanes/ then assuming cd ../../data/ succeeds, pwd would now output:
A) /myfiles/modeling/data
B) /myfiles/modeling/airplanes/biplanes/../
C) /myfiles/modeling/
D) /myfiles/data/
E) /myfiles/modeling/airplanes/biplanes/data
  • 9. if pwd outputs "/Dog/Cat/mouse/" what commands should be used to list all the files in Dog/Cat/mouse/flea/?
A) cd flea; ls
B) cd flea
C) pwd flea
D) ls
E) ls -l
  • 10. if pwd outputs "/Dog/Cat/mouse/" what command(s) should be used to list all the files in Dog/Cat/mouse/flea/?
A) list files flea
B) cd mouse/flea; ls
C) ls flea/
D) ls -l
E) pwd flea/ ; ls
  • 11. if pwd outputs "/Dog/Cat/mouse/" and you type ls you will see:
A) all the files in Dog, Cat and mouse directories
B) the path to the mouse directory
C) a commercial for buger king
D) all the files in the "mouse" directory
E) all the files in the "flea" directory
  • 12. if pwd outputs /Dog/Cat/mouse/ and then you issue a cd ~ how do you get back to the original directory?
A) cd /dog/cat/mouse
B) cd orig-dir
C) cd dog/cat/mouse
D) cd /Dog/Cat/mouse
E) cd ~/Dog/Cat/mouse
  • 13. let's say pwd outputs /Users/john/ Now, you have a file /dog/cat/mouse.dat and want to copy it to /dog/cat/rat.dat what command would you issue?
A) cp /Users/john/mouse.dat rat.dat
B) cp /dog/cat/mouse.dat /dog/cat/rat.dat
C) cp /dog/cat/mouse.dat rat.dat
D) mv /dog/cat/mouse.dat rat.dat
E) mv /dog/cat/mouse.dat /dog/cat/rat.dat
  • 14. let's say pwd outputs /dog/cat/ Now, you have a file /dog/cat/mouse.dat and want to copy it to /dog/cat/rat.dat what command would you issue?
A) mv cp ls pwd
B) mv /dog/cat/mouse.dat /dog/cat/rat.txt
C) mv mouse.dat rat.dat
D) cp /dog/cat/mouse /dog/cat/rat
E) cp mouse.dat rat.dat
  • 15. let's say pwd outputs /dog/cat/ Now, you have a file /dog/cat/mouse.dat and want to copy it to /dog/cat/rat.dat what command would you issue?
A) cp /dog/cat/mouse.dat rat
B) mv mouse.dat rat.dat
C) mv /dog/cat/mouse.dat /dog/cat/rat
D) cp /dog/cat/mouse.dat /dog/cat/rat.dat
E) cp /dog/cat/mouse /dog/cat/rat
  • 16. let's say pwd outputs /dog/cat/ Now, you have a file /dog/cat/mouse.dat and want to move it to /dog/cat/rat.dat what command is equivalent to mv mouse.dat rat.dat
A) find -space -time -travel
B) mv mouse.dat rat
C) cp mouse.dat rat.dat
D) mv /dog/cat/rat.dat mouse.dat
E) mv /dog/cat/mouse.dat rat.dat
  • 17. let's say pwd outputs /dog/cat/ Now, you have a file /dog/cat/mouse.dat and want to move it to /dog/cat/rat.dat what command is NOT equivalent to mv mouse.dat rat.dat
A) mv /dog/cat/mouse.dat /dog/rat.dat
B) mv mouse.dat /dog/cat/rat.dat
C) mv ../cat/mouse.dat rat.dat
D) mv mouse.dat ../cat/rat.dat
E) mv /dog/cat/mouse.dat rat.dat
  • 18. let's say pwd outputs /dog/cat/ Now, you have a file /dog/cat/mouse.dat. You type cp mouse.dat rat.dat; cp rat.dat ../mice.dat then:
A) /dog/cat has a file named mouse.dat
B) /dog/cat has two files, /dog has one file
C) /dog/cat has three files
D) /dog/ has three files, /dog/cat/ has two.
E) /dog/cat/mouse.dat has a file called rat.dat
  • 19. let's say pwd outputs /p/g/ Now, you have a file /p/g/out.dat. You type cp out.dat rat.dat; cp rat.dat ../mice.dat; cd ..; mv g/out.dat ." what would ls produce?
A) mice.dat
B) mice.dat out.dat
C) out with mice and rats!
D) p g mice.dat out.dat
E) out.dat rat.dat mice.dat
Created with That Quiz — a math test site for students of all grade levels.