Useful Commands


File commands

ls (-l)

List files (-l = detail)

pwd

Print working directory

cd

Change directory

cp <original> <newname>

Copy file/directory

mv <original> <newname>

Move file/directory

locate <filename>

Locate a file


User/permission commands

su <username>

Substitute user (change to a different user)

chmod <permission> <filename>

Change mode (alter file/directory permissions)

chown <username>:<group> <filename>

Change ownership of a file/directory

whoami

Reminds you what user you are running as


Text commands

less <filename>

Display a text file on screen (q to exit)

tail <filename>

Print last few lines of a file

grep <search term> <filename>

Get regular expression (search for all occurrences of <search term> in a file

joe <filename>

Simple text editor

emacs <filename>

Complex text editor

vi <filename>

Insanely complex text editor



Other commands

man <commandname>

Manual: display help file for a command (q to exit)

ssh <hostname>

Secure shell (log on to another server)

scp <options>

Secure copy (copy files between servers)

lynx <url>

Text-mode browser

ncftp

Text-mode ftp client

top

Total operating processes (displays system perfomance)






Shortcuts

Up/down arrow keys

Recall previous commands

Tab

Command/filename completion

Ctrl+C

Cancel (force quit) from a program

.

Current directory

..

One level up

~

Home directory



www.roddis.org/linux tristan@roddis.org