Command line basics. cd.
  • 1. A directory is equivalent to a
A) Folder
B) Word Document
C) Any document
D) File
E) File System
  • 2. A path is a chain of ______
A) Directories
B) Teddy Bears
C) Files
D) Documents
E) Hard Drives
  • 3. Your home directory is
A) A special system directory that stores my passwords
B) Your home address
C) The default directory where programs are
D) The default directory to store your files
E) A default path that looks like a house
  • 4. the path / stands for
A) up one level
B) Root directory
C) empty path
D) the current directory
E) down one level
  • 5. the path ~ stands for
A) down one level
B) Root directory
C) empty path
D) up one level
E) Home directory
  • 6. if pwd outputs /User/james/test/" you are in what directory?
A) test under james under User
B) james under root under test
C) User under james under test
D) Test under james
E) test under root
  • 7. if pwd outputs /User/jane/programs/output then cd .. will take you to
A) /User/jane/programs/data
B) programs/
C) /User/
D) /User/jane/programs/
E) /User/jane/
  • 8. if pwd outputs /myfiles/modeling/airplanes/biplanes/ then assuming cd ../../data/ succeeds, pwd would now output:
A) /myfiles/modeling/data
B) /myfiles/data/
C) /myfiles/modeling/airplanes/biplanes/../
D) /myfiles/modeling/airplanes/biplanes/data
E) /myfiles/modeling/
  • 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) ls
C) ls -l
D) cd flea
E) pwd flea
  • 10. if pwd outputs "/Dog/Cat/mouse/" what command(s) should be used to list all the files in Dog/Cat/mouse/flea/?
A) pwd flea/ ; ls
B) ls -l
C) cd mouse/flea; ls
D) ls flea/
E) list files flea
  • 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) a commercial for buger king
C) all the files in the "mouse" directory
D) all the files in the "flea" directory
E) the path to the mouse 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 ~/Dog/Cat/mouse
C) cd orig-dir
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 /dog/cat/mouse.dat rat.dat
B) cp /dog/cat/mouse.dat /dog/cat/rat.dat
C) mv /dog/cat/mouse.dat rat.dat
D) mv /dog/cat/mouse.dat /dog/cat/rat.dat
E) cp /Users/john/mouse.dat 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) cp mouse.dat rat.dat
B) mv mouse.dat rat.dat
C) mv cp ls pwd
D) mv /dog/cat/mouse.dat /dog/cat/rat.txt
E) cp /dog/cat/mouse /dog/cat/rat
  • 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) mv mouse.dat rat.dat
B) cp /dog/cat/mouse /dog/cat/rat
C) cp /dog/cat/mouse.dat rat
D) cp /dog/cat/mouse.dat /dog/cat/rat.dat
E) mv /dog/cat/mouse.dat /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 /dog/cat/mouse.dat rat.dat
C) mv /dog/cat/rat.dat mouse.dat
D) cp mouse.dat rat.dat
E) mv mouse.dat rat
  • 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 ../cat/mouse.dat rat.dat
B) mv mouse.dat /dog/cat/rat.dat
C) mv /dog/cat/mouse.dat /dog/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/mouse.dat has a file called rat.dat
B) /dog/cat has three files
C) /dog/cat has a file named mouse.dat
D) /dog/ has three files, /dog/cat/ has two.
E) /dog/cat has two files, /dog has one file
  • 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) p g mice.dat out.dat
B) out with mice and rats!
C) mice.dat
D) out.dat rat.dat mice.dat
E) mice.dat out.dat
Created with That Quiz — a math test site for students of all grade levels.