maggicl
c42605294d
git-svn-id: svn+ssh://atelier.inf.usi.ch/home/bevilj/group-1@255 a672b425-5310-4d7a-af5c-997e18724b81
51 lines
1.2 KiB
HTML
51 lines
1.2 KiB
HTML
---
|
|
layout: page
|
|
category-page: fs
|
|
category-title: FileSystem
|
|
tags: change directory
|
|
author: Alessandro Marinelli
|
|
title: cd
|
|
previous-page: pages/fs/absolute.html
|
|
next-page: pages/fs/du.html
|
|
---
|
|
|
|
<!-- Co-authored with Mirko Ponzio -->
|
|
|
|
<p>
|
|
The <code>cd</code> command is used to change the working directory<br/>
|
|
The name stands for <i>Change Directory</i>.<br/>
|
|
|
|
The default cd command syntax is:
|
|
</p>
|
|
|
|
<pre>
|
|
cd [flags] [path]
|
|
</pre>
|
|
|
|
<p>
|
|
Where [flags] are the cd flags, read below for more info,and [path] is the
|
|
path (absolute or relative), of the directory which we want to make as working directory.
|
|
</p>
|
|
|
|
<h3>Change the working directory</h3>
|
|
<p>
|
|
Let's see how to use the command <code>cd</code> in order to change the working directory:
|
|
</p>
|
|
|
|
<pre>
|
|
pwd
|
|
~
|
|
cd Desktop/multimedia
|
|
pwd
|
|
~/Desktop/multimedia
|
|
</pre>
|
|
|
|
<p>
|
|
As you can see, we changed the working directory from ~ (which stands for HOME),
|
|
to "multimedia". Now our Shell will work on the directory "multimedia"
|
|
until a new <code>cd</code> will occour.</p>
|
|
|
|
<p>
|
|
<b>Notice:</b> If you want to move to a directory which is not contained in the
|
|
current working directory, you <u>MUST</u> use the absolute path.
|
|
</p>
|