CS 279 - Week 1 Lab
====
TODAY WE WILL
====
* Part 1 - Lab Exercise
* add a bit more about files
* Part 2 - Lab Exercise (in pairs)
* yay, everyone can log into BSS 313!
* AND everyone has accounts on a departmental server,
nrs-projects.humboldt.edu
* can connect to this using ssh - secure shell
* can transfer files to and from this using
sftp - secure file transfer protocol
* SEE the "Useful details: ssh and sftp"
handout, linked under "References" on the
public course web site, for some additional
info on these
* how can you use command-line ssh to connect to
nrs-projects?
ssh st10@nrs-projects.humboldt.edu
* it is considered good practice to formally exit
a remote shell (rather than just, say, close its
window)
* there are at least 3 ways to do this:
type:
logout
type:
exit
or type the control key and d at the same time,
(often abbreviated ^D)
====
BASH COMMENT SYNTAX!
====
* starts with a # (but NOT #!, that's special for the
first line)
and everything to the end of the line is ignored
# this is a comment
echo moo # this is also a comment
====
START of some more filesystem/common file commands discussion
====
* named collection of files -> typically called a
directory (rather than a folder)
* (but a directory is also a kind of file in
UNIX/Linux)
* when you ssh into or start up a new shell instance,
you are typically put into a certain directory called
your HOME directory
=====
pwd
====
* present working directory
* outputs the full pathname of the present/current
working directory
====
ls
====
* list the files in... something
* with NO arguments? ...lists the (visible)
files in your present working directory
* (you can add options to see invisible files,
or details about files, and you can add arguments
to see contents of different directories, ETC.)
=====
output redirection
=====
* IF you follow a command
with > desired_filename
...its standard output will be REDIRECTED to
a file with than name in the current directory
* WARNING, it OVERWRITES any prior contents of that
file!
=====
cat
=====
* means: conCATenate (?!)
* WHEN called with just ONE filename as its argument,
writes that file's to the screen in one fell swoop
=====
mkdir
=====
* make directory
* when called with a name, makes a new directory
with that name in the current directory
=====
cd
=====
* change directory
* when its argument is the pathname of a directory,
it changes the current working directory to that
directory