home *** CD-ROM | disk | FTP | other *** search
/ Solo Programadores 21 / SOLOPROG21.iso / utillnux / info-htm / fileutil.000 < prev    next >
Encoding:
Text File  |  1996-04-02  |  97.1 KB  |  2,782 lines

  1. <HTML>
  2. <HEAD>
  3. <!-- This HTML file has been created by TEXI.HTM 1.31
  4.      from /usr/src/file-utilities/fileutils-3.12/doc/fileutils.texi on 8 June 1995 -->
  5.  
  6. <TITLE>GNU fileutils, version GNU fileutils 3.12</TITLE>
  7. </HEAD>
  8. <BODY>
  9. <H1>GNU fileutils, version GNU fileutils 3.12</H1>
  10. <P>
  11. @defcodeindex op
  12. <P>
  13. Copyright (C) 1994 Free Software Foundation, Inc.
  14. <P>
  15. Permission is granted to make and distribute verbatim copies of
  16. this manual provided the copyright notice and this permission notice
  17. are preserved on all copies.
  18. <P>
  19. Permission is granted to copy and distribute modified versions of this
  20. manual under the conditions for verbatim copying, provided that the entire
  21. resulting derived work is distributed under the terms of a permission
  22. notice identical to this one.
  23. <P>
  24. Permission is granted to copy and distribute translations of this manual
  25. into another language, under the above conditions for modified versions,
  26. except that this permission notice may be stated in a translation approved
  27. by the Foundation.
  28. <P>
  29. <H1><A NAME="SEC1" HREF="FILEUTIL.HTM#SEC1">Introduction</A></H1>
  30. <A NAME="IDX1"></A>
  31. <P>
  32. This manual is incomplete: No attempt is made to explain basic file
  33. concepts in a way suitable for novices.  Thus, if you are interested,
  34. please get involved in improving this manual.  The entire GNU community
  35. will benefit.
  36. <A NAME="IDX2"></A>
  37. <P>
  38. The GNU file utilities are mostly compatible with the POSIX.2 standard.
  39. <A NAME="IDX3"></A>
  40. <P>
  41. Please report bugs to <SAMP>`bug-gnu-utils@prep.ai.mit.edu'</SAMP>.  Remember
  42. to include the version number, machine architecture, input files, and
  43. any other information needed to reproduce the bug.  See section `Bugs' in <CITE>GNU CC</CITE>.
  44. <A NAME="IDX4"></A>
  45. <P>
  46. This manual is based on the Unix man pages in the distribution, which
  47. were originally written by David MacKenzie and updated by Jim Meyering.
  48.   Pinard did the initial conversion to Texinfo format.
  49. Karl Berry did the indexing, some reorganization, and editing of the results.
  50. Richard Stallman contributed his usual invaluable insights to the
  51. overall process.
  52. <P>
  53. <H1><A NAME="SEC2" HREF="FILEUTIL.HTM#SEC2">Common options</A></H1>
  54. <A NAME="IDX5"></A>
  55. <P>
  56. Certain options are available in all these programs.  Rather than
  57. writing identical descriptions for each of the programs, they are
  58. described here.  (In fact, every GNU program accepts (or should accept)
  59. these options.)
  60. <P>
  61. <DL COMPACT>
  62.  
  63. <DT><SAMP>`--help'</SAMP>
  64. <DD>@opindex --help
  65. <A NAME="IDX6"></A>
  66. Print a usage message listing all available options, then exit successfully.
  67.  
  68. <DT><SAMP>`--version'</SAMP>
  69. <DD>@opindex --version
  70. <A NAME="IDX7"></A>
  71. Print the version number, then exit successfully.
  72.  
  73. </DL>
  74. <P>
  75. <H2><A NAME="SEC3" HREF="FILEUTIL.HTM#SEC3">Backup options</A></H2>
  76. <A NAME="IDX8"></A>
  77. <P>
  78. Some GNU programs (at least <CODE>cp</CODE>, <CODE>mv</CODE>, and <CODE>ln</CODE>)
  79. optionally make backups of files before writing new versions.  These
  80. options control the details of these backups.  The options are also
  81. briefly mentioned in the descriptions of the particular programs.
  82. <P>
  83. <DL COMPACT>
  84.  
  85. <DT><SAMP>`-b'</SAMP>
  86. <DD><DT><SAMP>`--backup'</SAMP>
  87. <DD>@opindex -b
  88. @opindex --backup
  89. <A NAME="IDX9"></A>
  90. Make backups of files that are about to be overwritten or removed.
  91. Without this option, the original versions are destroyed.
  92.  
  93. <DT><SAMP>`-S <VAR>suffix</VAR>'</SAMP>
  94. <DD><DT><SAMP>`--suffix=<VAR>suffix</VAR>'</SAMP>
  95. <DD>@opindex -S
  96. @opindex --suffix
  97. <A NAME="IDX11"></A>
  98. <A NAME="IDX10"></A>
  99. Append <VAR>suffix</VAR> to each backup file made with <SAMP>`-b'</SAMP>.  If this
  100. option is not specified, the value of the <CODE>SIMPLE_BACKUP_SUFFIX</CODE>
  101. environment variable is used.  And if <CODE>SIMPLE_BACKUP_SUFFIX</CODE> is not
  102. set, the default is <SAMP>`~'</SAMP>, just as in Emacs.
  103.  
  104. <DT><SAMP>`-V <VAR>method</VAR>'</SAMP>
  105. <DD><DT><SAMP>`--version-control=<VAR>method</VAR>'</SAMP>
  106. <DD>@opindex -V
  107. @opindex --version-control
  108. <A NAME="IDX13"></A>
  109. <A NAME="IDX12"></A>
  110. Use <VAR>method</VAR> to determine the type of backups made with <SAMP>`-b'</SAMP>.
  111. If this option is not specified, the value of the <CODE>VERSION_CONTROL</CODE>
  112. environment variable is used.  And if <CODE>VERSION_CONTROL</CODE> is not set,
  113. the default backup type is <SAMP>`existing'</SAMP>.
  114.  
  115. <A NAME="IDX14"></A>
  116. This option corresponds to the Emacs variable <SAMP>`version-control'</SAMP>;
  117. the same values for <VAR>method</VAR> are accepted as in Emacs.  This options
  118. also more descriptive name.  The valid <VAR>method</VAR>s (unique
  119. abbreviations are accepted):
  120.  
  121. <DL COMPACT>
  122. <DT><SAMP>`t'</SAMP>
  123. <DD><DT><SAMP>`numbered'</SAMP>
  124. <DD>@opindex numbered backup method
  125. Always make numbered backups.
  126.  
  127. <DT><SAMP>`nil'</SAMP>
  128. <DD><DT><SAMP>`existing'</SAMP>
  129. <DD>@opindex existing backup method
  130. Make numbered backups of files that already have them, simple backups
  131. of the others.
  132.  
  133. <DT><SAMP>`never'</SAMP>
  134. <DD><DT><SAMP>`simple'</SAMP>
  135. <DD>@opindex simple backup method
  136. Always make simple backups.
  137.  
  138. </DL>
  139.  
  140. </DL>
  141. <P>
  142. <H1><A NAME="SEC4" HREF="FILEUTIL.HTM#SEC4">File permissions</A></H1>
  143. <A NAME="IDX15"></A>
  144. <A NAME="IDX16"></A>
  145. <P>
  146. Each file has a set of <DFN>permissions</DFN> that control the kinds of
  147. access that users have to that file.  The permissions for a file are
  148. also called its <DFN>access mode</DFN>.  They can be represented either in
  149. symbolic form or as an octal number.
  150. <P>
  151. <H2><A NAME="SEC5" HREF="FILEUTIL.HTM#SEC5">Structure of File Permissions</A></H2>
  152. <P>
  153. There are three kinds of permissions that a user can have for a file:
  154. <P>
  155. <OL>
  156. <A NAME="IDX17"></A>
  157. <LI>
  158. permission to read the file.  For directories, this means permission to
  159. list the contents of the directory.
  160. <A NAME="IDX18"></A>
  161. <LI>
  162. permission to write to (change) the file.  For directories, this means
  163. permission to create and remove files in the directory.
  164. <A NAME="IDX19"></A>
  165. <LI>
  166. permission to execute the file (run it as a program).  For directories,
  167. this means permission to access files in the directory.
  168. </OL>
  169. <P>
  170. There are three categories of users who may have different permissions
  171. to perform any of the above operations on a file:
  172. <P>
  173. <OL>
  174. <LI>
  175. the file's owner;
  176. <LI>
  177. other users who are in the file's group;
  178. <LI>
  179. everyone else.
  180. </OL>
  181. <A NAME="IDX20"></A>
  182. <A NAME="IDX21"></A>
  183. <P>
  184. Files are given an owner and group when they are created.  Usually the
  185. owner is the current user and the group is the group of the directory
  186. the file is in, but this varies with the operating system, the
  187. filesystem the file is created on, and the way the file is created.  You
  188. can change the owner and group of a file by using the <CODE>chown</CODE> and
  189. <CODE>chgrp</CODE> commands.
  190. <P>
  191. In addition to the three sets of three permissions listed above, a
  192. file's permissions have three special components, which affect only
  193. executable files (programs) and, on some systems, directories:
  194. <P>
  195. <OL>
  196. <A NAME="IDX22"></A>
  197. <LI>
  198. set the process's effective user ID to that of the file upon execution
  199. (called the <DFN>setuid bit</DFN>).  No effect on directories.
  200. <A NAME="IDX23"></A>
  201. <LI>
  202. set the process's effective group ID to that of the file upon execution
  203. (called the <DFN>setgid bit</DFN>).  For directories on some systems, put
  204. files created in the directory into the same group as the directory, no
  205. matter what group the user who creates them is in.
  206. <A NAME="IDX24"></A>
  207. <A NAME="IDX25"></A>
  208. <A NAME="IDX26"></A>
  209. <A NAME="IDX27"></A>
  210. <LI>
  211. save the program's text image on the swap device so it will load more
  212. quickly when run (called the <DFN>sticky bit</DFN>).  For directories on some
  213. systems, prevent users from removing files that they do not own in the
  214. directory; this is called making the directory <DFN>append-only</DFN>.
  215. </OL>
  216. <P>
  217. <H2><A NAME="SEC6" HREF="FILEUTIL.HTM#SEC6">Symbolic Modes</A></H2>
  218. <A NAME="IDX28"></A>
  219. <P>
  220. <DFN>Symbolic modes</DFN> represent changes to files' permissions as
  221. operations on single-character symbols.  They allow you to modify either
  222. all or selected parts of files' permissions, optionally based on
  223. their previous values, and perhaps on the current <CODE>umask</CODE> as well
  224. (see section <A HREF="FILEUTIL.000#SEC12">The Umask and Protection</A>).
  225. <P>
  226. The format of symbolic modes is:
  227. <P>
  228. <PRE>
  229. [ugoa...][[+-=][rwxXstugo...]...][,...]
  230. </PRE>
  231. <P>
  232. The following sections describe the operators and other details of
  233. symbolic modes.
  234. <P>
  235. <H3><A NAME="SEC7" HREF="FILEUTIL.HTM#SEC7">Setting Permissions</A></H3>
  236. <P>
  237. The basic symbolic operations on a file's permissions are adding,
  238. removing, and setting the permission that certain users have to read,
  239. write, and execute the file.  These operations have the following
  240. format:
  241. <P>
  242. <PRE>
  243. <VAR>users</VAR> <VAR>operation</VAR> <VAR>permissions</VAR>
  244. </PRE>
  245. <P>
  246. The spaces between the three parts above are shown for readability only;
  247. symbolic modes can not contain spaces.
  248. <P>
  249. The <VAR>users</VAR> part tells which users' access to the file is changed.
  250. It consists of one or more of the following letters (or it can be empty;
  251. see section <A HREF="FILEUTIL.000#SEC12">The Umask and Protection</A>, for a description of what happens then).  When
  252. more than one of these letters is given, the order that they are in does
  253. not matter.
  254. <P>
  255. <DL COMPACT>
  256. <A NAME="IDX29"></A>
  257. <DT><CODE>u</CODE>
  258. <DD>the user who owns the file;
  259. <A NAME="IDX30"></A>
  260. <DT><CODE>g</CODE>
  261. <DD>other users who are in the file's group;
  262. <A NAME="IDX31"></A>
  263. <DT><CODE>o</CODE>
  264. <DD>all other users;
  265. <DT><CODE>a</CODE>
  266. <DD>all users; the same as <SAMP>`ugo'</SAMP>.
  267. </DL>
  268. <P>
  269. The <VAR>operation</VAR> part tells how to change the affected users' access
  270. to the file, and is one of the following symbols:
  271. <P>
  272. <DL COMPACT>
  273. <A NAME="IDX32"></A>
  274. <DT><CODE>+</CODE>
  275. <DD>to add the <VAR>permissions</VAR> to whatever permissions the <VAR>users</VAR>
  276. already have for the file;
  277. <A NAME="IDX33"></A>
  278. <A NAME="IDX34"></A>
  279. <DT><CODE>-</CODE>
  280. <DD>to remove the <VAR>permissions</VAR> from whatever permissions the
  281. <VAR>users</VAR> already have for the file;
  282. <A NAME="IDX35"></A>
  283. <DT><CODE>=</CODE>
  284. <DD>to make the <VAR>permissions</VAR> the only permissions that the <VAR>users</VAR>
  285. have for the file.
  286. </DL>
  287. <P>
  288. The <VAR>permissions</VAR> part tells what kind of access to the file should
  289. be changed; it is zero or more of the following letters.  As with the
  290. <VAR>users</VAR> part, the order does not matter when more than one letter is
  291. given.  Omitting the <VAR>permissions</VAR> part is useful only with the
  292. <SAMP>`='</SAMP> operation, where it gives the specified <VAR>users</VAR> no access
  293. at all to the file.
  294. <P>
  295. <DL COMPACT>
  296. <A NAME="IDX36"></A>
  297. <DT><CODE>r</CODE>
  298. <DD>the permission the <VAR>users</VAR> have to read the file;
  299. <A NAME="IDX37"></A>
  300. <DT><CODE>w</CODE>
  301. <DD>the permission the <VAR>users</VAR> have to write to the file;
  302. <A NAME="IDX38"></A>
  303. <DT><CODE>x</CODE>
  304. <DD>the permission the <VAR>users</VAR> have to execute the file.
  305. </DL>
  306. <P>
  307. For example, to give everyone permission to read and write a file,
  308. but not to execute it, use:
  309. <P>
  310. <PRE>
  311. a=rw
  312. </PRE>
  313. <P>
  314. To remove write permission for from all users other than the file's
  315. owner, use:
  316. <P>
  317. <PRE>
  318. go-w
  319. </PRE>
  320. <P>
  321. The above command does not affect the access that the owner of
  322. the file has to it, nor does it affect whether other users can
  323. read or execute the file.
  324. <P>
  325. To give everyone except a file's owner no permission to do anything with
  326. that file, use the mode below.  Other users could still remove the file,
  327. if they have write permission on the directory it is in.
  328. <P>
  329. <PRE>
  330. go=
  331. </PRE>
  332. <P>
  333. Another way to specify the same thing is:
  334. <P>
  335. <PRE>
  336. og-rxw
  337. </PRE>
  338. <P>
  339. <H3><A NAME="SEC8" HREF="FILEUTIL.HTM#SEC8">Copying Existing Permissions</A></H3>
  340. <A NAME="IDX39"></A>
  341. <A NAME="IDX40"></A>
  342. <P>
  343. You can base part of a file's permissions on part of its existing
  344. permissions.  To do this, instead of using <SAMP>`r'</SAMP>, <SAMP>`w'</SAMP>, or
  345. <SAMP>`x'</SAMP> after the operator, you use the letter <SAMP>`u'</SAMP>, <SAMP>`g'</SAMP>, or
  346. <SAMP>`o'</SAMP>.  For example, the mode
  347. <P>
  348. <PRE>
  349. o+g
  350. </PRE>
  351. <P>
  352. adds the permissions for users who are in a file's group to the
  353. permissions that other users have for the file.  Thus, if the file
  354. started out as mode 664 (<SAMP>`rw-rw-r--'</SAMP>), the above mode would change
  355. it to mode 666 (<SAMP>`rw-rw-rw-'</SAMP>).  If the file had started out as mode
  356. 741 (<SAMP>`rwxr----x'</SAMP>), the above mode would change it to mode 745
  357. (<SAMP>`rwxr--r-x'</SAMP>).  The <SAMP>`-'</SAMP> and <SAMP>`='</SAMP> operations work
  358. analogously.
  359. <P>
  360. <H3><A NAME="SEC9" HREF="FILEUTIL.HTM#SEC9">Changing Special Permissions</A></H3>
  361. <A NAME="IDX41"></A>
  362. <P>
  363. In addition to changing a file's read, write, and execute permissions,
  364. you can change its special permissions.  See section <A HREF="FILEUTIL.000#SEC5">Structure of File Permissions</A>, for a
  365. summary of these permissions.
  366. <P>
  367. To change a file's permission to set the user ID on execution, use
  368. <SAMP>`u'</SAMP> in the <VAR>users</VAR> part of the symbolic mode and
  369. <SAMP>`s'</SAMP> in the <VAR>permissions</VAR> part.
  370. <P>
  371. To change a file's permission to set the group ID on execution, use
  372. <SAMP>`g'</SAMP> in the <VAR>users</VAR> part of the symbolic mode and
  373. <SAMP>`s'</SAMP> in the <VAR>permissions</VAR> part.
  374. <P>
  375. To change a file's permission to stay permanently on the swap device,
  376. use <SAMP>`o'</SAMP> in the <VAR>users</VAR> part of the symbolic mode and
  377. <SAMP>`t'</SAMP> in the <VAR>permissions</VAR> part.
  378. <P>
  379. For example, to add set user ID permission to a program,
  380. you can use the mode:
  381. <P>
  382. <PRE>
  383. u+s
  384. </PRE>
  385. <P>
  386. To remove both set user ID and set group ID permission from
  387. it, you can use the mode:
  388. <P>
  389. <PRE>
  390. ug-s
  391. </PRE>
  392. <P>
  393. To cause a program to be saved on the swap device, you can use
  394. the mode:
  395. <P>
  396. <PRE>
  397. o+t
  398. </PRE>
  399. <P>
  400. Remember that the special permissions only affect files that are
  401. executable, plus, on some systems, directories (on which they have
  402. different meanings; see section <A HREF="FILEUTIL.000#SEC5">Structure of File Permissions</A>).  Using <SAMP>`a'</SAMP>
  403. in the <VAR>users</VAR> part of a symbolic mode does not cause the special
  404. permissions to be affected; thus,
  405. <P>
  406. <PRE>
  407. a+s
  408. </PRE>
  409. <P>
  410. has <EM>no effect</EM>.  You must use <SAMP>`u'</SAMP>, <SAMP>`g'</SAMP>, and <SAMP>`o'</SAMP>
  411. explicitly to affect the special permissions.  Also, the
  412. combinations <SAMP>`u+t'</SAMP>, <SAMP>`g+t'</SAMP>, and <SAMP>`o+s'</SAMP> have no effect.
  413. <P>
  414. The <SAMP>`='</SAMP> operator is not very useful with special permissions; for
  415. example, the mode:
  416. <P>
  417. <PRE>
  418. o=t
  419. </PRE>
  420. <P>
  421. does cause the file to be saved on the swap device, but it also
  422. removes all read, write, and execute permissions that users not in the
  423. file's group might have had for it.
  424. <P>
  425. <H3><A NAME="SEC10" HREF="FILEUTIL.HTM#SEC10">Conditional Executability</A></H3>
  426. <A NAME="IDX42"></A>
  427. <P>
  428. There is one more special type of symbolic permission: if you use
  429. <SAMP>`X'</SAMP> instead of <SAMP>`x'</SAMP>, execute permission is affected only if the
  430. file already had execute permission or is a directory.  It affects
  431. directories' execute permission even if they did not initially have any
  432. execute permissions set.
  433. <P>
  434. For example, this mode:
  435. <P>
  436. <PRE>
  437. a+X
  438. </PRE>
  439. <P>
  440. gives all users permission to execute files (or search directories) if
  441. anyone could before.
  442. <P>
  443. <H3><A NAME="SEC11" HREF="FILEUTIL.HTM#SEC11">Making Multiple Changes</A></H3>
  444. <A NAME="IDX43"></A>
  445. <P>
  446. The format of symbolic modes is actually more complex than described
  447. above (see section <A HREF="FILEUTIL.000#SEC7">Setting Permissions</A>).  It provides two ways to make
  448. multiple changes to files' permissions.
  449. <P>
  450. The first way is to specify multiple <VAR>operation</VAR> and
  451. <VAR>permissions</VAR> parts after a <VAR>users</VAR> part in the symbolic mode.
  452. <P>
  453. For example, the mode:
  454. <P>
  455. <PRE>
  456. og+rX-w
  457. </PRE>
  458. <P>
  459. gives users other than the owner of the file read permission and, if
  460. it is a directory or if someone already had execute permission
  461. to it, gives them execute permission; and it also denies them write
  462. permission to it file.  It does not affect the permission that the
  463. owner of the file has for it.  The above mode is equivalent to
  464. the two modes:
  465. <P>
  466. <PRE>
  467. og+rX
  468. og-w
  469. </PRE>
  470. <P>
  471. The second way to make multiple changes is to specify more than one
  472. simple symbolic mode, separated by commas.  For example, the mode:
  473. <P>
  474. <PRE>
  475. a+r,go-w
  476. </PRE>
  477. <P>
  478. gives everyone permission to read the file and removes write
  479. permission on it for all users except its owner.  Another example:
  480. <P>
  481. <PRE>
  482. u=rwx,g=rx,o=
  483. </PRE>
  484. <P>
  485. sets all of the non-special permissions for the file explicitly.  (It
  486. gives users who are not in the file's group no permission at all for
  487. it.)
  488. <P>
  489. The two methods can be combined.  The mode:
  490. <P>
  491. <PRE>
  492. a+r,g+x-w
  493. </PRE>
  494. <P>
  495. gives all users permission to read the file, and gives users who are in
  496. the file's group permission to execute it, as well, but not permission
  497. to write to it.  The above mode could be written in several different
  498. ways; another is:
  499. <P>
  500. <PRE>
  501. u+r,g+rx,o+r,g-w
  502. </PRE>
  503. <P>
  504. <H3><A NAME="SEC12" HREF="FILEUTIL.HTM#SEC12">The Umask and Protection</A></H3>
  505. <A NAME="IDX44"></A>
  506. <A NAME="IDX45"></A>
  507. <P>
  508. If the <VAR>users</VAR> part of a symbolic mode is omitted, it defaults to
  509. <SAMP>`a'</SAMP> (affect all users), except that any permissions that are
  510. <EM>set</EM> in the system variable <CODE>umask</CODE> are <EM>not affected</EM>.
  511. The value of <CODE>umask</CODE> can be set using the
  512. <CODE>umask</CODE> command.  Its default value varies from system to system.
  513. <A NAME="IDX46"></A>
  514. <P>
  515. Omitting the <VAR>users</VAR> part of a symbolic mode is generally not useful
  516. with operations other than <SAMP>`+'</SAMP>.  It is useful with <SAMP>`+'</SAMP> because
  517. it allows you to use <CODE>umask</CODE> as an easily customizable protection
  518. against giving away more permission to files than you intended to.
  519. <P>
  520. As an example, if <CODE>umask</CODE> has the value 2, which removes write
  521. permission for users who are not in the file's group, then the mode:
  522. <P>
  523. <PRE>
  524. +w
  525. </PRE>
  526. <P>
  527. adds permission to write to the file to its owner and to other users who
  528. are in the file's group, but <EM>not</EM> to other users.  In contrast,
  529. the mode:
  530. <P>
  531. <PRE>
  532. a+w
  533. </PRE>
  534. <P>
  535. ignores <CODE>umask</CODE>, and <EM>does</EM> give write permission for
  536. the file to all users.
  537. <P>
  538. <H2><A NAME="SEC13" HREF="FILEUTIL.HTM#SEC13">Numeric Modes</A></H2>
  539. <A NAME="IDX47"></A>
  540. <A NAME="IDX48"></A>
  541. <A NAME="IDX49"></A>
  542. <P>
  543. File permissions are stored internally as 16 bit integers.  As an
  544. alternative to giving a symbolic mode, you can give an octal (base 8)
  545. number that corresponds to the internal representation of the new mode.
  546. This number is always interpreted in octal; you do not have to add a
  547. leading 0, as you do in C.  Mode 0055 is the same as mode 55.
  548. <P>
  549. A numeric mode is usually shorter than the corresponding symbolic
  550. mode, but it is limited in that it can not take into account a file's
  551. previous permissions; it can only set them absolutely.
  552. <P>
  553. The permissions granted to the user, to other users in the file's group,
  554. and to other users not in the file's group are each stored as three
  555. bits, which are represented as one octal digit.  The three special
  556. permissions are also each stored as one bit, and they are as a group
  557. represented as another octal digit.  Here is how the bits are arranged
  558. in the 16 bit integer, starting with the lowest valued bit:
  559. <P>
  560. <PRE>
  561. Value in  Corresponding
  562. Mode      Permission
  563.  
  564.           Other users not in the file's group:
  565.    1      Execute
  566.    2      Write
  567.    4      Read
  568.  
  569.           Other users in the file's group:
  570.   10      Execute
  571.   20      Write
  572.   40      Read
  573.  
  574.           The file's owner:
  575.  100      Execute
  576.  200      Write
  577.  400      Read
  578.  
  579.           Special permissions:
  580. 1000      Save text image on swap device
  581. 2000      Set group ID on execution
  582. 4000      Set user ID on execution
  583. </PRE>
  584. <P>
  585. For example, numeric mode 4755 corresponds to symbolic mode
  586. <SAMP>`u=rwxs,go=rx'</SAMP>, and numeric mode 664 corresponds to symbolic mode
  587. <SAMP>`ug=rw,o=r'</SAMP>.  Numeric mode 0 corresponds to symbolic mode
  588. <SAMP>`ugo='</SAMP>.
  589. <P>
  590. <H1><A NAME="SEC14" HREF="FILEUTIL.HTM#SEC14">Directory listing</A></H1>
  591. <P>
  592. This chapter describes the <CODE>ls</CODE> command and its variants <CODE>dir</CODE>
  593. and <CODE>vdir</CODE>, which list information about files.
  594. <P>
  595. <H2><A NAME="SEC15" HREF="FILEUTIL.HTM#SEC15"><CODE>ls</CODE>: List directory contents</A></H2>
  596. <A NAME="IDX50"></A>
  597. <A NAME="IDX51"></A>
  598. <P>
  599. The <CODE>ls</CODE> program lists information about files (of any type,
  600. including directories).  Options and file arguments can be intermixed
  601. arbitrarily, as usual.
  602. <P>
  603. For non-option command-line arguments that are directories, by default
  604. <CODE>ls</CODE> lists the contents of directories, not recursively, and
  605. omitting files with names beginning with <CODE>.</CODE>.  For other non-option
  606. arguments, by default <CODE>ls</CODE> lists just the filename.  If no
  607. non-option arguments are specified, <CODE>ls</CODE> lists the contents of the
  608. current directory.
  609. <P>
  610. By default, the output is sorted alphabetically.  If standard output is
  611. a terminal, the output is in columns (sorted vertically); otherwise,
  612. they are listed one per line.
  613. <P>
  614. Because <CODE>ls</CODE> is such a fundamental program, it has accumulated many
  615. options over the years.  They are described in the subsections below;
  616. within each section, options are listed alphabetically (ignoring case).
  617. The division of options into the subsections is not absolute, since some
  618. options affect more than one aspect of <CODE>ls</CODE>'s operation.
  619. <P>
  620. @opindex -g
  621. Also, the <SAMP>`-g'</SAMP> option is accepted but ignored, for compatibility
  622. with Unix.  Also see section <A HREF="FILEUTIL.000#SEC2">Common options</A>.
  623. <P>
  624. <H3><A NAME="SEC16" HREF="FILEUTIL.HTM#SEC16">Which files are listed</A></H3>
  625. <P>
  626. These options determine which files <CODE>ls</CODE> lists information for.
  627. By default, any files and the contents of any directories on the command
  628. line are shown.
  629. <P>
  630. <DL COMPACT>
  631.  
  632. <DT><SAMP>`-a'</SAMP>
  633. <DD><DT><SAMP>`--all'</SAMP>
  634. <DD>@opindex -a
  635. @opindex --all
  636. List all files in directories, including files that start with <SAMP>`.'</SAMP>.
  637.  
  638. <DT><SAMP>`-A'</SAMP>
  639. <DD><DT><SAMP>`--almost-all'</SAMP>
  640. <DD>@opindex -A
  641. @opindex --almost-all
  642. List all files in directories except for <TT>`.'</TT> and <TT>`..'</TT>.
  643.  
  644. <DT><SAMP>`-B'</SAMP>
  645. <DD><DT><SAMP>`--ignore-backups'</SAMP>
  646. <DD>@opindex -B
  647. @opindex --ignore-backups
  648. <A NAME="IDX52"></A>
  649. Do not list files that end with <SAMP>`~'</SAMP>, unless they are given on the
  650. command line.
  651.  
  652. <DT><SAMP>`-d'</SAMP>
  653. <DD><DT><SAMP>`--directory'</SAMP>
  654. <DD>@opindex -d
  655. @opindex --directory
  656. List just the names of directories, as with other types of files, rather
  657. than listing their contents.
  658.  
  659. <DT><SAMP>`-I'</SAMP>
  660. <DD><DT><SAMP>`--ignore'</SAMP>
  661. <DD>@opindex -I
  662. @opindex --ignore=<VAR>pattern</VAR>
  663. Do not list files whose names match the shell pattern (not regular
  664. expression) <VAR>pattern</VAR> unless they are given on the command line.  As
  665. in the shell, an initial <SAMP>`.'</SAMP> in a filename does not match a
  666. wildcard at the start of <VAR>pattern</VAR>.
  667.  
  668. <DT><SAMP>`-L'</SAMP>
  669. <DD><DT><SAMP>`--dereference'</SAMP>
  670. <DD>@opindex -L
  671. @opindex --dereference
  672. <A NAME="IDX53"></A>
  673. List the files linked to by symbolic links instead of listing the
  674. contents of the links.
  675.  
  676. <DT><SAMP>`-R'</SAMP>
  677. <DD><DT><SAMP>`--recursive'</SAMP>
  678. <DD>@opindex -R
  679. @opindex --recursive
  680. <A NAME="IDX55"></A>
  681. <A NAME="IDX54"></A>
  682. List the contents of all directories recursively.
  683.  
  684. </DL>
  685. <P>
  686. <H3><A NAME="SEC17" HREF="FILEUTIL.HTM#SEC17">What information is listed</A></H3>
  687. <P>
  688. These options affect the information that <CODE>ls</CODE> displays.  By
  689. default, only filenames are shown.
  690. <P>
  691. <DL COMPACT>
  692.  
  693. <DT><SAMP>`-D'</SAMP>
  694. <DD><DT><SAMP>`--dired'</SAMP>
  695. <DD>@opindex -D
  696. @opindex --dired
  697. <A NAME="IDX56"></A>
  698. With the long listing (<SAMP>`-l'</SAMP>) format, print an additional line after
  699. the main output:
  700.  
  701. <PRE>
  702. //DIRED// <VAR>beg1 end1 beg2 end2 ...</VAR>
  703. </PRE>
  704.  
  705. The <VAR>begN</VAR> and <VAR>endN</VAR> are unsigned integers which record the
  706. byte position of the beginning and end of each filename in the output.
  707. This makes it easy for Emacs to find the names, even when they contain
  708. unusual characters such as space or newline, without fancy searching.
  709.  
  710. If directories are being listed recursively (<CODE>-R</CODE>), output a similar
  711. line after each subdirectory:
  712.  
  713. <PRE>
  714. //SUBDIRED// <VAR>beg1 end1 ...</VAR>
  715. </PRE>
  716.  
  717. <DT><SAMP>`-G'</SAMP>
  718. <DD><DT><SAMP>`--no-group'</SAMP>
  719. <DD>@opindex -G
  720. @opindex --no-group
  721. Inhibit display of group information in a long format directory listing.
  722. (This is the default in some non-GNU versions of <CODE>ls</CODE>, so we
  723. provide this option for compatibility.)
  724.  
  725. <DT><SAMP>`-i'</SAMP>
  726. <DD><DT><SAMP>`--inode'</SAMP>
  727. <DD>@opindex -i
  728. @opindex --inode
  729. <A NAME="IDX57"></A>
  730. Print the inode number (also called the file serial number and index
  731. number) of each file to the left of the filename.  (This number
  732. uniquely identifies each file within a particular filesystem.)
  733.  
  734. <DT><SAMP>`-l'</SAMP>
  735. <DD><DT><SAMP>`--format=long'</SAMP>
  736. <DD><DT><SAMP>`--format=verbose'</SAMP>
  737. <DD>@opindex -l
  738. @opindex --format
  739. @opindex long ls format
  740. @opindex verbose ls format
  741. In addition to the name of each file, print the file type, permissions,
  742. number of hard links, owner name, group name, size in bytes, and
  743. timestamp (by default, the modification time).  For files with a time
  744. more than 6 months old or more than 1 hour into the future, the
  745. timestamp contains the year instead of the time of day.
  746.  
  747. For each directory that is listed, preface the files with a line
  748. <CODE>total <VAR>blocks</VAR></CODE>, where <VAR>blocks</VAR> is the total disk space
  749. used by all files in that directory.  By default, 1024-byte blocks are
  750. used; if the environment variable <CODE>POSIXLY_CORRECT</CODE> is set,
  751. 512-byte blocks are used (unless the <SAMP>`-k'</SAMP> option is given).
  752. The <VAR>blocks</VAR> computed counts each hard link separately;
  753. this is arguably a bug.
  754.  
  755. This output format is the default for the GNU <CODE>v</CODE> and <CODE>vdir</CODE>
  756. programs.
  757.  
  758. <DT><SAMP>`-s'</SAMP>
  759. <DD><DT><SAMP>`--size'</SAMP>
  760. <DD>@opindex -s
  761. @opindex --size
  762. <A NAME="IDX59"></A>
  763. <A NAME="IDX58"></A>
  764. Print the size of each file in 1024-byte blocks to the left of the
  765. filename.  If the environment variable <CODE>POSIXLY_CORRECT</CODE> is set,
  766. 512-byte blocks are used instead, unless the <SAMP>`-k'</SAMP> option is given
  767. (see section <A HREF="FILEUTIL.000#SEC19">General output formatting</A>).
  768.  
  769. <A NAME="IDX60"></A>
  770. For files that are NFS-mounted from an HP-UX system to a BSD system,
  771. this option reports sizes that are half the correct values.  On HP-UX
  772. systems, it reports sizes that are twice the correct values for files
  773. that are NFS-mounted from BSD systems.  This is due to a flaw in HP-UX;
  774. it also affects the HP-UX <CODE>ls</CODE> program.
  775.  
  776. </DL>
  777. <P>
  778. <H3><A NAME="SEC18" HREF="FILEUTIL.HTM#SEC18">Sorting the output</A></H3>
  779. <A NAME="IDX61"></A>
  780. <P>
  781. These options change the order in which <CODE>ls</CODE> sorts the information
  782. it outputs.  By default, sorting is done by character code (e.g., ASCII
  783. order).
  784. <P>
  785. <DL COMPACT>
  786.  
  787. <DT><SAMP>`-c'</SAMP>
  788. <DD><DT><SAMP>`--time=ctime'</SAMP>
  789. <DD><DT><SAMP>`--time=status'</SAMP>
  790. <DD>@opindex -c
  791. @opindex --time
  792. @opindex ctime, sorting by
  793. @opindex status time, sorting by
  794. Sort according to the status change time (the <SAMP>`ctime'</SAMP> in the
  795. inode).  If the long listing format (<SAMP>`-l'</SAMP>) is being used, print the
  796. status change time instead of the modification time.
  797.  
  798. <DT><SAMP>`-f'</SAMP>
  799. <DD>@opindex -f
  800. Primarily, like <SAMP>`-U'</SAMP>---do not sort; list the files in whatever
  801. order they are stored in the directory.  But also enable <SAMP>`-a'</SAMP> (list
  802. all files) and disable <SAMP>`-l'</SAMP> and <SAMP>`-s'</SAMP> (if they were specified
  803. before the <SAMP>`-f'</SAMP>).
  804.  
  805. <DT><SAMP>`-r'</SAMP>
  806. <DD><DT><SAMP>`--reverse'</SAMP>
  807. <DD>@opindex -r
  808. @opindex --reverse
  809. <A NAME="IDX62"></A>
  810. Reverse whatever the sorting method is--e.g., list files in reverse
  811. alphabetical order, youngest first, smallest first, or whatever.
  812.  
  813. <DT><SAMP>`-S'</SAMP>
  814. <DD><DT><SAMP>`--sort=size'</SAMP>
  815. <DD>@opindex -S
  816. @opindex --sort
  817. @opindex size of files, sorting files by
  818. Sort by file size, largest first.
  819.  
  820. <DT><SAMP>`-t'</SAMP>
  821. <DD><DT><SAMP>`--sort=time'</SAMP>
  822. <DD>@opindex -t
  823. @opindex --sort
  824. @opindex modification time, sorting files by
  825. Sort by modification time (the <SAMP>`mtime'</SAMP> in the inode), newest first.
  826.  
  827. <DT><SAMP>`-u'</SAMP>
  828. <DD><DT><SAMP>`--time=atime'</SAMP>
  829. <DD><DT><SAMP>`--time=access'</SAMP>
  830. <DD><DT><SAMP>`--time=use'</SAMP>
  831. <DD>@opindex -u
  832. @opindex --time
  833. @opindex atime, sorting files by
  834. @opindex access time, sorting files by
  835. @opindex use time, sorting files by
  836. Sort by access time (the <SAMP>`atime'</SAMP> in the inode).  If the long
  837. listing format is being used, print the last access time.
  838.  
  839. <DT><SAMP>`-U'</SAMP>
  840. <DD><DT><SAMP>`--sort=none'</SAMP>
  841. <DD>@opindex -U
  842. @opindex --sort
  843. @opindex none, sorting option for <CODE>ls</CODE>
  844. Do not sort; list the files in whatever order they are
  845. stored in the directory.  (Do not do any of the other unrelated things
  846. that <SAMP>`-f'</SAMP> does.)  This is especially useful when listing very large
  847. directories, since not doing any sorting can be noticeably faster.
  848.  
  849. <DT><SAMP>`-X'</SAMP>
  850. <DD><DT><SAMP>`--sort=extension'</SAMP>
  851. <DD>@opindex -X
  852. @opindex --sort
  853. @opindex extension, sorting files by
  854. Sort directory contents alphabetically by file extension (characters
  855. after the last <SAMP>`.'</SAMP>); files with no extension are sorted first.
  856.  
  857. </DL>
  858. <P>
  859. <H3><A NAME="SEC19" HREF="FILEUTIL.HTM#SEC19">General output formatting</A></H3>
  860. <P>
  861. These options affect the appearance of the overall output.
  862. <P>
  863. <DL COMPACT>
  864.  
  865. <DT><SAMP>`-1'</SAMP>
  866. <DD><DT><SAMP>`--format=single-column'</SAMP>
  867. <DD>@opindex -1
  868. @opindex --format
  869. @opindex single-column output of files
  870. List one file per line.  This is the default for <CODE>ls</CODE> when standard
  871. output is not a terminal.
  872.  
  873. <DT><SAMP>`-C'</SAMP>
  874. <DD><DT><SAMP>`--format=vertical'</SAMP>
  875. <DD>@opindex -C
  876. @opindex --format
  877. @opindex vertical sorted files in columns
  878. List files in columns, sorted vertically.  This is the default for
  879. <CODE>ls</CODE> if standard output is a terminal.  It is always the default
  880. for the <CODE>dir</CODE> and <CODE>d</CODE> programs.
  881.  
  882. <DT><SAMP>`-F'</SAMP>
  883. <DD><DT><SAMP>`--classify'</SAMP>
  884. <DD>@opindex -F
  885. @opindex --classify
  886. <A NAME="IDX64"></A>
  887. <A NAME="IDX63"></A>
  888. Append a character to each filename indicating the file type.  Also,
  889. for regular files that are executable, append <SAMP>`*'</SAMP>.  The file type
  890. indicators are <SAMP>`/'</SAMP> for directories, <SAMP>`@'</SAMP> for symbolic links,
  891. <SAMP>`|'</SAMP> for FIFOs, <SAMP>`='</SAMP> for sockets, and nothing for regular files.
  892.  
  893. <DT><SAMP>`--full-time'</SAMP>
  894. <DD>@opindex --full-time
  895. List times in full, rather than using the standard abbreviation
  896. heuristics.  The format is the same as <CODE>date</CODE>'s default; it's not
  897. possible to change this, but you can extract out the date string with
  898. <CODE>cut</CODE> and then pass the result to <CODE>date -d</CODE>.  See section `date invocation' in <CITE>Shell utilities</CITE>.
  899.  
  900. This is most useful because the time output includes the seconds.  (Unix
  901. filesystems store file timestamps only to the nearest second, so this
  902. option shows all the information there is.)  For example, this can help
  903. when you have a Makefile that is not regenerating files properly.
  904.  
  905. <DT><SAMP>`-k'</SAMP>
  906. <DD><DT><SAMP>`--kilobytes'</SAMP>
  907. <DD>@opindex -k
  908. @opindex --kilobytes
  909. <A NAME="IDX65"></A>
  910. If file sizes are being listed, print them in kilobytes.  This
  911. overrides the environment variable <CODE>POSIXLY_CORRECT</CODE>.
  912.  
  913. <DT><SAMP>`-m'</SAMP>
  914. <DD><DT><SAMP>`--format=commas'</SAMP>
  915. <DD>@opindex -m
  916. @opindex --format
  917. @opindex commas, outputting between files
  918. List files horizontally, with as many as will fit on each line,
  919. separated by <SAMP>`, '</SAMP> (a comma and a space).
  920.  
  921. <DT><SAMP>`-n'</SAMP>
  922. <DD><DT><SAMP>`--numeric-uid-gid'</SAMP>
  923. <DD>@opindex -n
  924. @opindex --numeric-uid-gid
  925. <A NAME="IDX66"></A>
  926. List the numeric UID and GID instead of the names.
  927.  
  928. <A NAME="IDX67"></A>
  929. <DT><SAMP>`-p'</SAMP>
  930. <DD>Append a character to each filename indicating the file type. This is
  931. like <SAMP>`-F'</SAMP>, except that executables are not marked.
  932.  
  933. <DT><SAMP>`-x'</SAMP>
  934. <DD><DT><SAMP>`--format=across'</SAMP>
  935. <DD><DT><SAMP>`--format=horizontal'</SAMP>
  936. <DD>@opindex -x
  937. @opindex --format
  938. @opindex across, listing files
  939. @opindex horizontal, listing files
  940. List the files in columns, sorted horizontally.
  941.  
  942. <DT><SAMP>`-T'</SAMP>
  943. <DD><DT><SAMP>`--tabsize=<VAR>cols</VAR>'</SAMP>
  944. <DD>@opindex -T
  945. @opindex --tabsize
  946. Assume that each tabstop is <VAR>cols</VAR> columns wide.  The default is 8.
  947. <CODE>ls</CODE> uses tabs where possible in the output, for efficiency.
  948.  
  949. <DT><SAMP>`-w'</SAMP>
  950. <DD><DT><SAMP>`--width=<VAR>cols</VAR>'</SAMP>
  951. <DD>@opindex -w
  952. @opindex --width
  953. <A NAME="IDX68"></A>
  954. Assume the screen is <VAR>cols</VAR> columns wide.  The default is taken
  955. from the terminal settings if possible; otherwise the environment
  956. variable <CODE>COLUMNS</CODE> is used if it is set; otherwise the default
  957. is 80.
  958.  
  959. </DL>
  960. <P>
  961. <H3><A NAME="SEC20" HREF="FILEUTIL.HTM#SEC20">Formatting the filenames</A></H3>
  962. <P>
  963. These options change how filenames themselves are printed.
  964. <P>
  965. <DL COMPACT>
  966.  
  967. <DT><SAMP>`-b'</SAMP>
  968. <DD><DT><SAMP>`--escape'</SAMP>
  969. <DD>@opindex -b
  970. @opindex --escape
  971. <A NAME="IDX69"></A>
  972. Quote nongraphic characters in filenames using alphabetic and octal
  973. backslash sequences like those used in C.
  974.  
  975. <DT><SAMP>`-N'</SAMP>
  976. <DD><DT><SAMP>`--literal'</SAMP>
  977. <DD>@opindex -N
  978. @opindex --literal
  979. Do not quote filenames.
  980.  
  981. <DT><SAMP>`-q'</SAMP>
  982. <DD><DT><SAMP>`--hide-control-chars'</SAMP>
  983. <DD>@opindex -q
  984. @opindex --hide-control-chars
  985. Print question marks instead of nongraphic characters in filenames.
  986. This is the default.
  987.  
  988. <DT><SAMP>`-Q'</SAMP>
  989. <DD><DT><SAMP>`--quote-name'</SAMP>
  990. <DD>@opindex -Q
  991. @opindex --quote-name
  992. Enclose filenames in double quotes and quote nongraphic characters as
  993. in C.
  994.  
  995. </DL>
  996. <P>
  997. <H2><A NAME="SEC21" HREF="FILEUTIL.HTM#SEC21"><CODE>dir</CODE>: Briefly list directory contents</A></H2>
  998. <A NAME="IDX70"></A>
  999. <A NAME="IDX71"></A>
  1000. <P>
  1001. The <CODE>dir</CODE> program (also installed as <CODE>d</CODE>) is equivalent to
  1002. <CODE>ls -C</CODE>; that is, files are by default always listed in columns,
  1003. sorted vertically.
  1004. <P>
  1005. See section <A HREF="FILEUTIL.000#SEC15"><CODE>ls</CODE>: List directory contents</A>.
  1006. <P>
  1007. <H2><A NAME="SEC22" HREF="FILEUTIL.HTM#SEC22"><CODE>vdir</CODE>: Verbosely list directory contents</A></H2>
  1008. <A NAME="IDX72"></A>
  1009. <A NAME="IDX73"></A>
  1010. <P>
  1011. The <CODE>vdir</CODE> program (also installed <CODE>v</CODE>)is equivalent to
  1012. <CODE>ls -l</CODE>; that is, files are by default listed in long format.
  1013. <P>
  1014. <H1><A NAME="SEC23" HREF="FILEUTIL.HTM#SEC23">Basic operations</A></H1>
  1015. <A NAME="IDX74"></A>
  1016. <P>
  1017. This chapter describes the commands for basic file manipulation:
  1018. copying, moving (renaming), and deleting (removing).
  1019. <P>
  1020. <H2><A NAME="SEC24" HREF="FILEUTIL.HTM#SEC24"><CODE>cp</CODE>: Copy files and directories</A></H2>
  1021. <A NAME="IDX75"></A>
  1022. <A NAME="IDX76"></A>
  1023. <A NAME="IDX77"></A>
  1024. <A NAME="IDX78"></A>
  1025. <P>
  1026. <CODE>cp</CODE> copies files (or, optionally, directories).  The copy is
  1027. completely independent of the original.  You can either copy one file to
  1028. another, or copy arbitrarily many files to a destination directory.
  1029. Synopsis:
  1030. <P>
  1031. <PRE>
  1032. cp [<VAR>option</VAR>]... <VAR>source</VAR> <VAR>dest</VAR>
  1033. cp [<VAR>option</VAR>]... <VAR>source</VAR>... <VAR>directory</VAR>
  1034. </PRE>
  1035. <P>
  1036. If the last argument names an existing directory, <CODE>cp</CODE> copies each
  1037. <VAR>source</VAR> file into that directory (retaining the same name).
  1038. Otherwise, if only two files are given, it copies the first onto the
  1039. second.  It is an error if the last argument is not a directory and more
  1040. than two non-option arguments are given.
  1041. <A NAME="IDX79"></A>
  1042. <A NAME="IDX80"></A>
  1043. <P>
  1044. If the source file contains holes, <CODE>cp</CODE> copies them and other
  1045. blocks of zero bytes as holes.  Otherwise, files are written just as
  1046. they are read.  (A <DFN>hole</DFN> is a sequence of zero bytes that does not
  1047. occupy any physical disk blocks; the <SAMP>`read'</SAMP> system call reads these
  1048. as zeroes.)
  1049. <P>
  1050. By default, <CODE>cp</CODE> does not copy directories.  It also refuses to
  1051. copy a file onto itself.
  1052. <P>
  1053. The program accepts the following options.  Also see section <A HREF="FILEUTIL.000#SEC2">Common options</A>.
  1054. <P>
  1055. <DL COMPACT>
  1056.  
  1057. <DT><SAMP>`-a'</SAMP>
  1058. <DD><DT><SAMP>`--archive'</SAMP>
  1059. <DD>@opindex -a
  1060. @opindex --archive
  1061. Preserve as much as possible of the structure and attributes of the
  1062. original files in the copy.  Equivalent to <SAMP>`-dpR'</SAMP>.
  1063.  
  1064. <DT><SAMP>`-b'</SAMP>
  1065. <DD><DT><SAMP>`--backup'</SAMP>
  1066. <DD>@opindex -b
  1067. @opindex --backup
  1068. <A NAME="IDX81"></A>
  1069. Make backups of files that are about to be overwritten or removed.
  1070. See section <A HREF="FILEUTIL.000#SEC3">Backup options</A>.
  1071.  
  1072. <DT><SAMP>`-d'</SAMP>
  1073. <DD><DT><SAMP>`--no-dereference'</SAMP>
  1074. <DD>@opindex -d
  1075. @opindex --no-dereference
  1076. <A NAME="IDX83"></A>
  1077. <A NAME="IDX82"></A>
  1078. Copy symbolic links as symbolic links rather than copying the files that
  1079. they point to, and preserve hard links between source files in the
  1080. copies.
  1081.  
  1082. <DT><SAMP>`-f'</SAMP>
  1083. <DD><DT><SAMP>`--force'</SAMP>
  1084. <DD>@opindex -f
  1085. @opindex --force
  1086. Remove existing destination files.
  1087.  
  1088. <DT><SAMP>`-i'</SAMP>
  1089. <DD><DT><SAMP>`--interactive'</SAMP>
  1090. <DD>@opindex -i
  1091. @opindex --interactive
  1092. Prompt whether to overwrite existing regular destination files.
  1093.  
  1094. <DT><SAMP>`-l'</SAMP>
  1095. <DD><DT><SAMP>`--link'</SAMP>
  1096. <DD>@opindex -l
  1097. @opindex --link
  1098. Make hard links instead of copies of non-directories.
  1099.  
  1100. <DT><SAMP>`-p'</SAMP>
  1101. <DD><DT><SAMP>`--preserve'</SAMP>
  1102. <DD>@opindex -p
  1103. @opindex --preserve
  1104. <A NAME="IDX84"></A>
  1105. Preserve the original files' owner, group, permissions, and timestamps.
  1106.  
  1107. <DT><SAMP>`-P'</SAMP>
  1108. <DD><DT><SAMP>`--parents'</SAMP>
  1109. <DD>@opindex -P
  1110. @opindex --parents
  1111. <A NAME="IDX85"></A>
  1112. Form the name of each destination file by appending to the target
  1113. directory a slash and the specified name of the source file.  The last
  1114. argument given to <CODE>cp</CODE> must be the name of an existing directory.
  1115. For example, the command:
  1116.  
  1117. <PRE>
  1118. cp --parents a/b/c existing_dir
  1119. </PRE>
  1120.  
  1121. copies the file <TT>`a/b/c'</TT> to <TT>`existing_dir/a/b/c'</TT>, creating
  1122. any missing intermediate directories.
  1123.  
  1124. <A NAME="IDX86"></A>
  1125. <A NAME="IDX87"></A>
  1126. <A NAME="IDX88"></A>
  1127. <A NAME="IDX89"></A>
  1128. <DT><SAMP>`-r'</SAMP>
  1129. <DD>Copy directories recursively, copying any non-directories and
  1130. non-symbolic links (that is, FIFOs and special files) as if they were
  1131. regular files.  This means trying to read the data in each source file
  1132. and writing it to the destination.  Thus, with this option, <CODE>cp</CODE>
  1133. may well hang indefinitely reading a FIFO, unless something else happens
  1134. to be writing it.
  1135.  
  1136. <DT><SAMP>`-R'</SAMP>
  1137. <DD><DT><SAMP>`--recursive'</SAMP>
  1138. <DD>@opindex -R
  1139. @opindex --recursive
  1140. Copy directories recursively, preserving non-directories (see <SAMP>`-r'</SAMP>
  1141. just above).
  1142.  
  1143. <DT><SAMP>`-s'</SAMP>
  1144. <DD><DT><SAMP>`--symbolic-link'</SAMP>
  1145. <DD>@opindex -s
  1146. @opindex --symbolic-link
  1147. <A NAME="IDX90"></A>
  1148. Make symbolic links instead of copies of non-directories.  All source
  1149. filenames must be absolute (starting with <SAMP>`/'</SAMP>) unless the
  1150. destination files are in the current directory.  This option merely
  1151. results in an error message on systems that do not support symbolic links.
  1152.  
  1153. <DT><SAMP>`-S <VAR>suffix</VAR>'</SAMP>
  1154. <DD><DT><SAMP>`--suffix=<VAR>suffix</VAR>'</SAMP>
  1155. <DD>@opindex -S
  1156. @opindex --suffix
  1157. Append <VAR>suffix</VAR> to each backup file made with <SAMP>`-b'</SAMP>.
  1158. See section <A HREF="FILEUTIL.000#SEC3">Backup options</A>.
  1159.  
  1160. <DT><SAMP>`-u'</SAMP>
  1161. <DD><DT><SAMP>`--update'</SAMP>
  1162. <DD>@opindex -u
  1163. @opindex --update
  1164. <A NAME="IDX91"></A>
  1165. Do not copy a nondirectory that has an existing destination with the
  1166. same or newer modification time.
  1167.  
  1168. <DT><SAMP>`-v'</SAMP>
  1169. <DD><DT><SAMP>`--verbose'</SAMP>
  1170. <DD>@opindex -v
  1171. @opindex --verbose
  1172. Print the name of each file before copying it.
  1173.  
  1174. <DT><SAMP>`-V <VAR>method</VAR>'</SAMP>
  1175. <DD><DT><SAMP>`--version-control=<VAR>method</VAR>'</SAMP>
  1176. <DD>@opindex -V
  1177. @opindex --version-control
  1178. Change the type of backups made with <SAMP>`-b'</SAMP>.  The <VAR>method</VAR>
  1179. argument can be <SAMP>`numbered'</SAMP> (or <SAMP>`t'</SAMP>), <SAMP>`existing'</SAMP> (or
  1180. <SAMP>`nil'</SAMP>), or <SAMP>`never'</SAMP> (or <SAMP>`simple'</SAMP>).  See section <A HREF="FILEUTIL.000#SEC3">Backup options</A>.
  1181.  
  1182. <DT><SAMP>`-x'</SAMP>
  1183. <DD><DT><SAMP>`--one-file-system'</SAMP>
  1184. <DD>@opindex -x
  1185. @opindex --one-file-system
  1186. <A NAME="IDX92"></A>
  1187. Skip subdirectories that are on different filesystems from the one that
  1188. the copy started on.
  1189.  
  1190. </DL>
  1191. <P>
  1192. <H2><A NAME="SEC25" HREF="FILEUTIL.HTM#SEC25"><CODE>dd</CODE>: Convert and copy a file</A></H2>
  1193. <A NAME="IDX93"></A>
  1194. <A NAME="IDX94"></A>
  1195. <P>
  1196. <CODE>dd</CODE> copies a file (from standard input to standard output, by
  1197. default) with a changeable I/O blocksize, while optionally performing
  1198. conversions on it.  Synopsis:
  1199. <P>
  1200. <PRE>
  1201. dd [<VAR>option</VAR>]...
  1202. </PRE>
  1203. <P>
  1204. The program accepts the following options.  Also see section <A HREF="FILEUTIL.000#SEC2">Common options</A>.
  1205. <A NAME="IDX95"></A>
  1206. <P>
  1207. The numeric-valued options below (<VAR>bytes</VAR> and <VAR>blocks</VAR>) can be
  1208. followed by a multiplier: <SAMP>`b'</SAMP>=512, <SAMP>`c'</SAMP>=1, <SAMP>`k'</SAMP>=1024,
  1209. <SAMP>`w'</SAMP>=2, <SAMP>`x<VAR>m</VAR>'</SAMP>=<VAR>m</VAR>.
  1210. <P>
  1211. <DL COMPACT>
  1212.  
  1213. <DT><SAMP>`if=<VAR>file</VAR>'</SAMP>
  1214. <DD>@opindex if
  1215. Read from <VAR>file</VAR> instead of standard input.
  1216.  
  1217. <DT><SAMP>`of=<VAR>file</VAR>'</SAMP>
  1218. <DD>@opindex of
  1219. Write to <VAR>file</VAR> instead of standard output.  Unless
  1220. <SAMP>`conv=notrunc'</SAMP> is given, <CODE>dd</CODE> truncates <VAR>file</VAR> to zero
  1221. bytes (or the size specified with <SAMP>`seek='</SAMP>).
  1222.  
  1223. <DT><SAMP>`ibs=<VAR>bytes</VAR>'</SAMP>
  1224. <DD>@opindex ibs
  1225. <A NAME="IDX97"></A>
  1226. <A NAME="IDX96"></A>
  1227. Read <VAR>bytes</VAR> bytes at a time.
  1228.  
  1229. <DT><SAMP>`obs=<VAR>bytes</VAR>'</SAMP>
  1230. <DD>@opindex obs
  1231. <A NAME="IDX99"></A>
  1232. <A NAME="IDX98"></A>
  1233. Write <VAR>bytes</VAR> bytes at a time.
  1234.  
  1235. <DT><SAMP>`bs=<VAR>bytes</VAR>'</SAMP>
  1236. <DD>@opindex bs
  1237. <A NAME="IDX100"></A>
  1238. Both read and write <VAR>bytes</VAR> bytes at a time.  This overrides
  1239. <SAMP>`ibs'</SAMP> and <SAMP>`obs'</SAMP>.
  1240.  
  1241. <DT><SAMP>`cbs=<VAR>bytes</VAR>'</SAMP>
  1242. <DD>@opindex cbs
  1243. <A NAME="IDX102"></A>
  1244. <A NAME="IDX101"></A>
  1245. Convert <VAR>bytes</VAR> bytes at a time.
  1246.  
  1247. <DT><SAMP>`skip=<VAR>blocks</VAR>'</SAMP>
  1248. <DD>@opindex skip
  1249. Skip <VAR>blocks</VAR> <SAMP>`ibs'</SAMP>-byte blocks in the input file before copying.
  1250.  
  1251. <DT><SAMP>`seek=<VAR>blocks</VAR>'</SAMP>
  1252. <DD>@opindex seek
  1253. Skip <VAR>blocks</VAR> <SAMP>`obs'</SAMP>-byte blocks in the output file before copying.
  1254.  
  1255. <DT><SAMP>`count=<VAR>blocks</VAR>'</SAMP>
  1256. <DD>@opindex count
  1257. Copy <VAR>blocks</VAR> <SAMP>`obs'</SAMP>-byte blocks from the input file, instead
  1258. of everything until the end of the file.
  1259.  
  1260. <DT><SAMP>`conv=<VAR>conversion</VAR>[,<VAR>conversion</VAR>]...'</SAMP>
  1261. <DD>@opindex conv
  1262. Convert the file as specified by the <VAR>conversion</VAR> argument(s).
  1263. (No spaces around any comma(s).)
  1264.  
  1265. Conversions:
  1266.  
  1267. <DL COMPACT>
  1268.  
  1269. <DT><SAMP>`ascii'</SAMP>
  1270. <DD>@opindex ascii, converting to
  1271. Convert EBCDIC to ASCII.
  1272.  
  1273. <DT><SAMP>`ebcdic'</SAMP>
  1274. <DD>@opindex ebcdic, converting to
  1275. Convert ASCII to EBCDIC.
  1276.  
  1277. <DT><SAMP>`ibm'</SAMP>
  1278. <DD>@opindex alternate ebcdic, converting to
  1279. Convert ASCII to alternate EBCDIC.
  1280.  
  1281. <DT><SAMP>`block'</SAMP>
  1282. <DD>@opindex block (space-padding)
  1283. For each line in the input, output <SAMP>`cbs'</SAMP> bytes, replacing the
  1284. input newline with a space and padding with spaces as necessary.
  1285.  
  1286. <DT><SAMP>`unblock'</SAMP>
  1287. <DD>@opindex unblock
  1288. Replace trailing spaces in each <SAMP>`cbs'</SAMP>-sized input block with a
  1289. newline.
  1290.  
  1291. <DT><SAMP>`lcase'</SAMP>
  1292. <DD>@opindex lcase, converting to
  1293. Change uppercase letters to lowercase.
  1294.  
  1295. <DT><SAMP>`ucase'</SAMP>
  1296. <DD>@opindex ucase, converting to
  1297. Change lowercase letters to uppercase.
  1298.  
  1299. <DT><SAMP>`swab'</SAMP>
  1300. <DD>@opindex swab (byte-swapping)
  1301. <A NAME="IDX103"></A>
  1302. Swap every pair of input bytes.  GNU <CODE>dd</CODE>, unlike others, works
  1303. when an odd number of bytes are read--the last byte is simply copied
  1304. (since there is nothing to swap it with).
  1305.  
  1306. <DT><SAMP>`noerror'</SAMP>
  1307. <DD>@opindex noerror
  1308. <A NAME="IDX104"></A>
  1309. Continue after read errors.
  1310.  
  1311. <DT><SAMP>`notrunc'</SAMP>
  1312. <DD>@opindex notrunc
  1313. <A NAME="IDX105"></A>
  1314. Do not truncate the output file.
  1315.  
  1316. <DT><SAMP>`sync'</SAMP>
  1317. <DD>@opindex sync (padding with nulls)
  1318. Pad every input block to size of <SAMP>`ibs'</SAMP> with trailing zero bytes.
  1319. </DL>
  1320.  
  1321. </DL>
  1322. <P>
  1323. <H2><A NAME="SEC26" HREF="FILEUTIL.HTM#SEC26"><CODE>install</CODE>: Copy files and set attributes</A></H2>
  1324. <A NAME="IDX106"></A>
  1325. <A NAME="IDX107"></A>
  1326. <P>
  1327. <CODE>install</CODE> copies files while setting their permission modes and, if
  1328. possible, their owner and group.  Synopses:
  1329. <P>
  1330. <PRE>
  1331. install [<VAR>option</VAR>]... <VAR>source</VAR> <VAR>dest</VAR>
  1332. install [<VAR>option</VAR>]... <VAR>source</VAR>... <VAR>directory</VAR>
  1333. install -d [<VAR>option</VAR>]... <VAR>directory</VAR>...
  1334. </PRE>
  1335. <P>
  1336. In the first of these, the <VAR>source</VAR> file is copied to the <VAR>dest</VAR>
  1337. target file.  In the second, each of the <VAR>source</VAR> files are copied
  1338. to the destination <VAR>directory</VAR>.  In the last, each <VAR>directory</VAR>
  1339. (and any missing parent directories) is created.
  1340. <A NAME="IDX108"></A>
  1341. <P>
  1342. <CODE>install</CODE> is similar to <CODE>cp</CODE>, but allows you to control the
  1343. attributes of destination files.  It is typically used in Makefiles to
  1344. copy programs into their destination directories.  It refuses to copy
  1345. files onto themselves.
  1346. <P>
  1347. The program accepts the following options.  Also see section <A HREF="FILEUTIL.000#SEC2">Common options</A>.
  1348. <P>
  1349. <DL COMPACT>
  1350.  
  1351. <DT><SAMP>`-c'</SAMP>
  1352. <DD>@opindex -c
  1353. Ignored; for compatibility with old Unix versions of <CODE>install</CODE>.
  1354.  
  1355. <DT><SAMP>`-d'</SAMP>
  1356. <DD><DT><SAMP>`--directory'</SAMP>
  1357. <DD>@opindex -d
  1358. @opindex --directory
  1359. <A NAME="IDX110"></A>
  1360. <A NAME="IDX111"></A>
  1361. <A NAME="IDX109"></A>
  1362. Create each given directory and any missing parent directories, setting
  1363. the owner, group and mode as given on the command line or to the
  1364. defaults.  It also gives any parent directories it creates those
  1365. attributes.  (This is different from the SunOS 4.x <CODE>install</CODE>, which
  1366. gives directories that it creates the default attributes.)
  1367.  
  1368. <DT><SAMP>`-g <VAR>group</VAR>'</SAMP>
  1369. <DD><DT><SAMP>`--group=<VAR>group</VAR>'</SAMP>
  1370. <DD>@opindex -g
  1371. @opindex --group
  1372. <A NAME="IDX112"></A>
  1373. Set the group ownership of installed files or directories to
  1374. <VAR>group</VAR>. The default is the process's current group.  <VAR>group</VAR>
  1375. may be either a group name or a numeric group id.
  1376.  
  1377. <DT><SAMP>`-m <VAR>mode</VAR>'</SAMP>
  1378. <DD><DT><SAMP>`--mode=<VAR>mode</VAR>'</SAMP>
  1379. <DD>@opindex -m
  1380. @opindex --mode
  1381. <A NAME="IDX113"></A>
  1382. Set the permissions for the installed file or directory to <VAR>mode</VAR>,
  1383. which can be either an octal number, or a symbolic mode as in
  1384. <CODE>chmod</CODE>, with 0 as the point of departure (see section <A HREF="FILEUTIL.000#SEC4">File permissions</A>).  The default mode is 0755--read, write, and execute
  1385. for the owner, and read and execute for group and other.
  1386.  
  1387. <DT><SAMP>`-o <VAR>owner</VAR>'</SAMP>
  1388. <DD><DT><SAMP>`--owner=<VAR>owner</VAR>'</SAMP>
  1389. <DD>@opindex -o
  1390. @opindex --owner
  1391. <A NAME="IDX115"></A>
  1392. <A NAME="IDX116"></A>
  1393. <A NAME="IDX114"></A>
  1394. If <CODE>install</CODE> has appropriate privileges (is run as root), set the
  1395. ownership of installed files or directories to <VAR>owner</VAR>. The default
  1396. is <CODE>root</CODE>.  <VAR>owner</VAR> may be either a user name or a numeric user
  1397. ID.
  1398.  
  1399. <DT><SAMP>`-s'</SAMP>
  1400. <DD><DT><SAMP>`--strip'</SAMP>
  1401. <DD>@opindex -s
  1402. @opindex --strip
  1403. <A NAME="IDX118"></A>
  1404. <A NAME="IDX117"></A>
  1405. Strip the symbol tables from installed binary executables.
  1406.  
  1407. </DL>
  1408. <P>
  1409. <H2><A NAME="SEC27" HREF="FILEUTIL.HTM#SEC27"><CODE>mv</CODE>: Move (rename) files</A></H2>
  1410. <A NAME="IDX119"></A>
  1411. <P>
  1412. <CODE>mv</CODE> moves or renames files (or directories).  Synopsis:
  1413. <P>
  1414. <PRE>
  1415. mv [<VAR>option</VAR>]... <VAR>source</VAR> <VAR>dest</VAR>
  1416. mv [<VAR>option</VAR>]... <VAR>source</VAR>... <VAR>directory</VAR>
  1417. </PRE>
  1418. <P>
  1419. If the last argument names an existing directory, <CODE>mv</CODE> moves each
  1420. other given file into a file with the same name in that directory.
  1421. Otherwise, if only two files are given, it renames the first as
  1422. the second.  It is an error if the last argument is not a directory
  1423. and more than two files are given.
  1424. <P>
  1425. <CODE>mv</CODE> can move only regular files across filesystems.
  1426. <A NAME="IDX120"></A>
  1427. <P>
  1428. If a destination file exists but is normally unwritable, standard input
  1429. is a terminal, and the <SAMP>`-f'</SAMP> or <SAMP>`--force'</SAMP> option is not given,
  1430. <CODE>mv</CODE> prompts the user for whether to replace the file.  (You might
  1431. own the file, or have write permission on its directory.)  If the
  1432. response does not begin with <SAMP>`y'</SAMP> or <SAMP>`Y'</SAMP>, the file is skipped.
  1433. <P>
  1434. The program accepts the following options.  Also see section <A HREF="FILEUTIL.000#SEC2">Common options</A>.
  1435. <P>
  1436. <DL COMPACT>
  1437.  
  1438. <DT><SAMP>`-b'</SAMP>
  1439. <DD><DT><SAMP>`--backup'</SAMP>
  1440. <DD>@opindex -b
  1441. @opindex --backup
  1442. <A NAME="IDX121"></A>
  1443. Make backups of files that are about to be overwritten or removed.
  1444. See section <A HREF="FILEUTIL.000#SEC3">Backup options</A>.
  1445.  
  1446. <DT><SAMP>`-f'</SAMP>
  1447. <DD><DT><SAMP>`--force'</SAMP>
  1448. <DD>@opindex -f
  1449. @opindex --force
  1450. <A NAME="IDX122"></A>
  1451. Remove existing destination files and never prompt the user.
  1452.  
  1453. <DT><SAMP>`-i'</SAMP>
  1454. <DD><DT><SAMP>`--interactive'</SAMP>
  1455. <DD>@opindex -i
  1456. @opindex --interactive
  1457. <A NAME="IDX123"></A>
  1458. Prompt whether to overwrite each existing destination file, regardless
  1459. of its permissions.  If the response does not begin with <SAMP>`y'</SAMP> or
  1460. <SAMP>`Y'</SAMP>, the file is skipped.
  1461.  
  1462. <DT><SAMP>`-u'</SAMP>
  1463. <DD><DT><SAMP>`--update'</SAMP>
  1464. <DD>@opindex -u
  1465. @opindex --update
  1466. <A NAME="IDX124"></A>
  1467. Do not move a nondirectory that has an existing destination with the
  1468. same or newer modification time.
  1469.  
  1470. <DT><SAMP>`-v'</SAMP>
  1471. <DD><DT><SAMP>`--verbose'</SAMP>
  1472. <DD>@opindex -v
  1473. @opindex --verbose
  1474. Print the name of each file before moving it.
  1475.  
  1476. <DT><SAMP>`-S <VAR>suffix</VAR>'</SAMP>
  1477. <DD><DT><SAMP>`--suffix=<VAR>suffix</VAR>'</SAMP>
  1478. <DD>@opindex -S
  1479. @opindex --suffix
  1480. Append <VAR>suffix</VAR> to each backup file made with <SAMP>`-b'</SAMP>.
  1481. See section <A HREF="FILEUTIL.000#SEC3">Backup options</A>.
  1482.  
  1483. <DT><SAMP>`-V <VAR>method</VAR>'</SAMP>
  1484. <DD><DT><SAMP>`--version-control=<VAR>method</VAR>'</SAMP>
  1485. <DD>@opindex -V
  1486. @opindex --version-control
  1487. Change the type of backups made with <SAMP>`-b'</SAMP>.  The <VAR>method</VAR>
  1488. argument can be <SAMP>`numbered'</SAMP> (or <SAMP>`t'</SAMP>), <SAMP>`existing'</SAMP> (or
  1489. <SAMP>`nil'</SAMP>), or <SAMP>`never'</SAMP> (or <SAMP>`simple'</SAMP>).  See section <A HREF="FILEUTIL.000#SEC3">Backup options</A>.
  1490.  
  1491. </DL>
  1492. <P>
  1493. <H2><A NAME="SEC28" HREF="FILEUTIL.HTM#SEC28"><CODE>rm</CODE>: Remove files or directories</A></H2>
  1494. <A NAME="IDX125"></A>
  1495. <A NAME="IDX126"></A>
  1496. <P>
  1497. <CODE>rm</CODE> removes each given <VAR>file</VAR>.  By default, it does not remove
  1498. directories.  Synopsis:
  1499. <P>
  1500. <PRE>
  1501. rm [<VAR>option</VAR>]... [<VAR>file</VAR>]...
  1502. </PRE>
  1503. <A NAME="IDX127"></A>
  1504. <P>
  1505. If a file is unwritable, standard input is a terminal, and the <SAMP>`-f'</SAMP>
  1506. or <SAMP>`--force'</SAMP> option is not given, or the <SAMP>`-i'</SAMP> or
  1507. <SAMP>`--interactive'</SAMP> option <EM>is</EM> given, <CODE>rm</CODE> prompts the user
  1508. for whether to remove the file.  If the response does not begin with
  1509. <SAMP>`y'</SAMP> or <SAMP>`Y'</SAMP>, the file is skipped.
  1510. <P>
  1511. The program accepts the following options.  Also see section <A HREF="FILEUTIL.000#SEC2">Common options</A>.
  1512. <P>
  1513. <DL COMPACT>
  1514.  
  1515. <DT><SAMP>`-d'</SAMP>
  1516. <DD><DT><SAMP>`--directory'</SAMP>
  1517. <DD>@opindex -d
  1518. @opindex --directory
  1519. <A NAME="IDX129"></A>
  1520. <A NAME="IDX130"></A>
  1521. <A NAME="IDX128"></A>
  1522. Remove directories with <CODE>unlink</CODE> instead of <CODE>rmdir</CODE>, and don't
  1523. require a directory to be empty before trying to unlink it.  Only works
  1524. if you have appropriate privileges.  Because unlinking a directory
  1525. causes any files in the deleted directory to become unreferenced, it is
  1526. wise to <CODE>fsck</CODE> the filesystem after doing this.
  1527.  
  1528. <DT><SAMP>`-f'</SAMP>
  1529. <DD><DT><SAMP>`--force'</SAMP>
  1530. <DD>@opindex -f
  1531. @opindex --force
  1532. Ignore nonexistent files and never prompt the user.
  1533.  
  1534. <DT><SAMP>`-i'</SAMP>
  1535. <DD><DT><SAMP>`--interactive'</SAMP>
  1536. <DD>@opindex -i
  1537. @opindex --interactive
  1538. Prompt whether to remove each file.  If the response does not begin
  1539. with <SAMP>`y'</SAMP> or <SAMP>`Y'</SAMP>, the file is skipped.
  1540.  
  1541. <DT><SAMP>`-r'</SAMP>
  1542. <DD><DT><SAMP>`-R'</SAMP>
  1543. <DD><DT><SAMP>`--recursive'</SAMP>
  1544. <DD>@opindex -r
  1545. @opindex -R
  1546. @opindex --recursive
  1547. <A NAME="IDX131"></A>
  1548. Remove the contents of directories recursively.
  1549.  
  1550. <DT><SAMP>`-v'</SAMP>
  1551. <DD><DT><SAMP>`--verbose'</SAMP>
  1552. <DD>@opindex -v
  1553. @opindex --verbose
  1554. Print the name of each file before removing it.
  1555.  
  1556. </DL>
  1557. <A NAME="IDX132"></A>
  1558. <A NAME="IDX133"></A>
  1559. <P>
  1560. One common question is how to remove files whose names being with a
  1561. <SAMP>`-'</SAMP>.  GNU <CODE>rm</CODE>, like every program that uses the <CODE>getopt</CODE>
  1562. function to parse its arguments, lets you use the <SAMP>`--'</SAMP> option to
  1563. indicate that all following arguments are non-options.  To remove a file
  1564. called <TT>`-f'</TT> in the current directory, you could type either:
  1565. <P>
  1566. <PRE>
  1567. rm -- -f
  1568. </PRE>
  1569. <P>
  1570. or:
  1571. <P>
  1572. <PRE>
  1573. rm ./-f
  1574. </PRE>
  1575. <P>
  1576. @opindex - and Unix <CODE>rm</CODE>
  1577. The Unix <CODE>rm</CODE> program's use of a single <SAMP>`-'</SAMP> for this purpose
  1578. predates the development of the getopt standard syntax.
  1579. <P>
  1580. <H1><A NAME="SEC29" HREF="FILEUTIL.HTM#SEC29">Special file types</A></H1>
  1581. <A NAME="IDX134"></A>
  1582. <A NAME="IDX135"></A>
  1583. <P>
  1584. This chapter describes commands which create special types of files (and
  1585. <CODE>rmdir</CODE>, which removes directories, one special file type).
  1586. <A NAME="IDX136"></A>
  1587. <A NAME="IDX137"></A>
  1588. <P>
  1589. Although Unix-like operating systems have markedly fewer special file
  1590. types than others, not <EM>everything</EM> can be treated only as the
  1591. undifferentiated byte stream of <DFN>normal files</DFN>.  For example, when a
  1592. file is created or removed, the system must record this information,
  1593. which it does in a <DFN>directory</DFN>---a special type of file.  Although
  1594. you can read directories as normal files, if you're curious, in order
  1595. for the system to do its job it must impose a structure, a certain
  1596. order, on the bytes of the file.  Thus it is a "special" type of file.
  1597. <P>
  1598. Besides directories, other special file types include named pipes
  1599. (FIFOs), symbolic links, sockets, and so-called <DFN>special files</DFN>.
  1600. <P>
  1601. <H2><A NAME="SEC30" HREF="FILEUTIL.HTM#SEC30"><CODE>ln</CODE>: Make links between files</A></H2>
  1602. <A NAME="IDX138"></A>
  1603. <A NAME="IDX139"></A>
  1604. <A NAME="IDX140"></A>
  1605. <A NAME="IDX141"></A>
  1606. <A NAME="IDX142"></A>
  1607. <P>
  1608. <A NAME="IDX143"></A>
  1609. <P>
  1610. <CODE>ln</CODE> makes links between files.  By default, it makes hard links;
  1611. with the <SAMP>`-s'</SAMP> option, it makes symbolic (or <DFN>soft</DFN>) links.
  1612. Synopses:
  1613. <P>
  1614. <PRE>
  1615. ln [<VAR>option</VAR>]... <VAR>source</VAR> [<VAR>dest</VAR>]
  1616. ln [<VAR>option</VAR>]... <VAR>source</VAR>... <VAR>directory</VAR>
  1617. </PRE>
  1618. <P>
  1619. If the last argument names an existing directory, <CODE>ln</CODE> links each
  1620. <VAR>source</VAR> file into a file with the same name in that directory.
  1621. (But see the description of the <SAMP>`--no-dereference'</SAMP> option below.)
  1622. If only one file is given, it links that file into the current directory.
  1623. Otherwise, if only two files are given, it links the first onto the
  1624. second.  It is an error if the last argument is not a directory and more
  1625. than two files are given.  By default, it does not remove existing
  1626. files.
  1627. <P>
  1628. A <DFN>hard link</DFN> is another name for an existing file; the link and the
  1629. original are indistinguishable.  (Technically speaking, they share the
  1630. same inode, and the inode contains all the information about a
  1631. file--indeed, it is not incorrect to say that the inode <EM>is</EM> the
  1632. file.)  On all existing implementations, you cannot make a hard links to
  1633. directories, and hard links cannot cross filesystem boundaries.  (These
  1634. restrictions are not mandated by POSIX, however.)
  1635. <A NAME="IDX144"></A>
  1636. <P>
  1637. <DFN>Symbolic links</DFN> (<DFN>symlinks</DFN> for short), on the other hand, are
  1638. a special file type (which not all kernels support; in particular,
  1639. system V release 3 (and older) systems lack symlinks) in which the link
  1640. file actually refers to a different file, by name.  When most operations
  1641. (opening, reading, writing, and so on) are passed the symbolic link
  1642. file, the kernel automatically <DFN>dereferences</DFN> the link and operates
  1643. on the target of the link.  But some operations (e.g., removing) work on
  1644. the link file itself, rather than on its target.  See section `Symbolic Links' in <CITE>GNU C library</CITE>.
  1645. <P>
  1646. The program accepts the following options.  Also see section <A HREF="FILEUTIL.000#SEC2">Common options</A>.
  1647. <P>
  1648. <DL COMPACT>
  1649.  
  1650. <DT><SAMP>`-b'</SAMP>
  1651. <DD><DT><SAMP>`--backup'</SAMP>
  1652. <DD>@opindex -b
  1653. @opindex --backup
  1654. <A NAME="IDX145"></A>
  1655. Make backups of files that are about to be overwritten or removed.
  1656. See section <A HREF="FILEUTIL.000#SEC3">Backup options</A>.
  1657.  
  1658. <DT><SAMP>`-d'</SAMP>
  1659. <DD><DT><SAMP>`-F'</SAMP>
  1660. <DD><DT><SAMP>`--directory'</SAMP>
  1661. <DD>@opindex -d
  1662. @opindex -F
  1663. @opindex --directory
  1664. <A NAME="IDX146"></A>
  1665. Allow the super-user to make hard links to directories.
  1666.  
  1667. <DT><SAMP>`-f'</SAMP>
  1668. <DD><DT><SAMP>`--force'</SAMP>
  1669. <DD>@opindex -f
  1670. @opindex --force
  1671. Remove existing destination files.
  1672.  
  1673. <DT><SAMP>`-i'</SAMP>
  1674. <DD><DT><SAMP>`--interactive'</SAMP>
  1675. <DD>@opindex -i
  1676. @opindex --interactive
  1677. <A NAME="IDX147"></A>
  1678. Prompt whether to remove existing destination files.
  1679.  
  1680. <DT><SAMP>`-n'</SAMP>
  1681. <DD><DT><SAMP>`--no-dereference'</SAMP>
  1682. <DD>@opindex -n
  1683. @opindex --no-dereference
  1684. When used with <SAMP>`--force'</SAMP> and an explicit destination that is a
  1685. symlink to a directory, remove (or move it with <SAMP>`--backup'</SAMP>) that
  1686. symlink before making any link.
  1687.  
  1688. When the destination is an actual directory (not a symlink to one), 
  1689. there is no ambiguity.  The link is created in that directory.
  1690. But when the specified destination is a symlink to a directory,
  1691. there are two ways to treat the user's request.  <CODE>ln</CODE> can
  1692. treat the destination just as it would a normal directory and create
  1693. the link in it.  On the other hand, the destination can be viewed as a
  1694. non-directory--as the symlink itself.  In that case, <CODE>ln</CODE>
  1695. must delete or backup that symlink before creating the new link.
  1696. The default is to treat a destination that is a symlink to a directory
  1697. just like a directory.
  1698.  
  1699. <DT><SAMP>`-s'</SAMP>
  1700. <DD><DT><SAMP>`--symbolic'</SAMP>
  1701. <DD>@opindex -s
  1702. @opindex --symbolic
  1703. Make symbolic links instead of hard links.  This option merely produces
  1704. an error message on systems that do not support symbolic links.
  1705.  
  1706. <DT><SAMP>`-v'</SAMP>
  1707. <DD><DT><SAMP>`--verbose'</SAMP>
  1708. <DD>@opindex -v
  1709. @opindex --verbose
  1710. Print the name of each file before linking it.
  1711.  
  1712. <DT><SAMP>`-S <VAR>suffix</VAR>'</SAMP>
  1713. <DD><DT><SAMP>`--suffix=<VAR>suffix</VAR>'</SAMP>
  1714. <DD>@opindex -S
  1715. @opindex --suffix
  1716. Append <VAR>suffix</VAR> to each backup file made with <SAMP>`-b'</SAMP>.
  1717. See section <A HREF="FILEUTIL.000#SEC3">Backup options</A>.
  1718.  
  1719. <DT><SAMP>`-V <VAR>method</VAR>'</SAMP>
  1720. <DD><DT><SAMP>`--version-control=<VAR>method</VAR>'</SAMP>
  1721. <DD>@opindex -V
  1722. @opindex --version-control
  1723. Change the type of backups made with <SAMP>`-b'</SAMP>.  The <VAR>method</VAR>
  1724. argument can be <SAMP>`numbered'</SAMP> (or <SAMP>`t'</SAMP>), <SAMP>`existing'</SAMP> (or
  1725. <SAMP>`nil'</SAMP>), or <SAMP>`never'</SAMP> (or <SAMP>`simple'</SAMP>).  See section <A HREF="FILEUTIL.000#SEC3">Backup options</A>.
  1726.  
  1727. </DL>
  1728. <P>
  1729. <H2><A NAME="SEC31" HREF="FILEUTIL.HTM#SEC31"><CODE>mkdir</CODE>: Make directories</A></H2>
  1730. <A NAME="IDX148"></A>
  1731. <A NAME="IDX149"></A>
  1732. <A NAME="IDX150"></A>
  1733. <P>
  1734. <CODE>mkdir</CODE> creates directories with the specified names.  Synopsis:
  1735. <P>
  1736. <PRE>
  1737. mkdir [<VAR>option</VAR>]... <VAR>name</VAR>...
  1738. </PRE>
  1739. <P>
  1740. It is not an error if a <VAR>name</VAR> is already a directory; <CODE>mkdir</CODE>
  1741. simply proceeds.  But if a <VAR>name</VAR> is an existing file and is
  1742. anything but a directory, <CODE>mkdir</CODE> complains.
  1743. <P>
  1744. The program accepts the following options.  Also see section <A HREF="FILEUTIL.000#SEC2">Common options</A>.
  1745. <P>
  1746. <DL COMPACT>
  1747.  
  1748. <DT><SAMP>`-m <VAR>mode</VAR>'</SAMP>
  1749. <DD><DT><SAMP>`--mode=<VAR>mode</VAR>'</SAMP>
  1750. <DD>@opindex -m
  1751. @opindex --mode
  1752. <A NAME="IDX151"></A>
  1753. Set the mode of created directories to <VAR>mode</VAR>, which is symbolic as
  1754. in <CODE>chmod</CODE> and uses 0777 (read, write and execute allowed for
  1755. everyone) minus the bits set in the umask for the point of the
  1756. departure.  See section <A HREF="FILEUTIL.000#SEC4">File permissions</A>.
  1757.  
  1758. <DT><SAMP>`-p'</SAMP>
  1759. <DD><DT><SAMP>`--parents'</SAMP>
  1760. <DD>@opindex -p
  1761. @opindex --parents
  1762. <A NAME="IDX152"></A>
  1763. Make any missing parent directories for each argument.  The mode for parent
  1764. directories is set to the umask modified by <SAMP>`u+wx'</SAMP>.
  1765. Ignore arguments corresponding to existing directories.
  1766.  
  1767. </DL>
  1768. <P>
  1769. <H2><A NAME="SEC32" HREF="FILEUTIL.HTM#SEC32"><CODE>mkfifo</CODE>: Make FIFOs (named pipes)</A></H2>
  1770. <A NAME="IDX153"></A>
  1771. <A NAME="IDX154"></A>
  1772. <A NAME="IDX155"></A>
  1773. <A NAME="IDX156"></A>
  1774. <P>
  1775. <CODE>mkfifo</CODE> creates FIFOs (also called <DFN>named pipes</DFN>) with the
  1776. specified names.  Synopsis:
  1777. <P>
  1778. <PRE>
  1779. mkfifo [<VAR>option</VAR>] <VAR>name</VAR>...
  1780. </PRE>
  1781. <P>
  1782. A <DFN>FIFO</DFN> is a special file type that permits independent processes
  1783. to communicate.  One process opens the FIFO file for writing, and
  1784. another for reading, after which data can flow as with the usual
  1785. anonymous pipe in shells or elsewhere.
  1786. <P>
  1787. The program accepts the following option.  Also see section <A HREF="FILEUTIL.000#SEC2">Common options</A>.
  1788. <P>
  1789. <DL COMPACT>
  1790.  
  1791. <DT><SAMP>`-m <VAR>mode</VAR>'</SAMP>
  1792. <DD><DT><SAMP>`--mode=<VAR>mode</VAR>'</SAMP>
  1793. <DD>@opindex -m
  1794. @opindex --mode
  1795. <A NAME="IDX157"></A>
  1796. Set the mode of created FIFOs to <VAR>mode</VAR>, which is symbolic as in
  1797. <CODE>chmod</CODE> and uses 0666 (read and write allowed for everyone) minus
  1798. the bits set in the umask for the point of departure.  See section <A HREF="FILEUTIL.000#SEC4">File permissions</A>.
  1799.  
  1800. </DL>
  1801. <P>
  1802. <H2><A NAME="SEC33" HREF="FILEUTIL.HTM#SEC33"><CODE>mknod</CODE>: Make block or character special files</A></H2>
  1803. <A NAME="IDX158"></A>
  1804. <A NAME="IDX159"></A>
  1805. <A NAME="IDX160"></A>
  1806. <P>
  1807. <CODE>mknod</CODE> creates a FIFO, character special file, or block special
  1808. file with the specified name.  Synopsis:
  1809. <P>
  1810. <PRE>
  1811. mknod [<VAR>option</VAR>]... <VAR>name</VAR> <VAR>type</VAR> [<VAR>major</VAR> <VAR>minor</VAR>]
  1812. </PRE>
  1813. <A NAME="IDX161"></A>
  1814. <A NAME="IDX162"></A>
  1815. <A NAME="IDX163"></A>
  1816. <P>
  1817. Unlike the phrase "special file type" above, the term <DFN>special
  1818. file</DFN> has a technical meaning on Unix: something that can generate or
  1819. receive data.  Usually this corresponds to a physical piece of hardware,
  1820. e.g., a printer or a disk.  (These files are typically created at
  1821. system-configuration time.)  The <CODE>mknod</CODE> command is what creates
  1822. files of this type.  Such devices can be read either a character at a
  1823. time or a "block" (many characters) at a time, hence we say there are
  1824. <DFN>block special</DFN> files and <DFN>character special</DFN> files.
  1825. <P>
  1826. The arguments after <VAR>name</VAR> specify the type of file to make:
  1827. <P>
  1828. <DL COMPACT>
  1829.  
  1830. <DT><SAMP>`p'</SAMP>
  1831. <DD>@opindex p for FIFO file
  1832. for a FIFO
  1833.  
  1834. <DT><SAMP>`b'</SAMP>
  1835. <DD>@opindex b for block special file
  1836. for a block (buffered) special file
  1837.  
  1838. <DT><SAMP>`c'</SAMP>
  1839. <DD>@opindex c for character special file
  1840. <A NAME="IDX164"></A>
  1841. for a character (buffered) special file
  1842.  
  1843. <DT><SAMP>`u'</SAMP>
  1844. <DD>@opindex u for unbuffered character special file
  1845. <A NAME="IDX165"></A>
  1846. for a character (unbuffered) special file
  1847.  
  1848. </DL>
  1849. <P>
  1850. When making a block or character special file, the major and minor
  1851. device numbers must be given after the file type.
  1852. <P>
  1853. The program accepts the following option.  Also see section <A HREF="FILEUTIL.000#SEC2">Common options</A>.
  1854. <P>
  1855. <DL COMPACT>
  1856.  
  1857. <DT><SAMP>`-m <VAR>mode</VAR>'</SAMP>
  1858. <DD><DT><SAMP>`--mode=<VAR>mode</VAR>'</SAMP>
  1859. <DD>@opindex -m
  1860. @opindex --mode
  1861. Set the mode of created files to <VAR>mode</VAR>, which is symbolic as in
  1862. <CODE>chmod</CODE> and uses 0666 minus the bits set in the umask as the point
  1863. of departure.  See section <A HREF="FILEUTIL.000#SEC4">File permissions</A>.
  1864.  
  1865. </DL>
  1866. <P>
  1867. <H2><A NAME="SEC34" HREF="FILEUTIL.HTM#SEC34"><CODE>rmdir</CODE>: Remove empty directories</A></H2>
  1868. <A NAME="IDX166"></A>
  1869. <A NAME="IDX167"></A>
  1870. <A NAME="IDX168"></A>
  1871. <P>
  1872. <CODE>rmdir</CODE> removes empty directories.  Synopsis:
  1873. <P>
  1874. <PRE>
  1875. rmdir [<VAR>option</VAR>]... <VAR>directory</VAR>...
  1876. </PRE>
  1877. <P>
  1878. If any <VAR>directory</VAR> argument does not refer to an existing empty
  1879. directory, it is an error.
  1880. <P>
  1881. The program accepts the following option.  Also see section <A HREF="FILEUTIL.000#SEC2">Common options</A>.
  1882. <P>
  1883. <DL COMPACT>
  1884.  
  1885. <DT><SAMP>`-p'</SAMP>
  1886. <DD><DT><SAMP>`--parents'</SAMP>
  1887. <DD>@opindex -p
  1888. @opindex --parents
  1889. <A NAME="IDX169"></A>
  1890. Remove any parent directories that become empty after an argument
  1891. <VAR>directory</VAR> is removed.
  1892.  
  1893. </DL>
  1894. <P>
  1895. See section <A HREF="FILEUTIL.000#SEC28"><CODE>rm</CODE>: Remove files or directories</A>, for how to remove non-empty directories (recursively).
  1896. <P>
  1897. <H1><A NAME="SEC35" HREF="FILEUTIL.HTM#SEC35">Changing file attributes</A></H1>
  1898. <A NAME="IDX170"></A>
  1899. <A NAME="IDX171"></A>
  1900. <A NAME="IDX172"></A>
  1901. <P>
  1902. Files are not merely contents, a name, and a file type (see section <A HREF="FILEUTIL.000#SEC29">Special file types</A>).  They also have an owner (a userid), a group (a group id),
  1903. permissions (what the owner can do with the file, what people in the
  1904. group can do, and what everyone else can do), various timestamps, and
  1905. other information.  Collectively, we call all this a file's
  1906. <DFN>attributes</DFN>.
  1907. <P>
  1908. These commands change file attributes.
  1909. <P>
  1910. <H2><A NAME="SEC36" HREF="FILEUTIL.HTM#SEC36"><CODE>chown</CODE>: Change file owner and group</A></H2>
  1911. <A NAME="IDX173"></A>
  1912. <A NAME="IDX174"></A>
  1913. <A NAME="IDX175"></A>
  1914. <A NAME="IDX176"></A>
  1915. <A NAME="IDX177"></A>
  1916. <P>
  1917. <CODE>chown</CODE> changes the user and/or group ownership of each given
  1918. file.  Synopsis:
  1919. <P>
  1920. <PRE>
  1921. chown [<VAR>option</VAR>]... <VAR>new-owner</VAR> <VAR>file</VAR>...
  1922. </PRE>
  1923. <P>
  1924. The first non-option argument, <VAR>new-owner</VAR>, specifies the new owner
  1925. and/or group, as follows (with no embedded white space):
  1926. <P>
  1927. <PRE>
  1928. [<VAR>owner</VAR>] [ [:.] [<VAR>group</VAR>] ]
  1929. </PRE>
  1930. <P>
  1931. Specifically:
  1932. <P>
  1933. <DL COMPACT>
  1934.  
  1935. <DT><VAR>owner</VAR>
  1936. <DD>If only an <VAR>owner</VAR> (a user name or numeric user id) is given, that
  1937. user is made the owner of each given file, and the files' group is not
  1938. changed.
  1939.  
  1940. <DT><VAR>owner<SAMP>`.'</SAMP>group</VAR>
  1941. <DD><DT><VAR>owner<SAMP>`:'</SAMP>group</VAR>
  1942. <DD>If the <VAR>owner</VAR> is followed by a colon or dot and a <VAR>group</VAR> (a
  1943. group name or numeric group id), with no spaces between them, the group
  1944. ownership of the files is changed as well (to <VAR>group</VAR>).
  1945.  
  1946. <DT><VAR>owner<SAMP>`.'</SAMP></VAR>
  1947. <DD><DT><VAR>owner<SAMP>`:'</SAMP></VAR>
  1948. <DD>If a colon or dot but no group name follows <VAR>owner</VAR>, that user is
  1949. made the owner of the files and the group of the files is changed to
  1950. <VAR>owner</VAR>'s login group.
  1951.  
  1952. <DT><VAR><SAMP>`.'</SAMP>group</VAR>
  1953. <DD><DT><VAR><SAMP>`:'</SAMP>group</VAR>
  1954. <DD>If the colon or dot and following <VAR>group</VAR> are given, but the owner
  1955. is omitted, only the group of the files is changed; in this case,
  1956. <CODE>chown</CODE> performs the same function as <CODE>chgrp</CODE>.
  1957.  
  1958. </DL>
  1959. <P>
  1960. The program accepts the following options.  Also see section <A HREF="FILEUTIL.000#SEC2">Common options</A>.
  1961. <P>
  1962. <DL COMPACT>
  1963.  
  1964. <DT><SAMP>`-c'</SAMP>
  1965. <DD><DT><SAMP>`--changes'</SAMP>
  1966. <DD>@opindex -c
  1967. @opindex --changes
  1968. <A NAME="IDX178"></A>
  1969. Verbosely describe the action for each <VAR>file</VAR> whose ownership
  1970. actually changes.
  1971.  
  1972. <DT><SAMP>`-f'</SAMP>
  1973. <DD><DT><SAMP>`--silent'</SAMP>
  1974. <DD><DT><SAMP>`--quiet'</SAMP>
  1975. <DD>@opindex -f
  1976. @opindex --silent
  1977. @opindex --quiet
  1978. <A NAME="IDX179"></A>
  1979. Do not print error messages about files whose ownership cannot be
  1980. changed.
  1981.  
  1982. <DT><SAMP>`-v'</SAMP>
  1983. <DD><DT><SAMP>`--verbose'</SAMP>
  1984. <DD>@opindex -v
  1985. @opindex --verbose
  1986. Verbosely describe the action (or non-action) taken for every <VAR>file</VAR>.
  1987.  
  1988. <DT><SAMP>`-R'</SAMP>
  1989. <DD><DT><SAMP>`--recursive'</SAMP>
  1990. <DD>@opindex -R
  1991. @opindex --recursive
  1992. <A NAME="IDX180"></A>
  1993. Recursively change ownership of directories and their contents.
  1994.  
  1995. </DL>
  1996. <P>
  1997. <H2><A NAME="SEC37" HREF="FILEUTIL.HTM#SEC37"><CODE>chgrp</CODE>: Change group ownership</A></H2>
  1998. <A NAME="IDX181"></A>
  1999. <A NAME="IDX182"></A>
  2000. <A NAME="IDX183"></A>
  2001. <P>
  2002. <CODE>chgrp</CODE> changes the group ownership of each given <VAR>file</VAR> to
  2003. <VAR>group</VAR>, which can be either a group name or a numeric group id.
  2004. Synopsis:
  2005. <P>
  2006. <PRE>
  2007. chgrp [<VAR>option</VAR>]... <VAR>group</VAR> <VAR>file</VAR>...
  2008. </PRE>
  2009. <P>
  2010. The program accepts the following options.  Also see section <A HREF="FILEUTIL.000#SEC2">Common options</A>.
  2011. <P>
  2012. <DL COMPACT>
  2013.  
  2014. <DT><SAMP>`-c'</SAMP>
  2015. <DD><DT><SAMP>`--changes'</SAMP>
  2016. <DD>@opindex -c
  2017. @opindex --changes
  2018. <A NAME="IDX184"></A>
  2019. Verbosely describe the action for each <VAR>file</VAR> whose group actually
  2020. changes.
  2021.  
  2022. <DT><SAMP>`-f'</SAMP>
  2023. <DD><DT><SAMP>`--silent'</SAMP>
  2024. <DD><DT><SAMP>`--quiet'</SAMP>
  2025. <DD>@opindex -f
  2026. @opindex --silent
  2027. @opindex --quiet
  2028. <A NAME="IDX185"></A>
  2029. Do not print error messages about files whose group cannot be
  2030. changed.
  2031.  
  2032. <DT><SAMP>`-v'</SAMP>
  2033. <DD><DT><SAMP>`--verbose'</SAMP>
  2034. <DD>@opindex -v
  2035. @opindex --verbose
  2036. Verbosely describe the action or non-action taken for every <VAR>file</VAR>.
  2037.  
  2038. <DT><SAMP>`-R'</SAMP>
  2039. <DD><DT><SAMP>`--recursive'</SAMP>
  2040. <DD>@opindex -R
  2041. @opindex --recursive
  2042. <A NAME="IDX186"></A>
  2043. Recursively change the group ownership of directories and their contents.
  2044.  
  2045. </DL>
  2046. <P>
  2047. <H2><A NAME="SEC38" HREF="FILEUTIL.HTM#SEC38"><CODE>chmod</CODE>: Change access permissions</A></H2>
  2048. <A NAME="IDX187"></A>
  2049. <A NAME="IDX188"></A>
  2050. <A NAME="IDX189"></A>
  2051. <A NAME="IDX190"></A>
  2052. <P>
  2053. <CODE>chmod</CODE> changes the access permissions of the named files.  Synopsis:
  2054. <P>
  2055. <PRE>
  2056. chmod [<VAR>option</VAR>]... <VAR>mode</VAR> <VAR>file</VAR>...
  2057. </PRE>
  2058. <A NAME="IDX191"></A>
  2059. <P>
  2060. <CODE>chmod</CODE> never changes the permissions of symbolic links, since
  2061. the <CODE>chmod</CODE> system call cannot change their permissions.
  2062. This is not a problem since the permissions of symbolic links are
  2063. never used.  However, for each symbolic link listed on the command
  2064. line, <CODE>chmod</CODE> changes the permissions of the pointed-to file.
  2065. In contrast, <CODE>chmod</CODE> ignores symbolic links encountered during
  2066. recursive directory traversals.
  2067. <P>
  2068. The first non-option argument, <VAR>mode</VAR>, specifies the new
  2069. permissions.  See the section below for details.
  2070. <P>
  2071. The program accepts the following options.  Also see section <A HREF="FILEUTIL.000#SEC2">Common options</A>.
  2072. <P>
  2073. <DL COMPACT>
  2074.  
  2075. <DT><SAMP>`-c'</SAMP>
  2076. <DD><DT><SAMP>`--changes'</SAMP>
  2077. <DD>@opindex -c
  2078. @opindex --changes
  2079. Verbosely describe the action for each <VAR>file</VAR> whose permissions
  2080. actually changes.
  2081.  
  2082. <DT><SAMP>`-f'</SAMP>
  2083. <DD><DT><SAMP>`--silent'</SAMP>
  2084. <DD><DT><SAMP>`--quiet'</SAMP>
  2085. <DD>@opindex -f
  2086. @opindex --silent
  2087. @opindex --quiet
  2088. <A NAME="IDX192"></A>
  2089. Do not print error messages about files whose permissions cannot be
  2090. changed.
  2091.  
  2092. <DT><SAMP>`-v'</SAMP>
  2093. <DD><DT><SAMP>`--verbose'</SAMP>
  2094. <DD>@opindex -v
  2095. @opindex --verbose
  2096. Verbosely describe the action or non-action taken for every <VAR>file</VAR>.
  2097.  
  2098. <DT><SAMP>`-R'</SAMP>
  2099. <DD><DT><SAMP>`--recursive'</SAMP>
  2100. <DD>@opindex -R
  2101. @opindex --recursive
  2102. <A NAME="IDX193"></A>
  2103. Recursively change permissions of directories and their contents.
  2104.  
  2105. </DL>
  2106. <P>
  2107. <H2><A NAME="SEC39" HREF="FILEUTIL.HTM#SEC39"><CODE>touch</CODE>: Change file timestamps</A></H2>
  2108. <A NAME="IDX194"></A>
  2109. <A NAME="IDX195"></A>
  2110. <A NAME="IDX196"></A>
  2111. <A NAME="IDX197"></A>
  2112. <P>
  2113. <CODE>touch</CODE> changes the access and/or modification times of the
  2114. specified files.  Synopsis:
  2115. <P>
  2116. <PRE>
  2117. touch [<VAR>option</VAR>]... <VAR>file</VAR>...
  2118. </PRE>
  2119. <P>
  2120. If the first <VAR>file</VAR> would be a valid argument to the <SAMP>`-t'</SAMP>
  2121. option and no timestamp is given with any of the <SAMP>`-d'</SAMP>, <SAMP>`-r'</SAMP>,
  2122. or <SAMP>`-t'</SAMP> options and the <SAMP>`--'</SAMP> argument is not given, that
  2123. argument is interpreted as the time for the other files instead of
  2124. as a filename.
  2125. <A NAME="IDX198"></A>
  2126. <P>
  2127. Any <VAR>file</VAR> that does not exist is created empty.
  2128. <A NAME="IDX199"></A>
  2129. <P>
  2130. If changing both the access and modification times to the current
  2131. time, <CODE>touch</CODE> can change the timestamps for files that the user
  2132. running it does not own but has write permission for.  Otherwise, the
  2133. user must own the files.
  2134. <P>
  2135. The program accepts the following options.  Also see section <A HREF="FILEUTIL.000#SEC2">Common options</A>.
  2136. <P>
  2137. <DL COMPACT>
  2138.  
  2139. <DT><SAMP>`-a'</SAMP>
  2140. <DD><DT><SAMP>`--time=atime'</SAMP>
  2141. <DD><DT><SAMP>`--time=access'</SAMP>
  2142. <DD><DT><SAMP>`--time=use'</SAMP>
  2143. <DD>@opindex -a
  2144. @opindex --time
  2145. @opindex atime, changing
  2146. @opindex access time, changing
  2147. @opindex use time, changing
  2148. Change the access time only.
  2149.  
  2150. <DT><SAMP>`-c'</SAMP>
  2151. <DD><DT><SAMP>`--no-create'</SAMP>
  2152. <DD>@opindex -c
  2153. @opindex --no-create
  2154. Do not create files that do not exist.
  2155.  
  2156. <DT><SAMP>`-d'</SAMP>
  2157. <DD><DT><SAMP>`--date=time'</SAMP>
  2158. <DD>@opindex -d
  2159. @opindex --date
  2160. @opindex time
  2161. Use <VAR>time</VAR> instead of the current time.  It can contain month names,
  2162. timezones, <SAMP>`am'</SAMP> and <SAMP>`pm'</SAMP>, etc.  See section `date invocation' in <CITE>Shell utilities</CITE>.
  2163.  
  2164. <DT><SAMP>`-f'</SAMP>
  2165. <DD>Ignored; for compatibility with BSD versions of <CODE>touch</CODE>.
  2166.  
  2167. <DT><SAMP>`-m'</SAMP>
  2168. <DD><DT><SAMP>`--time=mtime'</SAMP>
  2169. <DD><DT><SAMP>`--time=modify'</SAMP>
  2170. <DD>@opindex -m
  2171. @opindex --time
  2172. @opindex mtime, changing
  2173. @opindex modify time, changing
  2174. Change the modification time only.
  2175.  
  2176. <DT><SAMP>`-r <VAR>reference-file</VAR>'</SAMP>
  2177. <DD><DT><SAMP>`--file=<VAR>reference-file</VAR>'</SAMP>
  2178. <DD>@opindex -r
  2179. @opindex --file
  2180. Use the times of <VAR>reference-file</VAR> instead of the current time.
  2181.  
  2182. <DT><SAMP>`-t MMDDhhmm[[CC]YY][.ss]'</SAMP>
  2183. <DD>Use the argument (months, days, hours, minutes, optional century and
  2184. years, optional seconds) instead of the current time.
  2185.  
  2186. </DL>
  2187. <P>
  2188. <H1><A NAME="SEC40" HREF="FILEUTIL.HTM#SEC40">Disk usage</A></H1>
  2189. <A NAME="IDX200"></A>
  2190. <P>
  2191. No disk can hold an infinite amount of data.  These commands report on
  2192. how much disk storage is in use or available.  (This has nothing much to
  2193. do with how much <EM>main memory</EM>, i.e., RAM, a program is using when
  2194. it runs; for that, you want <CODE>ps</CODE> or <CODE>pstat</CODE> or <CODE>swap</CODE>
  2195. or some such command.)
  2196. <P>
  2197. <H2><A NAME="SEC41" HREF="FILEUTIL.HTM#SEC41"><CODE>df</CODE>: Report filesystem disk space usage</A></H2>
  2198. <A NAME="IDX201"></A>
  2199. <A NAME="IDX202"></A>
  2200. <A NAME="IDX203"></A>
  2201. <P>
  2202. <CODE>df</CODE> reports the amount of disk space used and available on
  2203. filesystems.  Synopsis:
  2204. <P>
  2205. <PRE>
  2206. df [<VAR>option</VAR>]... [<VAR>file</VAR>]...
  2207. </PRE>
  2208. <P>
  2209. With no arguments, <CODE>df</CODE> reports the space used and available on all
  2210. currently mounted filesystems (of all types).  Otherwise, <CODE>df</CODE>
  2211. reports on the filesystem containing each argument <VAR>file</VAR>.
  2212. <A NAME="IDX204"></A>
  2213. <P>
  2214. Disk space is shown in 1024-byte blocks by default, unless the
  2215. environment variable <CODE>POSIXLY_CORRECT</CODE> is set, in which case
  2216. 512-byte blocks are used (unless the <SAMP>`-k'</SAMP> option is given).
  2217. <A NAME="IDX205"></A>
  2218. <A NAME="IDX206"></A>
  2219. <P>
  2220. If an argument <VAR>file</VAR> is a disk device file containing a mounted
  2221. filesystem, <CODE>df</CODE> shows the space available on that filesystem
  2222. rather than on the filesystem containing the device node (i.e., the root
  2223. filesystem).  GNU <CODE>df</CODE> does not attempt to determine the disk usage
  2224. on unmounted filesystems, because on most kinds of systems doing so
  2225. requires extremely nonportable intimate knowledge of filesystem
  2226. structures.
  2227. <P>
  2228. The program accepts the following options.  Also see section <A HREF="FILEUTIL.000#SEC2">Common options</A>.
  2229. <P>
  2230. <DL COMPACT>
  2231.  
  2232. <DT><SAMP>`-a'</SAMP>
  2233. <DD><DT><SAMP>`--all'</SAMP>
  2234. <DD>@opindex -a
  2235. @opindex --all
  2236. <A NAME="IDX208"></A>
  2237. <A NAME="IDX207"></A>
  2238. Include in the listing filesystems that have 0 blocks, which are omitted
  2239. by default.  Such filesystems are typically special-purpose
  2240. pseudo-filesystems, such as automounter entries.  Filesystems of type
  2241. "ignore" or "auto", supported by some operating systems, are only
  2242. included in the listing if this option is specified.
  2243.  
  2244. <DT><SAMP>`-i'</SAMP>
  2245. <DD><DT><SAMP>`--inodes'</SAMP>
  2246. <DD>@opindex -i
  2247. @opindex --inodes
  2248. <A NAME="IDX209"></A>
  2249. List inode usage information instead of block usage.  An inode (short
  2250. for index node) is contains information about a file such as its owner,
  2251. permissions, timestamps, and location on the disk.
  2252.  
  2253. <DT><SAMP>`-k'</SAMP>
  2254. <DD><DT><SAMP>`--kilobytes'</SAMP>
  2255. <DD>@opindex -k
  2256. @opindex --kilobytes
  2257. <A NAME="IDX210"></A>
  2258. Print sizes in 1024-byte blocks.  This overrides the environment
  2259. variable <CODE>POSIXLY_CORRECT</CODE>.
  2260.  
  2261. <DT><SAMP>`--no-sync'</SAMP>
  2262. <DD>@opindex --no-sync
  2263. <A NAME="IDX211"></A>
  2264. Do not invoke the <CODE>sync</CODE> system call before getting any usage data.
  2265. This may make <CODE>df</CODE> run significantly faster on systems with many disks,
  2266. but on some systems the results may be slightly out of date.
  2267.  
  2268. <DT><SAMP>`-P'</SAMP>
  2269. <DD><DT><SAMP>`--portability'</SAMP>
  2270. <DD>@opindex -P
  2271. @opindex --portability
  2272. <A NAME="IDX213"></A>
  2273. <A NAME="IDX214"></A>
  2274. <A NAME="IDX215"></A>
  2275. <A NAME="IDX212"></A>
  2276. Use the POSIX output format.  This is like the default format except
  2277. that the information about each filesystem is always printed on exactly
  2278. one line; a mount device is never put on a line by itself.  This means
  2279. that if the mount device name is more than 20 characters long (e.g., for
  2280. some network mounts), the columns are misaligned.
  2281.  
  2282. <DT><SAMP>`--sync'</SAMP>
  2283. <DD>@opindex --sync
  2284. <A NAME="IDX216"></A>
  2285. Invoke the <CODE>sync</CODE> system call before getting any usage data.
  2286. On some systems, doing this yields more up to date results, but in
  2287. general this option makes <CODE>df</CODE> much slower, especially when there
  2288. are many or very busy filesystems.
  2289.  
  2290. <DT><SAMP>`-t <VAR>fstype</VAR>'</SAMP>
  2291. <DD><DT><SAMP>`--type=<VAR>fstype</VAR>'</SAMP>
  2292. <DD>@opindex -t
  2293. @opindex --type
  2294. <A NAME="IDX217"></A>
  2295. Limit the listing to filesystems of type <VAR>fstype</VAR>.  Multiple
  2296. filesystem types can be specified by giving multiple <SAMP>`-t'</SAMP> options.
  2297. By default, nothing is omitted.
  2298.  
  2299. <DT><SAMP>`-T'</SAMP>
  2300. <DD><DT><SAMP>`--print-type'</SAMP>
  2301. <DD>@opindex -T
  2302. @opindex --print-type
  2303. <A NAME="IDX218"></A>
  2304. Print each filesystem's type.  The types printed here are the same ones
  2305. you can include or exclude with <SAMP>`-t'</SAMP> and <SAMP>`-x'</SAMP>.  The particular
  2306. types printed are whatever is supported by the system.  Here are some of
  2307. the common names (this list is certainly not exhaustive):
  2308.  
  2309. <DL COMPACT>
  2310.  
  2311. <A NAME="IDX219"></A>
  2312. <DT><SAMP>`nfs'</SAMP>
  2313. <DD>An NFS filesystem, i.e., one mounted over a network from another
  2314. machine.  This is the one type name which seems to be used uniformly by
  2315. all systems.
  2316.  
  2317. <A NAME="IDX220"></A>
  2318. <A NAME="IDX221"></A>
  2319. <DT><SAMP>`4.2, ufs, efs...'</SAMP>
  2320. <DD>@opindex 4.2 filesystem type
  2321. @opindex ufs filesystem type
  2322. @opindex efs filesystem type
  2323. A filesystem on a locally-mounted hard disk.  (The system might even
  2324. support more than one type here; Linux does.)
  2325.  
  2326. <A NAME="IDX222"></A>
  2327. <A NAME="IDX223"></A>
  2328. <DT><SAMP>`hsfs, cdfs'</SAMP>
  2329. <DD>@opindex hsfs filesystem type
  2330. @opindex cdfs filesystem type
  2331. A filesystem on a CD-ROM drive.  HP-UX uses <SAMP>`cdfs'</SAMP>, most other
  2332. systems use <SAMP>`hsfs'</SAMP> (<SAMP>`hs'</SAMP> for `High Sierra').
  2333.  
  2334. <A NAME="IDX224"></A>
  2335. <A NAME="IDX225"></A>
  2336. <A NAME="IDX226"></A>
  2337. <A NAME="IDX227"></A>
  2338. <DT><SAMP>`pcfs'</SAMP>
  2339. <DD>@opindex pcfs
  2340. An MS-DOS filesystem, usually on a diskette.
  2341.  
  2342. </DL>
  2343.  
  2344. <DT><SAMP>`-x <VAR>fstype</VAR>'</SAMP>
  2345. <DD><DT><SAMP>`--exclude-type=<VAR>fstype</VAR>'</SAMP>
  2346. <DD>@opindex -x
  2347. @opindex --exclude-type
  2348. Limit the listing to filesystems not of type <VAR>fstype</VAR>.
  2349. Multiple filesystem types can be eliminated by giving multiple
  2350. <SAMP>`-x'</SAMP> options.  By default, no filesystem types are omitted.
  2351.  
  2352. <DT><SAMP>`-v'</SAMP>
  2353. <DD>Ignored; for compatibility with System V versions of <CODE>df</CODE>.
  2354.  
  2355. </DL>
  2356. <P>
  2357. <H2><A NAME="SEC42" HREF="FILEUTIL.HTM#SEC42"><CODE>du</CODE>: Estimate file space usage</A></H2>
  2358. <A NAME="IDX228"></A>
  2359. <A NAME="IDX229"></A>
  2360. <A NAME="IDX230"></A>
  2361. <P>
  2362. <CODE>du</CODE> reports the amount of disk space used by the specified files
  2363. and for each subdirectory (of directory arguments).  Synopsis:
  2364. <P>
  2365. <PRE>
  2366. du [<VAR>option</VAR>]... [<VAR>file</VAR>]...
  2367. </PRE>
  2368. <P>
  2369. With no arguments, <CODE>du</CODE> reports the disk space for the current
  2370. directory.  The output is in 1024-byte units by default, unless the
  2371. environment variable <CODE>POSIXLY_CORRECT</CODE> is set, in which case
  2372. 512-byte blocks are used (unless <SAMP>`-k'</SAMP> is specified).
  2373. <P>
  2374. The program accepts the following options.  Also see section <A HREF="FILEUTIL.000#SEC2">Common options</A>.
  2375. <P>
  2376. <DL COMPACT>
  2377.  
  2378. <DT><SAMP>`-a'</SAMP>
  2379. <DD><DT><SAMP>`--all'</SAMP>
  2380. <DD>@opindex -a
  2381. @opindex --all
  2382. Show counts for all files, not just directories.
  2383.  
  2384. <DT><SAMP>`-b'</SAMP>
  2385. <DD><DT><SAMP>`--bytes'</SAMP>
  2386. <DD>@opindex -b
  2387. @opindex --bytes
  2388. Print sizes in bytes, instead of kilobytes.
  2389.  
  2390. <DT><SAMP>`-c'</SAMP>
  2391. <DD><DT><SAMP>`--total'</SAMP>
  2392. <DD>@opindex -c
  2393. @opindex --total
  2394. <A NAME="IDX231"></A>
  2395. Print a grand total of all arguments after all arguments have
  2396. been processed.  This can be used to find out the total disk usage of 
  2397. a given set of files or directories.
  2398.  
  2399. <DT><SAMP>`-D'</SAMP>
  2400. <DD><DT><SAMP>`--dereference-args'</SAMP>
  2401. <DD>@opindex -D
  2402. @opindex --dereference-args
  2403. Dereference symbolic links that are command line arguments.
  2404. Does not affect other symbolic links.  This is helpful for finding
  2405. out the disk usage of directories, such as <TT>`/usr/tmp'</TT>, which
  2406. are often symbolic links.
  2407.  
  2408. <DT><SAMP>`-k'</SAMP>
  2409. <DD><DT><SAMP>`--kilobytes'</SAMP>
  2410. <DD>@opindex -k
  2411. @opindex --kilobytes
  2412. <A NAME="IDX232"></A>
  2413. Print sizes in kilobytes.  This overrides the environment variable
  2414. <CODE>POSIXLY_CORRECT</CODE>.
  2415.  
  2416. <DT><SAMP>`-l'</SAMP>
  2417. <DD><DT><SAMP>`--count-links'</SAMP>
  2418. <DD>@opindex -l
  2419. @opindex --count-links
  2420. Count the size of all files, even if they have appeared already (as a
  2421. hard link).
  2422.  
  2423. <DT><SAMP>`-L'</SAMP>
  2424. <DD><DT><SAMP>`--dereference'</SAMP>
  2425. <DD>@opindex -L
  2426. @opindex --dereference
  2427. Dereference symbolic links (show the disk space used by the file
  2428. or directory that the link points to instead of the space used by
  2429. the link).
  2430.  
  2431. <DT><SAMP>`-s'</SAMP>
  2432. <DD><DT><SAMP>`--summarize'</SAMP>
  2433. <DD>@opindex -s
  2434. @opindex --summarize
  2435. Display only a total for each argument.
  2436.  
  2437. <DT><SAMP>`-S'</SAMP>
  2438. <DD><DT><SAMP>`--separate-dirs'</SAMP>
  2439. <DD>@opindex -S
  2440. @opindex --separate-dirs
  2441. Report the size of each directory separately, not including the sizes
  2442. of subdirectories.
  2443.  
  2444. <DT><SAMP>`-x'</SAMP>
  2445. <DD><DT><SAMP>`--one-file-system'</SAMP>
  2446. <DD>@opindex -x
  2447. @opindex --one-file-system
  2448. <A NAME="IDX233"></A>
  2449. Skip directories that are on different filesystems from the one that
  2450. the argument being processed is on.
  2451.  
  2452. </DL>
  2453. <A NAME="IDX234"></A>
  2454. <P>
  2455. On BSD systems, <CODE>du</CODE> reports sizes that are half the correct
  2456. values for files that are NFS-mounted from HP-UX systems.  On HP-UX
  2457. systems, it reports sizes that are twice the correct values for
  2458. files that are NFS-mounted from BSD systems.  This is due to a flaw
  2459. in HP-UX; it also affects the HP-UX <CODE>du</CODE> program.
  2460. <P>
  2461. <H2><A NAME="SEC43" HREF="FILEUTIL.HTM#SEC43"><CODE>sync</CODE>: Synchronize data on disk with memory</A></H2>
  2462. <A NAME="IDX235"></A>
  2463. <A NAME="IDX236"></A>
  2464. <P>
  2465. <A NAME="IDX237"></A>
  2466. <A NAME="IDX238"></A>
  2467. <P>
  2468. <CODE>sync</CODE> writes any data buffered in memory out to disk.  This can
  2469. include (but is not limited to) modified superblocks, modified inodes,
  2470. and delayed reads and writes.  This must be implemented by the kernel;
  2471. The <CODE>sync</CODE> program does nothing but exercise the <CODE>sync</CODE> system
  2472. call.
  2473. <A NAME="IDX239"></A>
  2474. <P>
  2475. The kernel keeps data in memory to avoid doing (relatively slow) disk
  2476. reads and writes.  This improves performance, but if the computer
  2477. crashes, data may be lost or the filesystem corrupted as a
  2478. result. <CODE>sync</CODE> ensures everything in memory is written to disk.
  2479. <P>
  2480. Any arguments are ignored, except for a lone <SAMP>`--help'</SAMP> or
  2481. <SAMP>`--version'</SAMP> (see section <A HREF="FILEUTIL.000#SEC2">Common options</A>).
  2482. <P>
  2483. <H1><A NAME="SEC44" HREF="FILEUTIL.HTM#SEC44">Index</A></H1>
  2484. <P>
  2485. <H2>-</H2>
  2486. <DIR>
  2487. <LI><A HREF="FILEUTIL.000#IDX133"><SAMP>`-'</SAMP>, removing files beginning with</A>
  2488. </DIR>
  2489. <H2>a</H2>
  2490. <DIR>
  2491. <LI><A HREF="FILEUTIL.000#IDX189">access permissions, changing</A>
  2492. <LI><A HREF="FILEUTIL.000#IDX32">adding permissions</A>
  2493. <LI><A HREF="FILEUTIL.000#IDX27">append-only directories</A>
  2494. <LI><A HREF="FILEUTIL.000#IDX115">appropriate privileges</A>
  2495. <LI><A HREF="FILEUTIL.000#IDX172">attributes, file</A>
  2496. <LI><A HREF="FILEUTIL.000#IDX207">automounter filesystems</A>
  2497. </DIR>
  2498. <H2>b</H2>
  2499. <DIR>
  2500. <LI><A HREF="FILEUTIL.000#IDX69">backslash sequences for filenames</A>
  2501. <LI><A HREF="FILEUTIL.000#IDX52">backup files, ignoring</A>
  2502. <LI><A HREF="FILEUTIL.000#IDX13">backup files, type made</A>
  2503. <LI><A HREF="FILEUTIL.000#IDX8">backup options</A>
  2504. <LI><A HREF="FILEUTIL.000#IDX10">backup suffix</A>
  2505. <LI><A HREF="FILEUTIL.000#IDX145">backups, making</A>
  2506. <LI><A HREF="FILEUTIL.000#IDX100">block size</A>
  2507. <LI><A HREF="FILEUTIL.000#IDX101">block size of conversion</A>
  2508. <LI><A HREF="FILEUTIL.000#IDX96">block size of input</A>
  2509. <LI><A HREF="FILEUTIL.000#IDX98">block size of output</A>
  2510. <LI><A HREF="FILEUTIL.000#IDX162">block special files</A>
  2511. <LI><A HREF="FILEUTIL.000#IDX159">block special files, creating</A>
  2512. <LI><A HREF="FILEUTIL.000#IDX164">buffered character file</A>
  2513. <LI><A HREF="FILEUTIL.000#IDX3">bugs, reporting</A>
  2514. <LI><A HREF="FILEUTIL.000#IDX103">byte-swapping</A>
  2515. </DIR>
  2516. <H2>c</H2>
  2517. <DIR>
  2518. <LI><A HREF="FILEUTIL.000#IDX222">CD-ROM filesystem type</A>
  2519. <LI><A HREF="FILEUTIL.000#IDX184">changed files, verbosely describing</A>
  2520. <LI><A HREF="FILEUTIL.000#IDX178">changed owners, verbosely describing</A>
  2521. <LI><A HREF="FILEUTIL.000#IDX188">changing access permissions</A>
  2522. <LI><A HREF="FILEUTIL.000#IDX170">changing file attributes</A>
  2523. <LI><A HREF="FILEUTIL.000#IDX176">changing file ownership</A>
  2524. <LI><A HREF="FILEUTIL.000#IDX195">changing file timestamps</A>
  2525. <LI><A HREF="FILEUTIL.000#IDX183">changing group ownership</A>
  2526. <LI><A HREF="FILEUTIL.000#IDX41">changing special permissions</A>
  2527. <LI><A HREF="FILEUTIL.000#IDX163">character special files</A>
  2528. <LI><A HREF="FILEUTIL.000#IDX160">character special files, creating</A>
  2529. <LI><A HREF="FILEUTIL.000#IDX181">chgrp</A>
  2530. <LI><A HREF="FILEUTIL.000#IDX187">chmod</A>
  2531. <LI><A HREF="FILEUTIL.000#IDX173">chown</A>
  2532. <LI><A HREF="FILEUTIL.000#IDX68">COLUMNS</A>
  2533. <LI><A HREF="FILEUTIL.000#IDX5">common options</A>
  2534. <LI><A HREF="FILEUTIL.000#IDX42">conditional executability</A>
  2535. <LI><A HREF="FILEUTIL.000#IDX102">converstion block size</A>
  2536. <LI><A HREF="FILEUTIL.000#IDX94">converting while copying a file</A>
  2537. <LI><A HREF="FILEUTIL.000#IDX87">copying directories recursively</A>
  2538. <LI><A HREF="FILEUTIL.000#IDX39">copying existing permissions</A>
  2539. <LI><A HREF="FILEUTIL.000#IDX76">copying files and directories</A>
  2540. <LI><A HREF="FILEUTIL.000#IDX107">copying files and setting attributes</A>
  2541. <LI><A HREF="FILEUTIL.000#IDX75">cp</A>
  2542. <LI><A HREF="FILEUTIL.000#IDX239">crashes and corruption</A>
  2543. <LI><A HREF="FILEUTIL.000#IDX150">creating directories</A>
  2544. <LI><A HREF="FILEUTIL.000#IDX156">creating FIFOs (named pipes)</A>
  2545. <LI><A HREF="FILEUTIL.000#IDX142">creating links (hard or soft)</A>
  2546. </DIR>
  2547. <H2>d</H2>
  2548. <DIR>
  2549. <LI><A HREF="FILEUTIL.000#IDX93">dd</A>
  2550. <LI><A HREF="FILEUTIL.000#IDX144">dereferencing symbolic links</A>
  2551. <LI><A HREF="FILEUTIL.000#IDX206">device file, disk</A>
  2552. <LI><A HREF="FILEUTIL.000#IDX201">df</A>
  2553. <LI><A HREF="FILEUTIL.000#IDX70">dir</A>
  2554. <LI><A HREF="FILEUTIL.000#IDX78">directories, copying</A>
  2555. <LI><A HREF="FILEUTIL.000#IDX86">directories, copying recursively</A>
  2556. <LI><A HREF="FILEUTIL.000#IDX149">directories, creating</A>
  2557. <LI><A HREF="FILEUTIL.000#IDX109">directories, creating with given attributes</A>
  2558. <LI><A HREF="FILEUTIL.000#IDX131">directories, removing (recursively)</A>
  2559. <LI><A HREF="FILEUTIL.000#IDX168">directories, removing empty</A>
  2560. <LI><A HREF="FILEUTIL.000#IDX128">directories, removing with <CODE>unlink</CODE></A>
  2561. <LI><A HREF="FILEUTIL.000#IDX51">directory listing</A>
  2562. <LI><A HREF="FILEUTIL.000#IDX71">directory listing, brief</A>
  2563. <LI><A HREF="FILEUTIL.000#IDX55">directory listing, recursive</A>
  2564. <LI><A HREF="FILEUTIL.000#IDX73">directory listing, verbose</A>
  2565. <LI><A HREF="FILEUTIL.000#IDX56">dired Emacs mode support</A>
  2566. <LI><A HREF="FILEUTIL.000#IDX205">disk device file</A>
  2567. <LI><A HREF="FILEUTIL.000#IDX200">disk usage</A>
  2568. <LI><A HREF="FILEUTIL.000#IDX203">disk usage by filesystem</A>
  2569. <LI><A HREF="FILEUTIL.000#IDX230">disk usage for files</A>
  2570. <LI><A HREF="FILEUTIL.000#IDX227">diskette filesystem</A>
  2571. <LI><A HREF="FILEUTIL.000#IDX225">DOS filesystem</A>
  2572. <LI><A HREF="FILEUTIL.000#IDX228">du</A>
  2573. </DIR>
  2574. <H2>e</H2>
  2575. <DIR>
  2576. <LI><A HREF="FILEUTIL.000#IDX198">empty files, creating</A>
  2577. <LI><A HREF="FILEUTIL.000#IDX192">error messages, omitting</A>
  2578. <LI><A HREF="FILEUTIL.000#IDX64">executables and file type, marking</A>
  2579. <LI><A HREF="FILEUTIL.000#IDX19">execute permission</A>
  2580. <LI><A HREF="FILEUTIL.000#IDX38">execute permission, symbolic</A>
  2581. </DIR>
  2582. <H2>f</H2>
  2583. <DIR>
  2584. <LI><A HREF="FILEUTIL.000#IDX154">FIFOs, creating</A>
  2585. <LI><A HREF="FILEUTIL.000#IDX171">file attributes, changing</A>
  2586. <LI><A HREF="FILEUTIL.000#IDX84">file information, preserving</A>
  2587. <LI><A HREF="FILEUTIL.000#IDX174">file ownership, changing</A>
  2588. <LI><A HREF="FILEUTIL.000#IDX15">file permissions</A>
  2589. <LI><A HREF="FILEUTIL.000#IDX48">file permissions, numeric</A>
  2590. <LI><A HREF="FILEUTIL.000#IDX229">file space usage</A>
  2591. <LI><A HREF="FILEUTIL.000#IDX196">file timestamps, changing</A>
  2592. <LI><A HREF="FILEUTIL.000#IDX63">file type and executables, marking</A>
  2593. <LI><A HREF="FILEUTIL.000#IDX67">file type, marking</A>
  2594. <LI><A HREF="FILEUTIL.000#IDX137">file types</A>
  2595. <LI><A HREF="FILEUTIL.000#IDX135">file types, special</A>
  2596. <LI><A HREF="FILEUTIL.000#IDX132">files beginning with <SAMP>`-'</SAMP>, removing</A>
  2597. <LI><A HREF="FILEUTIL.000#IDX77">files, copying</A>
  2598. <LI><A HREF="FILEUTIL.000#IDX202">filesystem disk usage</A>
  2599. <LI><A HREF="FILEUTIL.000#IDX216">filesystem space, retrieving current data more slowly</A>
  2600. <LI><A HREF="FILEUTIL.000#IDX211">filesystem space, retrieving old data more quickly</A>
  2601. <LI><A HREF="FILEUTIL.000#IDX217">filesystem types, limiting output to certain</A>
  2602. <LI><A HREF="FILEUTIL.000#IDX218">filesystem types, printing</A>
  2603. <LI><A HREF="FILEUTIL.000#IDX143">filesystems and hard links</A>
  2604. <LI><A HREF="FILEUTIL.000#IDX92">filesystems, omitting copying to different</A>
  2605. <LI><A HREF="FILEUTIL.000#IDX130">fsck</A>
  2606. </DIR>
  2607. <H2>g</H2>
  2608. <DIR>
  2609. <LI><A HREF="FILEUTIL.000#IDX46">giving away permissions</A>
  2610. <LI><A HREF="FILEUTIL.000#IDX231">grand total of disk space</A>
  2611. <LI><A HREF="FILEUTIL.000#IDX21">group owner, default</A>
  2612. <LI><A HREF="FILEUTIL.000#IDX112">group ownership of installed files, setting</A>
  2613. <LI><A HREF="FILEUTIL.000#IDX182">group ownership, changing</A>
  2614. <LI><A HREF="FILEUTIL.000#IDX175">group ownerships, changing</A>
  2615. <LI><A HREF="FILEUTIL.000#IDX30">group, permissions for</A>
  2616. </DIR>
  2617. <H2>h</H2>
  2618. <DIR>
  2619. <LI><A HREF="FILEUTIL.000#IDX146">hard links to directories</A>
  2620. <LI><A HREF="FILEUTIL.000#IDX140">hard links, creating</A>
  2621. <LI><A HREF="FILEUTIL.000#IDX83">hard links, preserving</A>
  2622. <LI><A HREF="FILEUTIL.000#IDX6">help, online</A>
  2623. <LI><A HREF="FILEUTIL.000#IDX223">High Sierra filesystem</A>
  2624. <LI><A HREF="FILEUTIL.000#IDX4">history</A>
  2625. <LI><A HREF="FILEUTIL.000#IDX79">holes, copying</A>
  2626. </DIR>
  2627. <H2>i</H2>
  2628. <DIR>
  2629. <LI><A HREF="FILEUTIL.000#IDX208">ignore filesystems</A>
  2630. <LI><A HREF="FILEUTIL.000#IDX57">inode number, printing</A>
  2631. <LI><A HREF="FILEUTIL.000#IDX209">inode usage</A>
  2632. <LI><A HREF="FILEUTIL.000#IDX238">inodes, written buffered</A>
  2633. <LI><A HREF="FILEUTIL.000#IDX97">input block size</A>
  2634. <LI><A HREF="FILEUTIL.000#IDX106">install</A>
  2635. <LI><A HREF="FILEUTIL.000#IDX1">introduction</A>
  2636. </DIR>
  2637. <H2>l</H2>
  2638. <DIR>
  2639. <LI><A HREF="FILEUTIL.000#IDX111">leading directories, creating missing</A>
  2640. <LI><A HREF="FILEUTIL.000#IDX139">links, creating</A>
  2641. <LI><A HREF="FILEUTIL.000#IDX220">Linux filesystem types</A>
  2642. <LI><A HREF="FILEUTIL.000#IDX138">ln</A>
  2643. <LI><A HREF="FILEUTIL.000#IDX221">local filesystem types</A>
  2644. <LI><A HREF="FILEUTIL.000#IDX50">ls</A>
  2645. </DIR>
  2646. <H2>m</H2>
  2647. <DIR>
  2648. <LI><A HREF="FILEUTIL.000#IDX108">Makefiles, installing programs in</A>
  2649. <LI><A HREF="FILEUTIL.000#IDX74">manipulating files</A>
  2650. <LI><A HREF="FILEUTIL.000#IDX148">mkdir</A>
  2651. <LI><A HREF="FILEUTIL.000#IDX153">mkfifo</A>
  2652. <LI><A HREF="FILEUTIL.000#IDX158">mknod</A>
  2653. <LI><A HREF="FILEUTIL.000#IDX45">modes and umask</A>
  2654. <LI><A HREF="FILEUTIL.000#IDX151">modes of created directories, setting</A>
  2655. <LI><A HREF="FILEUTIL.000#IDX157">modes of created FIFOs, setting</A>
  2656. <LI><A HREF="FILEUTIL.000#IDX226">MS-DOS filesystem</A>
  2657. <LI><A HREF="FILEUTIL.000#IDX43">multiple changes to permissions</A>
  2658. <LI><A HREF="FILEUTIL.000#IDX95">multipliers after numbers</A>
  2659. <LI><A HREF="FILEUTIL.000#IDX119">mv</A>
  2660. </DIR>
  2661. <H2>n</H2>
  2662. <DIR>
  2663. <LI><A HREF="FILEUTIL.000#IDX155">named pipes, creating</A>
  2664. <LI><A HREF="FILEUTIL.000#IDX91">newer files, copying only</A>
  2665. <LI><A HREF="FILEUTIL.000#IDX124">newer files, moving only</A>
  2666. <LI><A HREF="FILEUTIL.000#IDX219">NFS filesystem type</A>
  2667. <LI><A HREF="FILEUTIL.000#IDX234">NFS mounts from BSD to HP-UX</A>
  2668. <LI><A HREF="FILEUTIL.000#IDX89">non-directories, copying as special files</A>
  2669. <LI><A HREF="FILEUTIL.000#IDX47">numeric modes</A>
  2670. <LI><A HREF="FILEUTIL.000#IDX66">numeric uid and gid</A>
  2671. </DIR>
  2672. <H2>o</H2>
  2673. <DIR>
  2674. <LI><A HREF="FILEUTIL.000#IDX49">octal numbers for file modes</A>
  2675. <LI><A HREF="FILEUTIL.000#IDX233">one filesystem, restricting <CODE>du</CODE> to</A>
  2676. <LI><A HREF="FILEUTIL.000#IDX212">one-line output format</A>
  2677. <LI><A HREF="FILEUTIL.000#IDX31">other permissions</A>
  2678. <LI><A HREF="FILEUTIL.000#IDX99">output block size</A>
  2679. <LI><A HREF="FILEUTIL.000#IDX215">output format, portable</A>
  2680. <LI><A HREF="FILEUTIL.000#IDX29">owner of file, permissions for</A>
  2681. <LI><A HREF="FILEUTIL.000#IDX20">owner, default</A>
  2682. <LI><A HREF="FILEUTIL.000#IDX114">ownership of installed files, setting</A>
  2683. </DIR>
  2684. <H2>p</H2>
  2685. <DIR>
  2686. <LI><A HREF="FILEUTIL.000#IDX85">parent directories and <CODE>cp</CODE></A>
  2687. <LI><A HREF="FILEUTIL.000#IDX152">parent directories, creating</A>
  2688. <LI><A HREF="FILEUTIL.000#IDX110">parent directories, creating missing</A>
  2689. <LI><A HREF="FILEUTIL.000#IDX169">parent directories, removing</A>
  2690. <LI><A HREF="FILEUTIL.000#IDX224">PC filesystem</A>
  2691. <LI><A HREF="FILEUTIL.000#IDX16">permissions of files</A>
  2692. <LI><A HREF="FILEUTIL.000#IDX113">permissions of installed files, setting</A>
  2693. <LI><A HREF="FILEUTIL.000#IDX190">permissions, changing access</A>
  2694. <LI><A HREF="FILEUTIL.000#IDX40">permissions, copying existing</A>
  2695. <LI><A HREF="FILEUTIL.000#IDX199">permissions, for changing file timestamps</A>
  2696. <LI><A HREF="FILEUTIL.000#IDX214">portable output format</A>
  2697. <LI><A HREF="FILEUTIL.000#IDX213">POSIX output format</A>
  2698. <LI><A HREF="FILEUTIL.000#IDX2">POSIX.2</A>
  2699. <LI><A HREF="FILEUTIL.000#IDX204">POSIXLY_CORRECT</A>
  2700. <LI><A HREF="FILEUTIL.000#IDX210">POSIXLY_CORRECT, overridden by <CODE>df -k</CODE></A>
  2701. <LI><A HREF="FILEUTIL.000#IDX232">POSIXLY_CORRECT, overridden by <CODE>du -k</CODE></A>
  2702. <LI><A HREF="FILEUTIL.000#IDX65">POSIXLY_CORRECT, overridden by <CODE>ls -k</CODE></A>
  2703. <LI><A HREF="FILEUTIL.000#IDX59">POSIXLY_CORRECT, overrides <CODE>ls -s</CODE></A>
  2704. <LI><A HREF="FILEUTIL.000#IDX147">prompting, and <CODE>ln</CODE></A>
  2705. <LI><A HREF="FILEUTIL.000#IDX120">prompting, and <CODE>mv</CODE></A>
  2706. <LI><A HREF="FILEUTIL.000#IDX127">prompting, and <CODE>rm</CODE></A>
  2707. <LI><A HREF="FILEUTIL.000#IDX123">prompts, forcing</A>
  2708. <LI><A HREF="FILEUTIL.000#IDX122">prompts, omitting</A>
  2709. </DIR>
  2710. <H2>r</H2>
  2711. <DIR>
  2712. <LI><A HREF="FILEUTIL.000#IDX104">read errors, ignoring</A>
  2713. <LI><A HREF="FILEUTIL.000#IDX17">read permission</A>
  2714. <LI><A HREF="FILEUTIL.000#IDX36">read permission, symbolic</A>
  2715. <LI><A HREF="FILEUTIL.000#IDX80">read system call, and holes</A>
  2716. <LI><A HREF="FILEUTIL.000#IDX54">recursive directory listing</A>
  2717. <LI><A HREF="FILEUTIL.000#IDX193">recursively changing access permissions</A>
  2718. <LI><A HREF="FILEUTIL.000#IDX180">recursively changing file ownership</A>
  2719. <LI><A HREF="FILEUTIL.000#IDX186">recursively changing group ownership</A>
  2720. <LI><A HREF="FILEUTIL.000#IDX88">recursively copying directories</A>
  2721. <LI><A HREF="FILEUTIL.000#IDX167">removing empty directories</A>
  2722. <LI><A HREF="FILEUTIL.000#IDX126">removing files or directories</A>
  2723. <LI><A HREF="FILEUTIL.000#IDX33">removing permissions</A>
  2724. <LI><A HREF="FILEUTIL.000#IDX62">reverse sorting</A>
  2725. <LI><A HREF="FILEUTIL.000#IDX125">rm</A>
  2726. <LI><A HREF="FILEUTIL.000#IDX166">rmdir</A>
  2727. <LI><A HREF="FILEUTIL.000#IDX116">root as default owner</A>
  2728. </DIR>
  2729. <H2>s</H2>
  2730. <DIR>
  2731. <LI><A HREF="FILEUTIL.000#IDX23">setgid</A>
  2732. <LI><A HREF="FILEUTIL.000#IDX35">setting permissions</A>
  2733. <LI><A HREF="FILEUTIL.000#IDX22">setuid</A>
  2734. <LI><A HREF="FILEUTIL.000#IDX11">SIMPLE_BACKUP_SUFFIX</A>
  2735. <LI><A HREF="FILEUTIL.000#IDX58">size of files, reporting</A>
  2736. <LI><A HREF="FILEUTIL.000#IDX61">sorting <CODE>ls</CODE> output</A>
  2737. <LI><A HREF="FILEUTIL.000#IDX136">special file types</A>
  2738. <LI><A HREF="FILEUTIL.000#IDX161">special files</A>
  2739. <LI><A HREF="FILEUTIL.000#IDX24">sticky</A>
  2740. <LI><A HREF="FILEUTIL.000#IDX118">stripping symbol table information</A>
  2741. <LI><A HREF="FILEUTIL.000#IDX34">subtracting permissions</A>
  2742. <LI><A HREF="FILEUTIL.000#IDX237">superblock, writing</A>
  2743. <LI><A HREF="FILEUTIL.000#IDX25">swap space, saving text image in</A>
  2744. <LI><A HREF="FILEUTIL.000#IDX117">symbol table information, stripping</A>
  2745. <LI><A HREF="FILEUTIL.000#IDX141">symbolic (soft) links, creating</A>
  2746. <LI><A HREF="FILEUTIL.000#IDX82">symbolic links, copying</A>
  2747. <LI><A HREF="FILEUTIL.000#IDX90">symbolic links, copying with</A>
  2748. <LI><A HREF="FILEUTIL.000#IDX53">symbolic links, dereferencing</A>
  2749. <LI><A HREF="FILEUTIL.000#IDX191">symbolic links, permissions of</A>
  2750. <LI><A HREF="FILEUTIL.000#IDX28">symbolic modes</A>
  2751. <LI><A HREF="FILEUTIL.000#IDX235">sync</A>
  2752. <LI><A HREF="FILEUTIL.000#IDX236">synchronize disk and memory</A>
  2753. </DIR>
  2754. <H2>t</H2>
  2755. <DIR>
  2756. <LI><A HREF="FILEUTIL.000#IDX26">text image, saving in swap space</A>
  2757. <LI><A HREF="FILEUTIL.000#IDX197">timestamps, changing file</A>
  2758. <LI><A HREF="FILEUTIL.000#IDX194">touch</A>
  2759. <LI><A HREF="FILEUTIL.000#IDX105">truncating output file, avoiding</A>
  2760. </DIR>
  2761. <H2>u</H2>
  2762. <DIR>
  2763. <LI><A HREF="FILEUTIL.000#IDX44">umask and modes</A>
  2764. <LI><A HREF="FILEUTIL.000#IDX165">unbuffered character special file</A>
  2765. <LI><A HREF="FILEUTIL.000#IDX129">unlink</A>
  2766. </DIR>
  2767. <H2>v</H2>
  2768. <DIR>
  2769. <LI><A HREF="FILEUTIL.000#IDX72">vdir</A>
  2770. <LI><A HREF="FILEUTIL.000#IDX7">version number, finding</A>
  2771. <LI><A HREF="FILEUTIL.000#IDX14">version-control Emacs variable</A>
  2772. <LI><A HREF="FILEUTIL.000#IDX12">VERSION_CONTROL</A>
  2773. </DIR>
  2774. <H2>w</H2>
  2775. <DIR>
  2776. <LI><A HREF="FILEUTIL.000#IDX18">write permission</A>
  2777. <LI><A HREF="FILEUTIL.000#IDX37">write permission, symbolic</A>
  2778. </DIR>
  2779. <P>
  2780. </BODY>
  2781. </HTML>
  2782.