Quiz

  1. What's the best way to get used to working on the CLI and out of a GUI? Also, is there any effective way to memorize the commands?

    Same as getting to Carnegie Hall... Practice, practice

    Also, be lazy and impatient. Wonder if there's a better way to do something. Then ask and learn what it is.

  2. I am a little confused about the home directory and login directory. Are they the same thing? And I don't fully understand the significance and use case of tilde (~)? Can't we keep doing cd .. until we reach the home directory? Because if there are subdirectories or files in the home directory, it is also the parent directory of those subdirectories, right?

    Yes. Login directory and home directory are the same thing.

    Tilde means that, unless its followed by a name, in which case, it means the home directory of that account

    Yes, you could reach the home directory by going up as long as you are below it. But you might not be.

  3. Could we review the section near the end about ssh and scp? Should we aim to only have one shell open at a time?

    Happy to go over ssh and scp. SSH is for connecting, so you can run commands. SCP is just for transfering files.

    You can have lots of shells open. I do it all the time.

  4. how, if at all, is ssh different from connecting to github?

    Wow, great question, with a long answer. You can connect to github in a variety of ways, including a web browser. There are different protocols or ways of connecting. One of those is SSH.

    But you can also use SSH to connect to things other than github.

  5. I'm still a little confused about tar and gzip and how they may be combined. / Why tarfiles are convenient and how to make use of them? / I would like to have a little more information on tar & gzip. / What is the difference between tar and gzip? When should you use one over the other?

    Tar copies a bunch of files into a "suitcase" for easy transport. The result is often called a "tarfile". Gzip scrunches a file down so it takes less space. So it's common to pack a tarfile and then gzip it.

    We can also gzip other kinds of files, and we can decide to skip the compression if we want.

    If you've used zip files, it's the same idea.

    There are other compression methods as well. XZ is one, and it almost got the world in trouble.

  6. I am still confused about the common tar errors, specifically the circumstance where files are written over if un-tarred.

    Sure. If you have, say, a scarf on the floor of your room and you are unpacking a suitcase that contains another of that same kind of scarf (but maybe an older and stained one). You expect to have two scarves: the current one and the old, stained one from the suitcase.

    But tar is creating files. If you have a file scarf.py and the tarfile contains a scarf.py (which is older and buggy), the one you have will be replaced by the one from the tarfile.

    So, I suggest unpacking a tarfile in a new, empty directory, so it won't ever overwrite anything you have.

  7. I'm still a little unsure about tar and gzip implementation

    I'm not sure what you mean by "implementation." The code for either one is not important to us. We are really just users of the software.

  8. What exactly distinguishes a relative pathname from an absolute one? Why is the relative one called so?

    An absolute pathname starts at the root of the computer system and specifies a path of directories all the way down:

    /home/cs304flask/public_html/top/syllabus.html

    A relative pathname has an ambiguous or flexible starting point. It starts from "where you are", whatever that is. So

    top/syllabus.html

    from the CS 304 Flask public_html, that means the same thing. But from the public_html of the CS204 course, it means the syllabus of a different course.

    So, the pathname is relative to the starting location. This is actually really useful. I can tell each of you to find a file in your account by giving you a pathname relative to your home directory.

  9. I've seen something like @/ instead of ../ (maybe not in command line though, but in java script or something), what's the difference?

    I've never seen an @ in a pathname. They are not part of the Unix pathname language. They do show up in directory listings as a way of marking symbolic links.

    Symbolic links are outside the scope of this course (though I cover them in the other version of CS 304, because we need them there). symlinks. They are a way of adding shortcuts to other files, but misused, they turn the nice tree into a tangled mess.

  10. I don't really understand how the wildcard character is used. Do we use it to view files in the given directory that contains a certain character?

    Yes. Or, in general, to operate on them, like copying them, deleting them, printing them, ...

  11. I am confused about the difference between rm, rm -r, and rmdir. Specifically, does rmdir remove only the directories that are empty?

    rm deletes the files listed on the command line. You can use wildcards or list multiple files.

    rm foo.html *.py *.css

    But they can't be directories. To delete a directory, use rmdir:

    rmdir project1

    But the directory has to be empty. To delete a directory and its contents, recursively, use rm -r

    rm -r project1
  12. I'm a bit confused on what drop does.

    It copies an single file of yours to someone else's drop folder, if they have one, and transfers ownership to the recipient.

  13. What's the difference between Git push/pull and drop on Tempest?

    They are similar in some ways, but drop is much more limited. The sender and recipient have to be on the CS server, and the recipient has to have a ~/drop folder.

    Git push/pull works across a network, can transfer lots of files, but requires prior authorization

  14. How do you rename a file in unix?

    mv