Quiz

  1. How does a tarfile puts all files in the directory tree into one file? Do these files have the same priority?

    I don't think we need to get into the implementation details, but it's a very old command. It stands for "tape archive" and was intended for writing files and folders onto reels of magnetic tape for archiving and backup, or to transport to another machine. It predates networks!

    It can represent directory entries, meaning both folders and files, and get the parent/child relationships correct.

    I'm not sure what you mean by "priority". They all go in there, in the correct place, so that the data can be reconstructed.

  2. about the drop command. The readings say that you scp the file to Tempest, then ssh to Tempest. Does it need to happen in that order, or can it be interchanged, i.e., if you've already ssh to tempest, will it work if you scp the file? Thanks

    You can do them in the other order, but you'd need to have a second terminal, on your laptop, to do the SCP.

    Think of it this way: you can PUSH your file from your laptop to Tempest, but you can't PULL your file onto Tempest from your laptop.

  3. I am confused about tar and gzip.

    tar turns a directory structure into a single file, which is convenient for saving/archiving/sending.

    Gzip compresses a file.

  4. A question that I have about this material relates to the work we did in class on Wednesday 9/3. I am wondering about how the Wellesley CS server in particular works and which UNIX commands will be the most important to know by memory. I will also want to learn about what exactly gdome is, and what files we have access / don't have access to within the server. Why can I see some of the directories even though I cannot cd into them?

    I've listed the commands that are most important. You'll get them by practice.

    Gdome, Georgia Dome, is just an example user, like "Wendy Wellesley". Not important to remember.

    The ability to "ls" a directory is separate from being able to "cd" into it. They usually go together, but not always.

  5. In the example, when we rename a file, we used mv mydir.tar yourdir.tar. Isn't mv moving a file to another directory ?

    Great point! The mv command does double-duty: moving files to other places that already exist or to other names. I was puzzled by this when I first learned unix, back when dinosaurs roamed the earth.

  6. One question I had is if there is a simpler way to move and copy files at the same time, and rename the file while doing that?

    The cp command will allow you to name the copy. So

    cp file1 file2

    names the copy. Same for folders:

    cp -r dir1 dir2

    Now, as a feature, if dir2 already exists, CP copies into it, keeping the original name. So you get:

    dir1
        dir2        
    
  7. What happens when tab completion finds multiple possible matches?

    It will "beep" and wait for you to choose. You can get a list of the possible continuations by pressing TAB again.

  8. when looking at the slides, I don't fully understand slide 30 (the 'c-p' command and the other ones with letters, I tried and they didn't work?) and some of the commands.

    Let's look at that together. If you're still confused, come visit me in office hours!

  9. This is just a curiosity question but why is there a need for different descendants of Unix?

    Historically, the source code was small and open. Thanks to UC Berkeley, many, many people copied unix. But then they wanted to enhance it, so there were variations, and different opinions about how things should work.

    Then, Linus Torvalds wanted Unix on his PC, so he created Linux. (Linus=Linus + Unix). Again, open source, so many, many people contributed.

    Now there are lots of distributions of Linux, that have different, say, user interfaces (Desktop environments).

  10. Do all servers/directories accept drop capabilities, like do our student servers permit anyone to drop anything into them? Or is drop a permission set specifically for certain directories like requiring a drop directory to be made and setup, like cs304flask/drop ? Curious about that setup.

    No! It's very weird to be able to transfer a file, including its *ownership* to another user. I implemented the "drop" command on our server, using some advanced Unix skills, which I would be happy to describe outside of class.

  11. I'm still a bit confused about the formatting in the terminal, is it possible to type multiple commands in one line?

    Yes, though it's not often done. Just separate them with a semicolon. The following does two commands in one:

    cd ~/cs304; ls 
  12. Will we ever need to use tar commands for this course?

    Yes, for the first assignment, but then, maybe not often. But if you want to drop some code to a partner, a tar file is invaluable.

  13. None!/ None! This has been pretty clear thus far./ I don't have any questions right / None so far! I have some experience with unix from CS240.

    Great!