#separator:tab #html:true #tags:command-line-quiz #columns:Front Back

In which folder is the file C:\Users\anna\Documents\uni\notizen.txt?

  1. Documents
  2. uni
  3. notizen.txt
  4. C:\

The last part of a path is the name of the file, and the part before it is the folder the file sits in directly. uni in turn sits in Documents.

Which of these paths are absolute? (several are right)

  1. C:\Users\anna\Documents
  2. Documents\uni
  3. /Users/anna/Documents
  4. ..\pictures

An absolute path starts at the root, on Windows with a drive such as C:\, on the Mac with /. The other two only apply from a particular folder and are relative.

The prompt reads PS C:\Users\anna\Documents\uni>. Where are you after cd ..?

  1. In C:\Users\anna
  2. In C:\Users\anna\Documents
  3. Still in uni, because .. is not a folder name
  4. In C:\

.. stands for the folder one level above the current one. From uni that is Documents.

Which command shows you which files are in the current folder?

  1. pwd
  2. ls
  3. cd
  4. cat

ls lists the content of a folder. pwd only gives the path of the current folder, cd changes it, and cat shows the content of a file.

What does mv report.txt report-final.txt do?

  1. A copy called report-final.txt is created, and the original stays.
  2. Afterwards the file is called report-final.txt, and there is no report.txt any more.
  3. The file is moved into a folder called report-final.txt.

If the target is not an existing folder but a new name, mv renames the file. A copy is only created with cp.

You deleted a file with rm by mistake. Where do you find it?

  1. In the recycle bin
  2. In the folder .trash of the current directory
  3. Nowhere, it has been deleted directly

rm deletes immediately and without asking, and the recycle bin belongs to Explorer and Finder, not to the command line. At most, the file can be restored from a backup.

python hallo.py answers with can't open file … No such file or directory. What is the most likely cause?

  1. There is a typo in the program.
  2. Python is not installed.
  3. You are not in the folder that hallo.py is in.

Python has started, otherwise the message would not come from Python, and it has not even read the file yet, so a typo in it would not show up so far. It looks for hallo.py in the current directory, and the file is not there.