Linux Tutorial

Tutorial Goal -- Learn basic linux commands, set up your system for the semester.

Overview

With Linux, you can use either a graphical user interface or command-line programming. You can also get to the command-line by clicking on the redhat in the left lower corner, then choosing System Tools and Terminal. Then you can run the commands such as the ones below.

Where as Windows File Manager has drives like 'C:', the Linux file systsem does not. Instead, there is a root directory named '/'. All other directories are in a hierarchy below that.

Referring to Directories

At USF, your Linux home directory is at: /home/yourUserName.
You also have a web directory: /home/web/yourUserName.

A single dot (.) means the directory you are in.
Two dots means the parent directory.

Commands

Login to Linux and try the following commands.

% ls
lists the files in your current directory.

% ls *.txt
lists all files in your directory with extension '.txt'. '*' is the wildcard.

% mkdir programs
creates a new subdirectory called 'programs'

% cd programs
changes from the current directory to the subdirectory 'programs' (if it exists)

% cd
changes from wherever you are to your home directory.

% cd ..
takes you up in the directory hierarchy, e.g., if you're in /home/wolber/programs, it will take you to /home/wolber.

% pwd
prints out your current directory.

% passwd
changes your password.

% cp src dest
copies a file from one place to another

% mv src dest
moves a file from one place to another

% rm file
removes a file (be careful)

% rmdir directory

Task: Modify your directory so that it has the following sub-directories:

java
python

Under each, have a subdirectory for 1) samples, and 2) projects. Samples is where you'll put programs you do in class that perform specific operations. Projects is where you'll put the larger projects you complete.

After creating these sub-directories, perform an ls to list them and also use the graphical user interface manager to see that they appear there.

Task: Text Editing

Select the red hat in the lower left corner and choose Accessories | Kedit. This is a simple wysiwyg text editor. Create a file with some text in it and save it in your home directory.

Task: Moving and Copying Files

1. open a command window and perform an ls to list the file you just created.

2. Try copying the file into the java subdirectory. From your home directory, write:

cp filename java/.

This means to copy the file into the java directory with the same name.

3. Navigate to the java directory and ls to make sure the file is there.

4. Explore the cp, mv, rm, and rmdir commands.

Setting up Firefox Browser

Open up firefox by clicking on the globe in the bottom toolbar. After it opens, open the following pages, then left-click on the page's icon in the browser address bar and drag link into your browser shortcut bar. Definitely put the following links there:

CS 110 Homepage -- http://cs.usfca.edu/~wolber/courses/110/
CS Department Home page-- http://cs.usfca.edu

More Linux? Here's one of many Linux Tutorials