24.12.2012 Views

CSC322 C Programming and UNIX - Department of Computer ...

CSC322 C Programming and UNIX - Department of Computer ...

CSC322 C Programming and UNIX - Department of Computer ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Moving Through the File System<br />

We can use the comm<strong>and</strong> cd to change our working directory:<br />

[schulz@gettysburg ∼]$ pwd<br />

/lee/home/graph/schulz<br />

cd /<br />

[schulz@gettysburg /]$ pwd<br />

/<br />

[schulz@gettysburg /]$ cd bin<br />

[schulz@gettysburg /bin]$ pwd<br />

/bin<br />

[schulz@gettysburg /bin]$ cd /lee/home/graph/schulz<br />

[schulz@gettysburg ∼]$ pwd<br />

/lee/home/graph/schulz<br />

Each directory contains two special entries: . <strong>and</strong> ..<br />

– . represents the directory itself. cd . is a NOP<br />

– .. normally represents the parent directory. cd .. moves the working directory<br />

up one level. In /, .. points to / itself<br />

Stephan Schulz 34

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!