Each account has a home directory: the root of a subtree of all your files, separate from everyone else's files.
The location of the home directory usually follows some kind of naming scheme, but it can be arbitrary.
Sure. It takes some getting used to. In a nutshell:
~
is my home directory, where "my" means the person who is logged in.
~fred
is Fred's home directory,
which is looked up in a "account database"
(historically, /etc/passwd
but nowadays could
be some networked database, like the Active Directory
database that LTS uses for your domain passwords.
Example:
~/cs204
is your cs204
folder, the one in
your home directory.
~cs204
is the CS 204 course account, where this web page lives.
The following copies a file from the course account to your account:
cp ~cs204/path/to/source/file ~/cs204/path/to/destination/file
You'll get it!
Here's a real-world example that isn't all that dangerous. Suppose I upload a bunch of pictures of my son't wedding from my phone to my laptop. Now I want to copy them to a folder on the server where I'm going to put some of them onto a wedding website:
scott@Scotts-Macbook-Pro Downoads % scp 20230802*.HEIC anderson@cs:public_html/wedding/imgs/
The command above used relative pathnames twice: files in
the Downloads
folder on my laptop, and a relative path
from my home directory to the imgs
folder.
Tar puts a bunch of files into a single file. When you download a folder from Google Drive, it downloads the collection as a zip file: pretty much the same thing.
Gzip is a compression algorithm: takes a big file and makes it smaller.
The two are often combined, but they are conceptually separate operations.
The drop
command is one I created; it's not standard
Unix. There's some magic involved that is outside our scope, but the
basic idea is that the drop
command transfers one of your
files to a recipient. The recipient needs to have
a ~/drop
folder.
It's conceptually similar to dropbox.com
If you need to drop a lot of files, you can drop a tarfile or zip file.
Long before Google, the web, and practically before the Internet, there were online man pages to document commands and give details about their usage.
They're still useful. I use them all the time. Sometimes, I look
them up on the web, but because there are variant versions of
commands, if I want to know how the tar
command works on
a particular computer, I use the man
page.
A lot of what we do is writing code: HTML, CSS, JS. But part of the mechanics is putting the files in the right place, and setting things up with the structure of files and folders that we want. Unix commands help us do that.
They're also a first step to more advanced knowlege.
We'll get lots of practice throughout the course.
Again, lots of practice.
Ditto