Tip:
Highlight text to annotate it
X
[Silence]
In the GNOME desktop, press the Start button and type in "terminal"
We've now started a command line session in BASH.
[Silence]
Let's see where we are the system...
the command is the pwd for Print Working Directory
or Present Working Directory.
[Silence]
We're off the root directory, in the home directory,
in our personal directory, called 522-01; so the ~ represents our personal directory.
Let's see what else is in this directory: ls
These are the directories that come with the GNOME 3 interface; let's make our own directory.
The command is mkdir and we'll name it junk.
Hit the enter key; lets run a directory listing: ls
We can see that the junk directory now exists.
Let's run a longer, more detailed listing, to find out about this...
ls -l leads us to see 'junk' is a directory;
I, the user, have read, write, and execute permissions; members of my group have read, write, and execute permissions;
others have read and execute permissions.
Now that we've made a directory, let's make a file...
the command is touch, and I'll call it test.txt
touch test.txt
Hit the Enter key, and let's run an ls
There it is.
Let's run a longer, more detailed, directory listing with ls -l
We can see test.txt has 0 bytes, starts with a dash, so it's not a directory...
I, the user, have read and write permissions;
members of my group have read and write permission; and others only have the read permission.
[Silence]
Let's edit that file; we'll do it the hard way first with vi
The command is vi the name of file, so in this case it'll be vi test.txt
We've opened the command line text editor; we have to press i to get into insert mode; now we can type our name...
when we finish typing our name, hit the Escape key to exit from Insert mode, hold down the the shift key and type in ZZ
to Save and Exit.
[Silence]
Let's run a quick ls
There's the file, let's run a longer, more detailed listing,
ls -l; we can now see that the file has 6 bytes, 5 for my name, and the space that follows.
Let's try that with a better editor, since we are at the command line using a graphical user interface,
let's use gedit
gedit test.txt
This starts a graphical user interface,
let's add something to that file,
we'll now go to the File menu and choose Save,
then we go to the File menu, and choose Quit.
Let's run a longer, more detailed listing, ls -l
I notice first off, a backup file was created..
six bytes is the way it used to be; the ~ represents (that) it's a backup file.
The newer file has 8 (bytes) because I added a C and another space.
Let's get rid of that backup file;
rm test.txt~
Enter
Run a quick ls... file seems to be gone.
cat test.txt will read the contents of that file;
I can now see Craig C and additional space.
Let's copy this file...
we're going to copy it into our
junk directory.
cp source [test.txt] destination [junk/test.txt] ...
where's it going... what will it be called.
Now to see the contents of our current directory, and all the subdirectories, we will use
ls -R the recursive listing.
Enter
We can see the contents of the junk directory, so, test.txt was in fact copied into that directory.
Let's clear the screen...
and change directories,
into the junk directory...
cd junk