Dr. Mark Humphrys

School of Computing. Dublin City University.

Home      Blog      Teaching      Research      Contact

My big idea: Ancient Brain


CA216      CA249      CA318

CA400      CA651      CA668

Introduction to UNIX / Linux

The Command-line

Text-based interface.
Type commands with arguments at a "prompt":

$ command (arg1) (arg2) ...
You can use this as an adjunct to (rather than replacement of) the GUI interface.

The "prompt" may be anything, not necessarily "$". It doesn't matter what the prompt is.

Note: In notes I often use the convention "$" to indicate the prompt, no matter what the prompt is.
Note: In my account seen on screen, I have changed my prompt so it may be different to yours.

Can launch GUI programs:

$ gedit file &


Most commands are not in-built, but are programs, found somewhere in the "PATH" variable:
echo $PATH
This makes the command-line "shell" a reasonably simple program:
See if there exists in the directories listed in the variable $PATH an executable file with the same name as the 1st "argument". If so, execute this file, passing it the other arguments. Else print error message.

Note: The complete list of executable files in the path is normally read once and cached in memory for fast access every time a command is typed.

Hierarchical Directory (Folder) structure

pwd                     Print working directory 
                        e.g. /users/staff/jsmith

cd                      Change directory
ls                      List files

cd ..                   Go to parent directory 
                        e.g /users/staff 

.                       Current directory
/                       root directory
$HOME                   home directory
$HOME/public_html       public web space
/tmp                    system temporary files

Hierarchical file system - /directory/sub-directory/file
Forward slash (this is why Web is forward slash).

Feeds      w2mind.org      ancientbrain.com

On the Internet since 1987.