File: Current-Working-Directory.html

package info (click to toggle)
octave 3.6.2-5%2Bdeb7u1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 71,636 kB
  • sloc: cpp: 241,186; fortran: 23,651; sh: 14,790; ansic: 7,153; lex: 3,761; objc: 3,404; yacc: 3,386; makefile: 2,073; awk: 985; perl: 838
file content (142 lines) | stat: -rw-r--r-- 7,123 bytes parent folder | download
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
<html lang="en">
<head>
<title>Current Working Directory - GNU Octave</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="GNU Octave">
<meta name="generator" content="makeinfo 4.13">
<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">
<a name="Current-Working-Directory"></a>
<p>
Next:&nbsp;<a rel="next" accesskey="n" href="Password-Database-Functions.html#Password-Database-Functions">Password Database Functions</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="Environment-Variables.html#Environment-Variables">Environment Variables</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="System-Utilities.html#System-Utilities">System Utilities</a>
<hr>
</div>

<h3 class="section">36.8 Current Working Directory</h3>

<!-- cd src/dirfns.cc -->
<p><a name="doc_002dcd"></a>

<div class="defun">
&mdash; Command:  <b>cd</b><var> dir<a name="index-cd-3305"></a></var><br>
&mdash; Command:  <b>chdir</b><var> dir<a name="index-chdir-3306"></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>

<!-- ls scripts/miscellaneous/ls.m -->
   <p><a name="doc_002dls"></a>

<div class="defun">
&mdash; Command:  <b>ls</b><var> options<a name="index-ls-3307"></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>

<!-- ls_command scripts/miscellaneous/ls_command.m -->
   <p><a name="doc_002dls_005fcommand"></a>

<div class="defun">
&mdash; Function File: <var>val</var> = <b>ls_command</b> ()<var><a name="index-ls_005fcommand-3308"></a></var><br>
&mdash; Function File: <var>old_val</var> = <b>ls_command</b> (<var>new_val</var>)<var><a name="index-ls_005fcommand-3309"></a></var><br>
<blockquote><p>Query or set the shell command used by Octave's <code>ls</code> command. 
<!-- 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>

<!-- dir scripts/miscellaneous/dir.m -->
   <p><a name="doc_002ddir"></a>

<div class="defun">
&mdash; Function File:  <b>dir</b> (<var>directory</var>)<var><a name="index-dir-3310"></a></var><br>
&mdash; Function File: [<var>list</var>] = <b>dir</b> (<var>directory</var>)<var><a name="index-dir-3311"></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">where <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 the 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>

<!-- pwd src/dirfns.cc -->
   <p><a name="doc_002dpwd"></a>

<div class="defun">
&mdash; Built-in Function:  <b>pwd</b> ()<var><a name="index-pwd-3312"></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>