Getting Around in UNIX

Using the command line

Before graphical user interfaces were common, everyone used a command line interface. It may seem like a step backwards to learn how to use such an interface, but you should be familar with goes on "behind the scenes" of serving your webpages.

Most of the time, what lies behind the scenes is a UNIX machine. The following is a quick list of commands to help you get around. These commands are case sensitive, but they almost always appear in lowercase:

Cmd

Function

Examples

Translation

Some UNIX commands

cd

change directory

cd

go to the home directory

cd public_html

go to the "public_html" subdirectory

cd ../

go to the parent directory (one directory up)

ls

list the files in a directory

ls

list the files in the current directory

ls public_html

list the files in the "public_html" subdirectory

ls ../

list the contents of the parent directory (one directory up)

ls -la

list all the files in the current directory, with details

ls -l foo.html

give me details about the file "foo.html"

rm

remove (delete) files

rm foo.html

remove the file "foo.html"

rm -r /site

remove the directory "/site" and everything in it

rm *.html

remove every file ending with ".html"

rm -r *

remove everything in this directory and every subdirecotry (be careful!)

mv

move (or rename) files

mv foo.html ../

move the file "foo.html" to the parent directory (one directory up)

mv foo.html bar.html

rename "foo.html," making it "bar.html" instead

pwd

print working directory

pwd

tell me what directory I'm in right now

pico

open the pico text editor

pico foo.html

edit the file "foo.html"

[CTRL]+[D]

delete

works just like the delete key on a PC or Mac

[CTRL]+[O]

save

save the current file

[CTRL]+[X]

exit

exit pico

[CTRL]+[A]

home

go to the begining of the current line

[CTRL]+[E]

end

go to the end of the current line

[CTRL]+[Y]

page up

go up one screen

[CTRL]+[V]

page down

go down one screen

[CTRL]+[K]

kut

cut the current line

[CTRL]+[U]

un-cut

paste the lines you last cut

[CTRL]+[W]

where is...

find

Using pico

 

Tips and Tricks