2018-11-12 08:33:03 +00:00
|
|
|
---
|
|
|
|
layout: page
|
|
|
|
category-page: fs
|
2018-11-12 10:47:50 +00:00
|
|
|
category-title: FileSystem
|
2018-11-12 08:33:03 +00:00
|
|
|
tags: working directory current position where
|
|
|
|
author: Mirko Ponzio
|
2018-11-12 10:47:50 +00:00
|
|
|
title: pwd
|
2018-11-18 20:38:56 +00:00
|
|
|
previous-page: pages/fs/mv.html
|
|
|
|
next-page: pages/fs/relative.html
|
2018-11-12 08:33:03 +00:00
|
|
|
---
|
2018-11-12 12:46:51 +00:00
|
|
|
|
2018-11-16 19:47:01 +00:00
|
|
|
<!-- Co-authored with Joy Albertini -->
|
|
|
|
|
2018-11-12 10:47:50 +00:00
|
|
|
The command <code>pwd</code>(abbreviation of print working directory, it returns the
|
2018-11-16 19:47:01 +00:00
|
|
|
corrent directory) it is a command, that show the absolute pathname on the corrent directory.<br>
|
2018-11-12 10:47:50 +00:00
|
|
|
|
2018-11-12 08:57:00 +00:00
|
|
|
The working directory is the directory where you are standing in. So for
|
2018-11-16 19:47:01 +00:00
|
|
|
knowing where you are, you can use the pwd command.<br>
|
2018-11-12 08:33:03 +00:00
|
|
|
|
2018-11-16 19:47:01 +00:00
|
|
|
<pre>
|
|
|
|
cd /home/user
|
|
|
|
pwd = /home/user
|
|
|
|
</pre>
|
2018-11-12 08:33:03 +00:00
|
|
|
|
2018-11-12 10:47:50 +00:00
|
|
|
<h3>Flags</h3>
|
2018-11-16 19:47:01 +00:00
|
|
|
|
2018-11-12 08:57:00 +00:00
|
|
|
<ul>
|
2018-11-16 19:47:01 +00:00
|
|
|
<li><code>-P </code> Show the working directory path without symbolic link (links to
|
|
|
|
folder).<br>
|
|
|
|
Example: <i>/home/symphoto</i> a symlink to <i>/home/photos</i> <code>pwd -P</code>
|
|
|
|
will display <i>/home/photos</i>.
|
|
|
|
</li>
|
|
|
|
<li><code>-L </code> Show the working directory logical path with symbolic link.<br>
|
|
|
|
Example: <i>/home/symphoto</i>, that redirect to <i>/home/photos</i>,
|
|
|
|
<code>pwd -L</code> will show <i>/home/symphoto</i>.
|
|
|
|
</li>
|
|
|
|
<li>Without any flag, -L is assumed, so the normal pwd is in reality <code>pwd -L</code>.</li>
|
2018-11-12 08:57:00 +00:00
|
|
|
</ul>
|