1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143
|
<html lang="en">
<head>
<title>Current Working Directory - Untitled</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="Untitled">
<meta name="generator" content="makeinfo 4.11">
<link title="Top" rel="start" href="index.html#Top">
<link rel="up" href="System-Utilities.html#System-Utilities" title="System Utilities">
<link rel="prev" href="Environment-Variables.html#Environment-Variables" title="Environment Variables">
<link rel="next" href="Password-Database-Functions.html#Password-Database-Functions" title="Password Database Functions">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
pre.display { font-family:inherit }
pre.format { font-family:inherit }
pre.smalldisplay { font-family:inherit; font-size:smaller }
pre.smallformat { font-family:inherit; font-size:smaller }
pre.smallexample { font-size:smaller }
pre.smalllisp { font-size:smaller }
span.sc { font-variant:small-caps }
span.roman { font-family:serif; font-weight:normal; }
span.sansserif { font-family:sans-serif; font-weight:normal; }
--></style>
</head>
<body>
<div class="node">
<p>
<a name="Current-Working-Directory"></a>
Next: <a rel="next" accesskey="n" href="Password-Database-Functions.html#Password-Database-Functions">Password Database Functions</a>,
Previous: <a rel="previous" accesskey="p" href="Environment-Variables.html#Environment-Variables">Environment Variables</a>,
Up: <a rel="up" accesskey="u" href="System-Utilities.html#System-Utilities">System Utilities</a>
<hr>
</div>
<h3 class="section">34.8 Current Working Directory</h3>
<!-- dirfns.cc -->
<p><a name="doc_002dcd"></a>
<div class="defun">
— Command: <b>cd</b><var> dir<a name="index-cd-2425"></a></var><br>
— Command: <b>chdir</b><var> dir<a name="index-chdir-2426"></a></var><br>
<blockquote><p>Change the current working directory to <var>dir</var>. If <var>dir</var> is
omitted, the current directory is changed to the user's home
directory. For example,
<pre class="example"> cd ~/octave
</pre>
<p class="noindent">Changes the current working directory to <samp><span class="file">~/octave</span></samp>. If the
directory does not exist, an error message is printed and the working
directory is not changed.
<!-- Texinfo @sp should work but in practice produces ugly results for HTML. -->
<!-- A simple blank line produces the correct behavior. -->
<!-- @sp 1 -->
<p class="noindent"><strong>See also:</strong> <a href="doc_002dmkdir.html#doc_002dmkdir">mkdir</a>, <a href="doc_002drmdir.html#doc_002drmdir">rmdir</a>, <a href="doc_002ddir.html#doc_002ddir">dir</a>.
</p></blockquote></div>
<!-- ./miscellaneous/ls.m -->
<p><a name="doc_002dls"></a>
<div class="defun">
— Command: <b>ls</b><var> options<a name="index-ls-2427"></a></var><br>
<blockquote><p>List directory contents. For example,
<pre class="example"> ls -l
-| total 12
-| -rw-r--r-- 1 jwe users 4488 Aug 19 04:02 foo.m
-| -rw-r--r-- 1 jwe users 1315 Aug 17 23:14 bar.m
</pre>
<p>The <code>dir</code> and <code>ls</code> commands are implemented by calling your
system's directory listing command, so the available options may vary
from system to system.
<!-- Texinfo @sp should work but in practice produces ugly results for HTML. -->
<!-- A simple blank line produces the correct behavior. -->
<!-- @sp 1 -->
<p class="noindent"><strong>See also:</strong> <a href="doc_002ddir.html#doc_002ddir">dir</a>, <a href="doc_002dstat.html#doc_002dstat">stat</a>, <a href="doc_002dreaddir.html#doc_002dreaddir">readdir</a>, <a href="doc_002dglob.html#doc_002dglob">glob</a>, <a href="doc_002dfilesep.html#doc_002dfilesep">filesep</a>, <a href="doc_002dls_005fcommand.html#doc_002dls_005fcommand">ls_command</a>.
</p></blockquote></div>
<!-- ./miscellaneous/ls_command.m -->
<p><a name="doc_002dls_005fcommand"></a>
<div class="defun">
— Function File: [<var>old_cmd</var> = <b>ls_command</b> (<var>cmd</var>)<var><a name="index-ls_005fcommand-2428"></a></var><br>
<blockquote><p>Set or return the shell command used by Octave's <code>ls</code> command.
The value of <var>cmd</var> must be a character string.
With no arguments, simply return the previous value.
<!-- Texinfo @sp should work but in practice produces ugly results for HTML. -->
<!-- A simple blank line produces the correct behavior. -->
<!-- @sp 1 -->
<p class="noindent"><strong>See also:</strong> <a href="doc_002dls.html#doc_002dls">ls</a>.
</p></blockquote></div>
<!-- ./miscellaneous/dir.m -->
<p><a name="doc_002ddir"></a>
<div class="defun">
— Function File: <b>dir</b> (<var>directory</var>)<var><a name="index-dir-2429"></a></var><br>
— Function File: [<var>list</var>] = <b>dir</b> (<var>directory</var>)<var><a name="index-dir-2430"></a></var><br>
<blockquote><p>Display file listing for directory <var>directory</var>. If a return
value is requested, return a structure array with the fields
<pre class="example"> name
bytes
date
isdir
statinfo
</pre>
<p class="noindent">in which <code>statinfo</code> is the structure returned from <code>stat</code>.
<p>If <var>directory</var> is not a directory, return information about the
named <var>filename</var>. <var>directory</var> may be a list of directories
specified either by name or with wildcard characters (like * and ?)
which will be expanded with glob.
<p>Note that for symbolic links, <code>dir</code> returns information about
the file that a symbolic link points to instead of the link itself.
However, if the link points to a nonexistent file, <code>dir</code> returns
information about the link.
<!-- Texinfo @sp should work but in practice produces ugly results for HTML. -->
<!-- A simple blank line produces the correct behavior. -->
<!-- @sp 1 -->
<p class="noindent"><strong>See also:</strong> <a href="doc_002dls.html#doc_002dls">ls</a>, <a href="doc_002dstat.html#doc_002dstat">stat</a>, <a href="doc_002dlstat.html#doc_002dlstat">lstat</a>, <a href="doc_002dreaddir.html#doc_002dreaddir">readdir</a>, <a href="doc_002dglob.html#doc_002dglob">glob</a>, <a href="doc_002dfilesep.html#doc_002dfilesep">filesep</a>.
</p></blockquote></div>
<!-- dirfns.cc -->
<p><a name="doc_002dpwd"></a>
<div class="defun">
— Built-in Function: <b>pwd</b> ()<var><a name="index-pwd-2431"></a></var><br>
<blockquote><p>Return the current working directory.
<!-- Texinfo @sp should work but in practice produces ugly results for HTML. -->
<!-- A simple blank line produces the correct behavior. -->
<!-- @sp 1 -->
<p class="noindent"><strong>See also:</strong> <a href="doc_002ddir.html#doc_002ddir">dir</a>, <a href="doc_002dls.html#doc_002dls">ls</a>.
</p></blockquote></div>
</body></html>
|