# Basic Unix

Here are some basic Unix commands to help you get started:

## Commands

`ls` - lists the content of a directory
`pwd` - shows you the current working directory
`cp` - copies a file
`mv` - moves or renames a file
`cd` - changes a directory
`ps` - prints a process list
`kill` - kills a process
`man` - show a manual page (help)
`mkdir` - makes a directory

## Some other useful utilities:

`gcc` - the gnu c compiler `nedit` - simple visual editior

## Directory shortcuts:

`~` - your home directory
`~aca319` - units homedirectory
`..` - a previous directory
`.` - current directory

## Wildcards:

They work bit like in dos, but much more powerful expressions can be created. To start with,
`*` is everything
`?` is single character.
etc.

## Some Examples of Usage:

`cp ~aca319/source/test.c .`
Copies the test.c file from the units directory to your current working directory (cwd)

`cp ~aca319/doc/Lab1.pdf ~/aca319/`
Copies the lab manual to a directory aca319 in your home directory

`rm test.bak`
[removes the test.bak from cwd]

`rm *`
removes everything from cwd ... use with caution

`mv test.c test.bak`
renames test.c into test.bak

`ls *.c`
Shows the listing of all the C files in the current directory.

`mkdir aca319
cd aca319
cd ..`
creates a subdirectory aca319, goes into it and goes out

`gcc -o test test.c`
compiles test.c and makes an executable test BE AWARE: test is also a unix command so to execute the one you have created you will have to use ./test (generally to execute the programs from your current working directory you will have to use ./file where ./ just means current directory)

`man man` display the manual page for the man utility

`nedit test.c &`
Opens editing session for test.c as a separate process, so that you can still use your Unix shell.

For more info use man, surf the web, or get a unix book.