source: rtems-docs/shell/file_and_directory.rst @ 5ce8e43

5
Last change on this file since 5ce8e43 was f15d607, checked in by Chris Johns <chrisj@…>, on 11/09/16 at 00:50:31

shell: Fix header levels.

  • Property mode set to 100644
File size: 79.4 KB
Line 
1.. comment SPDX-License-Identifier: CC-BY-SA-4.0
2
3.. COMMENT: COPYRIGHT (c) 1988-2008.
4.. COMMENT: On-Line Applications Research Corporation (OAR).
5.. COMMENT: All rights reserved.
6
7File and Directory Commands
8***************************
9
10Introduction
11============
12
13The RTEMS shell has the following file and directory commands:
14
15- blksync_ - sync the block driver
16
17- cat_ - display file contents
18
19- cd_ - alias for chdir
20
21- chdir_ - change the current directory
22
23- chmod_ - change permissions of a file
24
25- chroot_ - change the root directory
26
27- cp_ - copy files
28
29- dd_ - convert and copy a file
30
31- debugrfs_ - debug RFS file system
32
33- df_ - display file system disk space usage
34
35- dir_ - alias for ls_
36
37- fdisk_ - format disks
38
39- hexdump_ - format disks
40
41- ln_ - make links
42
43- ls_ - list files in the directory
44
45- md5_ - display file system disk space usage
46
47- mkdir_ - create a directory
48
49- mkdos_ - DOSFS disk format
50
51- mknod_ - make device special file
52
53- mkrfs_ - format RFS file system
54
55- mount_ - mount disk
56
57- mv_ - move files
58
59- pwd_ - print work directory
60
61- rmdir_ - remove empty directories
62
63- rm_ - remove files
64
65- umask_ - Set file mode creation mask
66
67- unmount_ - unmount disk
68
69Commands
70========
71
72This section details the File and Directory Commands available.  A subsection
73is dedicated to each of the commands and describes the behavior and
74configuration of that command as well as providing an example usage.
75
76.. raw:: latex
77
78   \clearpage
79
80.. _blksync:
81
82blksync - sync the block driver
83-------------------------------
84.. index:: blksync
85
86SYNOPSYS:
87    .. code-block:: shell
88
89        blksync driver
90
91DESCRIPTION:
92    This command issues a block driver sync call to the driver. The driver is a
93    path to a device node. The sync call will flush all pending writes in the
94    cache to the media and block until the writes have completed.
95
96EXIT STATUS:
97    This command returns 0 on success and non-zero if an error is encountered.
98
99NOTES:
100    None.
101
102EXAMPLES:
103    The following is an example of how to use ``blksync``:
104
105    .. code-block:: c
106
107        blksync /dev/hda1
108
109.. index:: CONFIGURE_SHELL_NO_COMMAND_BLKSYNC
110.. index:: CONFIGURE_SHELL_COMMAND_BLKSYNC
111
112CONFIGURATION:
113    This command is included in the default shell command set.  When building a
114    custom command set, define ``CONFIGURE_SHELL_COMMAND_BLKSYNC`` to have this
115    command included.
116
117    This command can be excluded from the shell command set by defining
118    ``CONFIGURE_SHELL_NO_COMMAND_BLKSYNC`` when all shell commands have been
119    configured.
120
121.. index:: rtems_shell_rtems_main_blksync
122
123PROGRAMMING INFORMATION:
124    The ``blksync`` is implemented by a C language function which has the
125    following prototype:
126
127    .. code-block:: c
128
129        int rtems_shell_rtems_main_blksync(
130            int    argc,
131            char **argv
132        );
133
134    The configuration structure for the ``blksync`` has the following prototype:
135
136    .. code-block:: c
137
138        extern rtems_shell_cmd_t rtems_shell_BLKSYNC_Command;
139
140.. raw:: latex
141
142   \clearpage
143
144.. _cat:
145
146cat - display file contents
147---------------------------
148.. index:: cat
149
150SYNOPSYS:
151    .. code-block:: shell
152
153        cat file1 [file2 .. fileN]
154
155DESCRIPTION:
156    This command displays the contents of the specified files.
157
158EXIT STATUS:
159    This command returns 0 on success and non-zero if an error is encountered.
160
161NOTES:
162    It is possible to read the input from a device file using ``cat``.
163
164EXAMPLES:
165    The following is an example of how to use ``cat``:
166
167    .. code-block:: shell
168
169        SHLL [/] # cat /etc/passwd
170        root:*:0:0:root::/:/bin/sh
171        rtems:*:1:1:RTEMS Application::/:/bin/sh
172        tty:!:2:2:tty owner::/:/bin/false
173
174.. index:: CONFIGURE_SHELL_NO_COMMAND_CAT
175.. index:: CONFIGURE_SHELL_COMMAND_CAT
176
177CONFIGURATION:
178    This command is included in the default shell command set.  When building a
179    custom command set, define ``CONFIGURE_SHELL_COMMAND_CAT`` to have this
180    command included.
181
182    This command can be excluded from the shell command set by defining
183    ``CONFIGURE_SHELL_NO_COMMAND_CAT`` when all shell commands have been
184    configured.
185
186.. index:: rtems_shell_rtems_main_cat
187
188PROGRAMMING INFORMATION:
189    The ``cat`` is implemented by a C language function which has the following
190    prototype:
191
192    .. code-block:: c
193
194        int rtems_shell_rtems_main_cat(
195            int    argc,
196            char **argv
197        );
198
199    The configuration structure for the ``cat`` has the following prototype:
200
201    .. code-block:: c
202
203        extern rtems_shell_cmd_t rtems_shell_CAT_Command;
204
205.. raw:: latex
206
207   \clearpage
208
209.. _cd:
210
211cd - alias for chdir
212--------------------
213.. index:: cd
214
215SYNOPSYS:
216    .. code-block:: shell
217
218        cd directory
219
220DESCRIPTION:
221    This command is an alias or alternate name for the ``chdir``.  See `ls -
222    list files in the directory` for more information.
223
224EXIT STATUS:
225    This command returns 0 on success and non-zero if an error is encountered.
226
227NOTES:
228    None.
229
230EXAMPLES:
231    The following is an example of how to use ``cd``:
232
233    .. code-block:: shell
234
235        SHLL [/] $ cd etc
236        SHLL [/etc] $ cd /
237        SHLL [/] $ cd /etc
238        SHLL [/etc] $ pwd
239        /etc
240        SHLL [/etc] $ cd /
241        SHLL [/] $ pwd
242        /
243        SHLL [/] $ cd etc
244        SHLL [/etc] $ cd ..
245        SHLL [/] $ pwd
246        /
247
248.. index:: CONFIGURE_SHELL_NO_COMMAND_CD
249.. index:: CONFIGURE_SHELL_COMMAND_CD
250
251CONFIGURATION:
252    This command is included in the default shell command set.  When building a
253    custom command set, define ``CONFIGURE_SHELL_COMMAND_CD`` to have this
254    command included.
255
256    This command can be excluded from the shell command set by defining
257    ``CONFIGURE_SHELL_NO_COMMAND_CD`` when all shell commands have been
258    configured.
259
260.. index:: rtems_shell_rtems_main_cd
261
262PROGRAMMING INFORMATION:
263    The ``cd`` is implemented by a C language function which has the following
264    prototype:
265
266    .. code-block:: c
267
268        int rtems_shell_rtems_main_cd(
269            int    argc,
270            char **argv
271        );
272
273    The configuration structure for the ``cd`` has the following prototype:
274
275    .. code-block:: c
276
277        extern rtems_shell_cmd_t rtems_shell_CD_Command;
278
279.. raw:: latex
280
281   \clearpage
282
283.. _chdir:
284
285chdir - change the current directory
286------------------------------------
287.. index:: chdir
288
289SYNOPSYS:
290    .. code-block:: shell
291
292        chdir [dir]
293
294DESCRIPTION:
295    This command is used to change the current working directory to the
296    specified directory.  If no arguments are given, the current working
297    directory will be changed to ``/``.
298
299EXIT STATUS:
300    This command returns 0 on success and non-zero if an error is encountered.
301
302NOTES:
303    None.
304
305EXAMPLES:
306    The following is an example of how to use ``chdir``:
307
308    .. code-block:: shell
309
310        SHLL [/] $ pwd
311        /
312        SHLL [/] $ chdir etc
313        SHLL [/etc] $ pwd
314        /etc
315
316.. index:: CONFIGURE_SHELL_NO_COMMAND_CHDIR
317.. index:: CONFIGURE_SHELL_COMMAND_CHDIR
318
319CONFIGURATION:
320    This command is included in the default shell command set.  When building a
321    custom command set, define ``CONFIGURE_SHELL_COMMAND_CHDIR`` to have this
322    command included.
323
324    This command can be excluded from the shell command set by defining
325    ``CONFIGURE_SHELL_NO_COMMAND_CHDIR`` when all shell commands have been
326    configured.
327
328.. index:: rtems_shell_rtems_main_chdir
329
330PROGRAMMING INFORMATION:
331    The ``chdir`` is implemented by a C language function which has the
332    following prototype:
333
334    .. code-block:: c
335
336        int rtems_shell_rtems_main_chdir(
337            int    argc,
338            char **argv
339        );
340
341    The configuration structure for the ``chdir`` has the following prototype:
342
343    .. code-block:: c
344
345        extern rtems_shell_cmd_t rtems_shell_CHDIR_Command;
346
347.. raw:: latex
348
349   \clearpage
350
351.. _chmod:
352
353chmod - change permissions of a file
354------------------------------------
355.. index:: chmod
356
357SYNOPSYS:
358    .. code-block:: shell
359
360        chmod permissions file1 [file2...]
361
362DESCRIPTION:
363    This command changes the permissions on the files specified to the
364    indicated ``permissions``.  The permission values are POSIX based with
365    owner, group, and world having individual read, write, and executive
366    permission bits.
367
368EXIT STATUS:
369    This command returns 0 on success and non-zero if an error is encountered.
370
371NOTES:
372    The ``chmod`` command only takes numeric representations of the
373    permissions.
374
375EXAMPLES:
376    The following is an example of how to use ``chmod``:
377
378    .. code-block:: shell
379
380        SHLL [/] # cd etc
381        SHLL [/etc] # ls
382        -rw-r--r--   1   root   root         102 Jan 01 00:00 passwd
383        -rw-r--r--   1   root   root          42 Jan 01 00:00 group
384        -rw-r--r--   1   root   root          30 Jan 01 00:00 issue
385        -rw-r--r--   1   root   root          28 Jan 01 00:00 issue.net
386        4 files 202 bytes occupied
387        SHLL [/etc] # chmod 0777 passwd
388        SHLL [/etc] # ls
389        -rwxrwxrwx   1   root   root         102 Jan 01 00:00 passwd
390        -rw-r--r--   1   root   root          42 Jan 01 00:00 group
391        -rw-r--r--   1   root   root          30 Jan 01 00:00 issue
392        -rw-r--r--   1   root   root          28 Jan 01 00:00 issue.net
393        4 files 202 bytes occupied
394        SHLL [/etc] # chmod 0322 passwd
395        SHLL [/etc] # ls
396        --wx-w--w-   1 nouser   root         102 Jan 01 00:00 passwd
397        -rw-r--r--   1 nouser   root          42 Jan 01 00:00 group
398        -rw-r--r--   1 nouser   root          30 Jan 01 00:00 issue
399        -rw-r--r--   1 nouser   root          28 Jan 01 00:00 issue.net
400        4 files 202 bytes occupied
401        SHLL [/etc] # chmod 0644 passwd
402        SHLL [/etc] # ls
403        -rw-r--r--   1   root   root         102 Jan 01 00:00 passwd
404        -rw-r--r--   1   root   root          42 Jan 01 00:00 group
405        -rw-r--r--   1   root   root          30 Jan 01 00:00 issue
406        -rw-r--r--   1   root   root          28 Jan 01 00:00 issue.net
407        4 files 202 bytes occupied
408
409.. index:: CONFIGURE_SHELL_NO_COMMAND_CHMOD
410.. index:: CONFIGURE_SHELL_COMMAND_CHMOD
411
412CONFIGURATION:
413    This command is included in the default shell command set.  When building a
414    custom command set, define ``CONFIGURE_SHELL_COMMAND_CHMOD`` to have this
415    command included.
416
417    This command can be excluded from the shell command set by defining
418    ``CONFIGURE_SHELL_NO_COMMAND_CHMOD`` when all shell commands have been
419    configured.
420
421.. index:: rtems_shell_rtems_main_chmod
422
423PROGRAMMING INFORMATION:
424    The ``chmod`` is implemented by a C language function which has the
425    following prototype:
426
427    .. code-block:: c
428
429        int rtems_shell_rtems_main_chmod(
430            int    argc,
431            char **argv
432        );
433
434    The configuration structure for the ``chmod`` has the following prototype:
435
436    .. code-block:: c
437
438        extern rtems_shell_cmd_t rtems_shell_CHMOD_Command;
439
440.. raw:: latex
441
442   \clearpage
443
444.. _chroot:
445
446chroot - change the root directory
447----------------------------------
448.. index:: chroot
449
450SYNOPSYS:
451    .. code-block:: shell
452
453        chroot [dir]
454
455DESCRIPTION:
456    This command changes the root directory to ``dir`` for subsequent commands.
457
458EXIT STATUS:
459    This command returns 0 on success and non-zero if an error is encountered.
460
461    The destination directory ``dir`` must exist.
462
463NOTES:
464    None.
465
466EXAMPLES:
467    The following is an example of how to use ``chroot`` and the impact it has
468    on the environment for subsequent command invocations:
469
470    .. code-block:: shell
471
472        SHLL [/] $ cat passwd
473        cat: passwd: No such file or directory
474        SHLL [/] $ chroot etc
475        SHLL [/] $ cat passwd
476        root:*:0:0:root::/:/bin/sh
477        rtems:*:1:1:RTEMS Application::/:/bin/sh
478        tty:!:2:2:tty owner::/:/bin/false
479        SHLL [/] $ cat /etc/passwd
480        cat: /etc/passwd: No such file or directory
481
482.. index:: CONFIGURE_SHELL_NO_COMMAND_CHROOT
483.. index:: CONFIGURE_SHELL_COMMAND_CHROOT
484
485CONFIGURATION:
486    This command is included in the default shell command set.  When building a
487    custom command set, define ``CONFIGURE_SHELL_COMMAND_CHROOT`` to have this
488    command included. Additional to that you have to add one POSIX key value
489    pair for each thread where you want to use the command.
490
491    This command can be excluded from the shell command set by defining
492    ``CONFIGURE_SHELL_NO_COMMAND_CHROOT`` when all shell commands have been
493    configured.
494
495.. index:: rtems_shell_rtems_main_chroot
496
497PROGRAMMING INFORMATION:
498    The ``chroot`` is implemented by a C language function which has the
499    following prototype:
500
501    .. code-block:: c
502
503        int rtems_shell_rtems_main_chroot(
504            int    argc,
505            char **argv
506        );
507
508    The configuration structure for the ``chroot`` has the following prototype:
509
510    .. code-block:: c
511
512        extern rtems_shell_cmd_t rtems_shell_CHROOT_Command;
513
514.. raw:: latex
515
516   \clearpage
517
518.. _cp:
519
520cp - copy files
521---------------
522.. index:: cp
523
524SYNOPSYS:
525    .. code-block:: shell
526
527        cp [-R [-H | -L | -P]] [-f | -i] [-pv] src target
528        cp [-R [-H | -L] ] [-f | -i] [-NpPv] source_file ... target_directory
529
530DESCRIPTION:
531    In the first synopsis form, the cp utility copies the contents of the
532    source_file to the target_file. In the second synopsis form, the contents
533    of each named source_file is copied to the destination
534    target_directory. The names of the files themselves are not changed. If cp
535    detects an attempt to copy a file to itself, the copy will fail.
536
537    The following options are available:
538
539    *-f*
540        For each existing destination pathname, attempt to overwrite it. If
541        permissions do not allow copy to succeed, remove it and create a new
542        file, without prompting for confirmation. (The -i option is ignored if
543        the -f option is specified.)
544
545    *-H*
546        If the -R option is specified, symbolic links on the command line are
547        followed.  (Symbolic links encountered in the tree traversal are not
548        followed.)
549
550    *-i*
551        Causes cp to write a prompt to the standard error output before copying
552        a file that would overwrite an existing file. If the response from the
553        standard input begins with the character 'y', the file copy is
554        attempted.
555
556    *-L*
557        If the -R option is specified, all symbolic links are followed.
558
559    *-N*
560        When used with -p, do not copy file flags.
561
562    *-P*
563        No symbolic links are followed.
564
565    *-p*
566        Causes cp to preserve in the copy as many of the modification time,
567        access time, file flags, file mode, user ID, and group ID as allowed by
568        permissions.  If the user ID and group ID cannot be preserved, no error
569        message is displayed and the exit value is not altered.  If the source
570        file has its set user ID bit on and the user ID cannot be preserved,
571        the set user ID bit is not preserved in the copy's permissions. If the
572        source file has its set group ID bit on and the group ID cannot be
573        preserved, the set group ID bit is not preserved in the copy's
574        permissions. If the source file has both its set user ID and set group
575        ID bits on, and either the user ID or group ID cannot be preserved,
576        neither the set user ID or set group ID bits are preserved in the
577        copy's permissions.
578
579    *-R*
580        If source_file designates a directory, cp copies the directory and the
581        entire subtree connected at that point. This option also causes
582        symbolic links to be copied, rather than indirected through, and for cp
583        to create special files rather than copying them as normal
584        files. Created directories have the same mode as the corresponding
585        source directory, unmodified by the process's umask.
586
587    *-v*
588        Cause cp to be verbose, showing files as they are copied.
589
590    For each destination file that already exists, its contents are overwritten
591    if permissions allow, but its mode, user ID, and group ID are unchanged.
592
593    In the second synopsis form, target_directory must exist unless there is
594    only one named source_file which is a directory and the -R flag is
595    specified.
596
597    If the destination file does not exist, the mode of the source file is used
598    as modified by the file mode creation mask (umask, see csh(1)). If the
599    source file has its set user ID bit on, that bit is removed unless both the
600    source file and the destination file are owned by the same user. If the
601    source file has its set group ID bit on, that bit is removed unless both
602    the source file and the destination file are in the same group and the user
603    is a member of that group.  If both the set user ID and set group ID bits
604    are set, all of the above conditions must be fulfilled or both bits are
605    removed.
606
607    Appropriate permissions are required for file creation or overwriting.
608
609    Symbolic links are always followed unless the -R flag is set, in which case
610    symbolic links are not followed, by default. The -H or -L flags (in
611    conjunction with the -R flag), as well as the -P flag cause symbolic links
612    to be followed as described above. The -H and -L options are ignored unless
613    the -R option is specified. In addition, these options override
614    eachsubhedading other and the command's actions are determined by the last
615    one specified.
616
617EXIT STATUS:
618    This command returns 0 on success and non-zero if an error is encountered.
619
620NOTES:
621    NONE
622
623EXAMPLES:
624    The following is an example of how to use ``cp`` to copy a file to a new
625    name in the current directory:
626
627    .. code-block:: shell
628
629        SHLL [/] # cat joel
630        cat: joel: No such file or directory
631        SHLL [/] # cp etc/passwd joel
632        SHLL [/] # cat joel
633        root:*:0:0:root::/:/bin/sh
634        rtems:*:1:1:RTEMS Application::/:/bin/sh
635        tty:!:2:2:tty owner::/:/bin/false
636        SHLL [/] # ls
637        drwxr-xr-x   1   root   root         536 Jan 01 00:00 dev/
638        drwxr-xr-x   1   root   root        1072 Jan 01 00:00 etc/
639        -rw-r--r--   1   root   root         102 Jan 01 00:00 joel
640        3 files 1710 bytes occupied
641
642    The following is an example of how to use ``cp`` to copy one or more files
643    to a destination directory and use the same ``basename`` in the destination
644    directory:
645
646    .. code-block:: shell
647
648        SHLL [/] # mkdir tmp
649        SHLL [/] # ls tmp
650        0 files 0 bytes occupied
651        SHLL [/] # cp /etc/passwd tmp
652        SHLL [/] # ls /tmp
653        -rw-r--r--   1   root   root         102 Jan 01 00:01 passwd
654        1 files 102 bytes occupied
655        SHLL [/] # cp /etc/passwd /etc/group /tmp
656        SHLL [/] # ls /tmp
657        -rw-r--r--   1   root   root         102 Jan 01 00:01 passwd
658        -rw-r--r--   1   root   root          42 Jan 01 00:01 group
659        2 files 144 bytes occupied
660        SHLL [/] #
661
662.. index:: CONFIGURE_SHELL_NO_COMMAND_CP
663.. index:: CONFIGURE_SHELL_COMMAND_CP
664
665CONFIGURATION:
666    This command is included in the default shell command set.  When building a
667    custom command set, define``CONFIGURE_SHELL_COMMAND_CP`` to have this
668    command included.
669
670    This command can be excluded from the shell command set by defining
671    ``CONFIGURE_SHELL_NO_COMMAND_CP`` when all shell commands have been
672    configured.
673
674.. index:: rtems_shell_main_cp
675
676PROGRAMMING INFORMATION:
677    The ``cp`` command is implemented by a C language function which has the
678    following prototype:
679
680    .. code-block:: c
681
682        int rtems_shell_main_cp(
683            int    argc,
684            char **argv
685        );
686
687    The configuration structure for the ``cp`` has the following prototype:
688
689    .. code-block:: c
690
691        extern rtems_shell_cmd_t rtems_shell_CP_Command;
692
693ORIGIN:
694    The implementation and portions of the documentation for this command are
695    from NetBSD 4.0.
696
697.. raw:: latex
698
699   \clearpage
700
701.. _dd:
702
703dd - convert and copy a file
704----------------------------
705.. index:: dd
706
707SYNOPSYS:
708    .. code-block:: shell
709
710        dd [operands ...]
711
712DESCRIPTION:
713    The dd utility copies the standard input to the standard output.  Input
714    data is read and written in 512-byte blocks.  If input reads are short,
715    input from multiple reads are aggregated to form the output block.  When
716    finished, dd displays the number of complete and partial input and output
717    blocks and truncated input records to the standard error output.
718
719    The following operands are available:
720
721    *bs=n*
722        Set both input and output block size, superseding the ibs and obs
723        operands.  If no conversion values other than noerror, notrunc or sync
724        are specified, then each input block is copied to the output as a
725        single block without any aggregation of short blocks.
726
727    *cbs=n*
728        Set the conversion record size to n bytes.  The conversion record size
729        is required by the record oriented conversion values.
730
731    *count=n*
732        Copy only n input blocks.
733
734    *files=n*
735        Copy n input files before terminating.  This operand is only applicable
736        when the input device is a tape.
737
738    *ibs=n*
739        Set the input block size to n bytes instead of the default 512.
740
741    *if=file*
742        Read input from file instead of the standard input.
743
744    *obs=n*
745        Set the output block size to n bytes instead of the default 512.
746
747    *of=file*
748        Write output to file instead of the standard output.  Any regular
749        output file is truncated unless the notrunc conversion value is
750        specified.  If an initial portion of the output file is skipped (see
751        the seek operand) the output file is truncated at that point.
752
753    *seek=n*
754        Seek n blocks from the beginning of the output before copying.  On
755        non-tape devices, a *lseek* operation is used.  Otherwise, existing
756        blocks are read and the data discarded.  If the seek operation is past
757        the end of file, space from the current end of file to the specified
758        offset is filled with blocks of NUL bytes.
759
760    *skip=n*
761        Skip n blocks from the beginning of the input before copying.  On input
762        which supports seeks, a *lseek* operation is used.  Otherwise, input
763        data is read and discarded.  For pipes, the correct number of bytes is
764        read.  For all other devices, the correct number of blocks is read
765        without distinguishing between a partial or complete block being read.
766
767    *progress=n*
768        Switch on display of progress if n is set to any non-zero value.  This
769        will cause a "." to be printed (to the standard error output) for every
770        n full or partial blocks written to the output file.
771
772    *conv=value[,value...]*
773        Where value is one of the symbols from the following list.
774
775        *ascii, oldascii*
776            The same as the unblock value except that characters are translated
777            from EBCDIC to ASCII before the records are converted.  (These
778            values imply unblock if the operand cbs is also specified.)  There
779            are two conversion maps for ASCII.  The value ascii specifies the
780            recom- mended one which is compatible with AT&T System V UNIX.  The
781            value oldascii specifies the one used in historic AT&T and pre
782            4.3BSD-Reno systems.
783
784        *block*
785            Treats the input as a sequence of newline or end-of-file terminated
786            variable length records independent of input and output block
787            boundaries.  Any trailing newline character is discarded.  Each
788            input record is converted to a fixed length output record where the
789            length is specified by the cbs operand.  Input records shorter than
790            the conversion record size are padded with spaces.  Input records
791            longer than the conversion record size are truncated.  The number
792            of truncated input records, if any, are reported to the standard
793            error output at the completion of the copy.
794
795        *ebcdic, ibm, oldebcdic, oldibm*
796            The same as the block value except that characters are translated
797            from ASCII to EBCDIC after the records are converted.  (These
798            values imply block if the operand cbs is also specified.)  There
799            are four conversion maps for EBCDIC.  The value ebcdic specifies
800            the recommended one which is compatible with AT&T System V UNIX.
801            The value ibm is a slightly different mapping, which is compatible
802            with the AT&T System V UNIX ibm value.  The values oldebcdic and
803            oldibm are maps used in historic AT&T and pre 4.3BSD-Reno systems.
804
805        *lcase*
806            Transform uppercase characters into lowercase characters.
807
808        *noerror*
809            Do not stop processing on an input error.  When an input error
810            occurs, a diagnostic message followed by the current input and
811            output block counts will be written to the standard error output in
812            the same format as the standard completion message.  If the sync
813            conversion is also specified, any missing input data will be
814            replaced with NUL bytes (or with spaces if a block oriented
815            conversion value was specified) and processed as a normal input
816            buffer.  If the sync conversion is not specified, the input block
817            is omitted from the output.  On input files which are not tapes or
818            pipes, the file offset will be positioned past the block in which
819            the error occurred using lseek(2).
820
821        *notrunc*
822            Do not truncate the output file.  This will preserve any blocks in
823            the output file not explicitly written by dd.  The notrunc value is
824            not supported for tapes.
825
826        *osync*
827            Pad the final output block to the full output block size.  If the
828            input file is not a multiple of the output block size after
829            conversion, this conversion forces the final output block to be the
830            same size as preceding blocks for use on devices that require
831            regularly sized blocks to be written.  This option is incompatible
832            with use of the bs=n block size specification.
833
834        *sparse*
835            If one or more non-final output blocks would consist solely of NUL
836            bytes, try to seek the output file by the required space instead of
837            filling them with NULs.  This results in a sparse file on some file
838            systems.
839
840        *swab*
841            Swap every pair of input bytes.  If an input buffer has an odd
842            number of bytes, the last byte will be ignored during swapping.
843
844        *sync*
845            Pad every input block to the input buffer size.  Spaces are used
846            for pad bytes if a block oriented conversion value is specified,
847            otherwise NUL bytes are used.
848
849        *ucase*
850            Transform lowercase characters into uppercase characters.
851
852        *unblock*
853            Treats the input as a sequence of fixed length records independent
854            of input and output block boundaries.  The length of the input
855            records is specified by the cbs operand.  Any trailing space
856            characters are discarded and a newline character is appended.
857
858    Where sizes are specified, a decimal number of bytes is expected.  Two or
859    more numbers may be separated by an "x" to indicate a product.  Each number
860    may have one of the following optional suffixes:
861
862    *b*
863        Block; multiply by 512
864
865    *k*
866        Kibi; multiply by 1024 (1 KiB)
867
868    *m*
869        Mebi; multiply by 1048576 (1 MiB)
870
871    *g*
872        Gibi; multiply by 1073741824 (1 GiB)
873
874    *t*
875        Tebi; multiply by 1099511627776 (1 TiB)
876
877    *w*
878        Word; multiply by the number of bytes in an integer
879
880    When finished, dd displays the number of complete and partial input and
881    output blocks, truncated input records and odd-length byte-swapping ritten.
882    Partial output blocks to tape devices are considered fatal errors.
883    Otherwise, the rest of the block will be written.  Partial output blocks to
884    character devices will produce a warning message.  A truncated input block
885    is one where a variable length record oriented conversion value was
886    specified and the input line was too long to fit in the conversion record
887    or was not newline terminated.
888
889    Normally, data resulting from input or conversion or both are aggregated
890    into output blocks of the specified size.  After the end of input is
891    reached, any remaining output is written as a block.  This means that the
892    final output block may be shorter than the output block size.
893
894EXIT STATUS:
895    This command returns 0 on success and non-zero if an error is encountered.
896
897NOTES:
898    NONE
899
900EXAMPLES:
901    The following is an example of how to use ``dd``:
902
903    .. code-block:: shell
904
905        SHLL [/] $ dd if=/nfs/boot-image of=/dev/hda1
906
907.. index:: CONFIGURE_SHELL_NO_COMMAND_DD
908.. index:: CONFIGURE_SHELL_COMMAND_DD
909
910CONFIGURATION:
911    This command is included in the default shell command set.  When building a
912    custom command set, define ``CONFIGURE_SHELL_COMMAND_DD`` to have this
913    command included.
914
915    This command can be excluded from the shell command set by
916    defining``CONFIGURE_SHELL_NO_COMMAND_DD`` when all shell commands have been
917    configured.
918
919.. index:: rtems_shell_rtems_main_dd
920
921PROGRAMMING INFORMATION:
922    The ``dd`` command is implemented by a C language function which has the
923    following prototype:
924
925    .. code-block:: c
926
927        int rtems_shell_rtems_main_dd(
928            int    argc,
929            char **argv
930        );
931
932    The configuration structure for the ``dd`` has the following prototype:
933
934    .. code-block:: c
935
936        extern rtems_shell_cmd_t rtems_shell_DD_Command;
937
938.. raw:: latex
939
940   \clearpage
941
942.. _debugrfs:
943
944debugrfs - debug RFS file system
945--------------------------------
946.. index:: debugrfs
947
948SYNOPSYS:
949    .. code-block:: shell
950
951        debugrfs [-hl] path command [options]
952
953DESCRIPTION:
954    The command provides debugging information for the RFS file system.
955
956    The options are:
957
958    *-h*
959        Print a help message.
960
961    *-l*
962        List the commands.
963
964    *path*
965        Path to the mounted RFS file system. The file system has to be mounted
966        to view to use this command.
967
968    The commands are:
969
970    *block start [end]*
971        Display the contents of the blocks from start to end.
972
973    *data*
974        Display the file system data and configuration.
975
976    *dir bno*
977        Process the block as a directory displaying the entries.
978
979    *group start [end]*
980        Display the group data from the start group to the end group.
981
982    *inode [-aef] [start] [end]*
983        Display the inodes between start and end. If no start and end is
984        provides all inodes are displayed.
985
986        *-a*
987            Display all inodes. That is allocated and unallocated inodes.
988
989        *-e*
990            Search and display on inodes that have an error.
991
992        *-f*
993            Force display of inodes, even when in error.
994
995EXIT STATUS:
996    This command returns 0 on success and non-zero if an error is encountered.
997
998NOTES:
999    NONE
1000
1001EXAMPLES:
1002    The following is an example of how to use ``debugrfs``:
1003
1004    .. code-block:: shell
1005
1006        SHLL [/] $ debugrfs /c data
1007
1008.. index:: CONFIGURE_SHELL_NO_COMMAND_DEBUGRFS
1009.. index:: CONFIGURE_SHELL_COMMAND_DEBUGRFS
1010
1011CONFIGURATION:
1012    This command is included in the default shell command set.  When building a
1013    custom command set, define ``CONFIGURE_SHELL_COMMAND_DEBUGRFS`` to have
1014    this command included.
1015
1016    This command can be excluded from the shell command set by defining
1017    ``CONFIGURE_SHELL_NO_COMMAND_DEBUGRFS`` when all shell commands have been
1018    configured.
1019
1020.. index:: rtems_shell_rtems_main_debugrfs
1021
1022PROGRAMMING INFORMATION:
1023    The ``debugrfs`` command is implemented by a C language function which has
1024    the following prototype:
1025
1026    .. code-block:: c
1027
1028        int rtems_shell_rtems_main_debugrfs(
1029            int    argc,
1030            char **argv
1031        );
1032
1033    The configuration structure for ``debugrfs`` has the following prototype:
1034
1035    .. code-block:: c
1036
1037        extern rtems_shell_cmd_t rtems_shell_DEBUGRFS_Command;
1038
1039.. raw:: latex
1040
1041   \clearpage
1042
1043.. _df:
1044
1045df - display file system disk space usage
1046-----------------------------------------
1047.. index:: df
1048
1049SYNOPSYS:
1050    .. code-block:: shell
1051
1052        df [-h] [-B block_size]
1053
1054DESCRIPTION:
1055    This command print disk space usage for mounted file systems.
1056
1057EXIT STATUS:
1058    This command returns 0 on success and non-zero if an error is encountered.
1059
1060NOTES:
1061    NONE
1062
1063EXAMPLES:
1064    The following is an example of how to use ``df``:
1065
1066    .. code-block:: shell
1067
1068        SHLL [/] $ df -B 4K
1069        Filesystem     4K-blocks        Used   Available       Use%     Mounted on
1070        /dev/rda               124         1         124         0%   /mnt/ramdisk
1071        SHLL [/] $ df
1072        Filesystem     1K-blocks        Used   Available       Use%     Mounted on
1073        /dev/rda               495         1         494         0%   /mnt/ramdisk
1074        SHLL [/] $ df -h
1075        Filesystem     Size             Used   Available       Use%     Mounted on
1076        /dev/rda              495K        1K        494K         0%   /mnt/ramdisk
1077
1078.. index:: CONFIGURE_SHELL_NO_COMMAND_DF
1079.. index:: CONFIGURE_SHELL_COMMAND_DF
1080
1081CONFIGURATION:
1082    This command is included in the default shell command set.  When building a
1083    custom command set, define ``CONFIGURE_SHELL_COMMAND_DF`` to have this
1084    command included.
1085
1086    This command can be excluded from the shell command set by defining
1087    ``CONFIGURE_SHELL_NO_COMMAND_DF`` when all shell commands have been
1088    configured.
1089
1090.. index:: rtems_shell_rtems_main_df
1091
1092PROGRAMMING INFORMATION:
1093    The ``df`` is implemented by a C language function which has the following
1094    prototype:
1095
1096    .. code-block:: c
1097
1098        int rtems_shell_main_df(
1099            int    argc,
1100            char **argv
1101        );
1102
1103    The configuration structure for the ``df`` has the following prototype:
1104
1105    .. code-block:: c
1106
1107        extern rtems_shell_cmd_t rtems_shell_DF_Command;
1108
1109.. raw:: latex
1110
1111   \clearpage
1112
1113.. _dir:
1114
1115dir - alias for ls
1116------------------
1117.. index:: dir
1118
1119SYNOPSYS:
1120    .. code-block:: shell
1121
1122        dir [dir]
1123
1124DESCRIPTION:
1125    This command is an alias or alternate name for the ``ls``.  See `ls - list
1126    files in the directory` for more information.
1127
1128EXIT STATUS:
1129    This command returns 0 on success and non-zero if an error is encountered.
1130
1131NOTES:
1132    NONE
1133
1134EXAMPLES:
1135    The following is an example of how to use ``dir``:
1136
1137    .. code-block:: shell
1138
1139        SHLL [/] $ dir
1140        drwxr-xr-x   1   root   root         536 Jan 01 00:00 dev/
1141        drwxr-xr-x   1   root   root        1072 Jan 01 00:00 etc/
1142        2 files 1608 bytes occupied
1143        SHLL [/] $ dir etc
1144        -rw-r--r--   1   root   root         102 Jan 01 00:00 passwd
1145        -rw-r--r--   1   root   root          42 Jan 01 00:00 group
1146        -rw-r--r--   1   root   root          30 Jan 01 00:00 issue
1147        -rw-r--r--   1   root   root          28 Jan 01 00:00 issue.net
1148        4 files 202 bytes occupied
1149
1150.. index:: CONFIGURE_SHELL_NO_COMMAND_DIR
1151.. index:: CONFIGURE_SHELL_COMMAND_DIR
1152
1153CONFIGURATION:
1154    This command is included in the default shell command set.  When building a
1155    custom command set, define``CONFIGURE_SHELL_COMMAND_DIR`` to have this
1156    command included.
1157
1158    This command can be excluded from the shell command set by defining
1159    ``CONFIGURE_SHELL_NO_COMMAND_DIR`` when all shell commands have been
1160    configured.
1161
1162.. index:: rtems_shell_rtems_main_dir
1163
1164PROGRAMMING INFORMATION:
1165    The ``dir`` is implemented by a C language function which has the following
1166    prototype:
1167
1168    .. code-block:: c
1169
1170        int rtems_shell_rtems_main_dir(
1171            int    argc,
1172            char **argv
1173        );
1174
1175    The configuration structure for the ``dir`` has the following prototype:
1176
1177    .. code-block:: c
1178
1179        extern rtems_shell_cmd_t rtems_shell_DIR_Command;
1180
1181.. raw:: latex
1182
1183   \clearpage
1184
1185.. _fdisk:
1186
1187fdisk - format disk
1188-------------------
1189.. index:: fdisk
1190
1191SYNOPSYS:
1192    .. code-block:: shell
1193
1194        fdisk
1195
1196.. index:: CONFIGURE_SHELL_NO_COMMAND_FDISK
1197.. index:: CONFIGURE_SHELL_COMMAND_FDISK
1198
1199CONFIGURATION:
1200    This command is included in the default shell command set.  When building a
1201    custom command set, define ``CONFIGURE_SHELL_COMMAND_FDISK`` to have this
1202    command included.
1203
1204    This command can be excluded from the shell command set by defining
1205    ``CONFIGURE_SHELL_NO_COMMAND_FDISK`` when all shell commands have been
1206    configured.
1207
1208.. raw:: latex
1209
1210   \clearpage
1211
1212.. _hexdump:
1213
1214hexdump - ascii/dec/hex/octal dump
1215----------------------------------
1216.. index:: hexdump
1217
1218SYNOPSYS:
1219    .. code-block:: shell
1220
1221        hexdump [-bcCdovx] [-e format_string] [-f format_file] [-n length] [-s skip] file ...
1222
1223DESCRIPTION:
1224    The hexdump utility is a filter which displays the specified files, or the
1225    standard input, if no files are specified, in a user specified format.
1226
1227    The options are as follows:
1228
1229    *-b*
1230        One-byte octal display.  Display the input offset in hexadecimal,
1231        followed by sixteen space-separated, three column, zero-filled, bytes
1232        of input data, in octal, per line.
1233
1234    *-c*
1235        One-byte character display.  Display the input offset in hexadecimal,
1236        followed by sixteen space-separated, three column, space-filled,
1237        characters of input data per line.
1238
1239    *-C*
1240        Canonical hex+ASCII display.  Display the input offset in hexadecimal,
1241        followed by sixteen space-separated, two column, hexadecimal bytes,
1242        followed by the same sixteen bytes in %_p format enclosed in "|"
1243        characters.
1244
1245    *-d*
1246        Two-byte decimal display.  Display the input offset in hexadecimal,
1247        followed by eight space-separated, five column, zero-filled, two-byte
1248        units of input data, in unsigned decimal, per line.
1249
1250    *-e format_string*
1251        Specify a format string to be used for displaying data.
1252
1253    *-f format_file*
1254        Specify a file that contains one or more newline separated format
1255        strings.  Empty lines and lines whose first non-blank character is a
1256        hash mark (#) are ignored.
1257
1258    *-n length*
1259        Interpret only length bytes of input.
1260
1261    *-o*
1262        Two-byte octal display.  Display the input offset in hexadecimal,
1263        followed by eight space-separated, six column, zerofilled, two byte
1264        quantities of input data, in octal, per line.
1265
1266    *-s offset*
1267        Skip offset bytes from the beginning of the input.  By default, offset
1268        is interpreted as a decimal number.  With a leading 0x or 0X, offset is
1269        interpreted as a hexadecimal number, otherwise, with a leading 0,
1270        offset is interpreted as an octal number.  Appending the character b,
1271        k, or m to offset causes it to be interpreted as a multiple of 512,
1272        1024, or 1048576, respectively.
1273
1274    *-v*
1275        The -v option causes hexdump to display all input data.  Without the -v
1276        option, any number of groups of output lines, which would be identical
1277        to the immediately preceding group of output lines (except for the
1278        input offsets), are replaced with a line containing a single asterisk.
1279
1280    *-x*
1281        Two-byte hexadecimal display.  Display the input offset in hexadecimal,
1282        followed by eight, space separated, four column, zero-filled, two-byte
1283        quantities of input data, in hexadecimal, per line.
1284
1285    For each input file, hexdump sequentially copies the input to standard
1286    output, transforming the data according to the format strings specified by
1287    the -e and -f options, in the order that they were specified.
1288
1289    *Formats*
1290
1291    A format string contains any number of format units, separated by
1292    whitespace.  A format unit contains up to three items: an iteration count,
1293    a byte count, and a format.
1294
1295    The iteration count is an optional positive integer, which defaults to one.
1296    Each format is applied iteration count times.
1297
1298    The byte count is an optional positive integer.  If specified it defines
1299    the number of bytes to be interpreted by each iteration of the format.
1300
1301    If an iteration count and/or a byte count is specified, a single slash must
1302    be placed after the iteration count and/or before the byte count to
1303    disambiguate them.  Any whitespace before or after the slash is ignored.
1304
1305    The format is required and must be surrounded by double quote (" ") marks.
1306    It is interpreted as a fprintf-style format string (see*fprintf*), with the
1307    following exceptions:
1308
1309    - An asterisk (*) may not be used as a field width or precision.
1310
1311    - A byte count or field precision is required for each "s" con- version
1312      character (unlike the fprintf(3) default which prints the entire string
1313      if the precision is unspecified).
1314
1315    - The conversion characters "h", "l", "n", "p" and "q" are not supported.
1316
1317    - The single character escape sequences described in the C standard are
1318      supported:
1319
1320          NUL                  \0
1321          <alert character>    \a
1322          <backspace>          \b
1323          <form-feed>          \f
1324          <newline>            \n
1325          <carriage return>    \r
1326          <tab>                \t
1327          <vertical tab>       \v
1328
1329    Hexdump also supports the following additional conversion strings:
1330
1331    *_a[dox]*
1332        Display the input offset, cumulative across input files, of the next
1333        byte to be displayed.  The appended characters d, o, and x specify the
1334        display base as decimal, octal or hexadecimal respectively.
1335
1336    *_A[dox]*
1337        Identical to the _a conversion string except that it is only performed
1338        once, when all of the input data has been processed.
1339
1340    *_c*
1341        Output characters in the default character set.  Nonprinting characters
1342        are displayed in three character, zero-padded octal, except for those
1343        representable by standard escape notation (see above), which are
1344        displayed as two character strings.
1345
1346    *_p*
1347        Output characters in the default character set.  Nonprinting characters
1348        are displayed as a single ".".
1349
1350    *_u*
1351        Output US ASCII characters, with the exception that control characters
1352        are displayed using the following, lower-case, names.  Characters
1353        greater than 0xff, hexadecimal, are displayed as hexadecimal strings.
1354
1355        +-----------+-----------+-----------+-----------+-----------+-----------+
1356        |``000`` nul|``001`` soh|``002`` stx|``003`` etx|``004`` eot|``005`` enq|
1357        +-----------+-----------+-----------+-----------+-----------+-----------+
1358        |``006`` ack|``007`` bel|``008`` bs |``009`` ht |``00A`` lf |``00B`` vt |
1359        +-----------+-----------+-----------+-----------+-----------+-----------+
1360        |``00C`` ff |``00D`` cr |``00E`` so |``00F`` si |``010`` dle|``011`` dc1|
1361        +-----------+-----------+-----------+-----------+-----------+-----------+
1362        |``012`` dc2|``013`` dc3|``014`` dc4|``015`` nak|``016`` syn|``017`` etb|
1363        +-----------+-----------+-----------+-----------+-----------+-----------+
1364        |``018`` can|``019`` em |``01A`` sub|``01B`` esc|``01C`` fs |``01D`` gs |
1365        +-----------+-----------+-----------+-----------+-----------+-----------+
1366        |``01E`` rs |``01F`` us |``07F`` del|           |           |           |
1367        +-----------+-----------+-----------+-----------+-----------+-----------+
1368
1369    The default and supported byte counts for the conversion characters are as
1370    follows:
1371
1372        +----------------------+---------------------------------+
1373        |%_c, %_p, %_u, %c     |One byte counts only.            |
1374        +----------------------+---------------------------------+
1375        |%d, %i, %o, %u, %X, %x|Four byte default, one, two, four|
1376        |                      |and eight byte counts supported. |
1377        +----------------------+---------------------------------+
1378        |%E, %e, %f, %G, %g    |Eight byte default, four byte    |
1379        |                      |counts supported.                |
1380        +----------------------+---------------------------------+
1381
1382    The amount of data interpreted by each format string is the sum of the data
1383    required by each format unit, which is the iteration count times the byte
1384    count, or the iteration count times the number of bytes required by the
1385    format if the byte count is not specified.
1386
1387    The input is manipulated in "blocks", where a block is defined as the
1388    largest amount of data specified by any format string.  Format strings
1389    interpreting less than an input block's worth of data, whose last format
1390    unit both interprets some number of bytes and does not have a specified
1391    iteration count, have the iteration count incremented until the entire
1392    input block has been processed or there is not enough data remaining in the
1393    block to satisfy the format string.
1394
1395    If, either as a result of user specification or hexdump modifying the
1396    iteration count as described above, an iteration count is greater than one,
1397    no trailing whitespace characters are output during the last iteration.
1398
1399    It is an error to specify a byte count as well as multiple conversion
1400    characters or strings unless all but one of the conversion characters or
1401    strings is _a or _A.
1402
1403    If, as a result of the specification of the -n option or end-of-file being
1404    reached, input data only partially satisfies a format string, the input
1405    block is zero-padded sufficiently to display all available data (i.e. any
1406    format units overlapping the end of data will display some num- ber of the
1407    zero bytes).
1408
1409    Further output by such format strings is replaced by an equivalent number
1410    of spaces.  An equivalent number of spaces is defined as the number of
1411    spaces output by an s conversion character with the same field width and
1412    precision as the original conversion character or conversion string but
1413    with any "+", " ", "#" conversion flag characters removed, and ref-
1414    erencing a NULL string.
1415
1416    If no format strings are specified, the default display is equivalent to
1417    specifying the -x option.
1418
1419EXIT STATUS:
1420    This command returns 0 on success and non-zero if an error is encountered.
1421
1422NOTES:
1423    NONE
1424
1425EXAMPLES:
1426    The following is an example of how to use ``hexdump``:
1427
1428    .. code-block:: shell
1429
1430        SHLL [/] $ hexdump -C -n 512 /dev/hda1
1431
1432.. index:: CONFIGURE_SHELL_NO_COMMAND_HEXDUMP
1433.. index:: CONFIGURE_SHELL_COMMAND_HEXDUMP
1434
1435CONFIGURATION:
1436    This command is included in the default shell command set.  When building a
1437    custom command set, define ``CONFIGURE_SHELL_COMMAND_HEXDUMP`` to have this
1438    command included.
1439
1440    This command can be excluded from the shell command set by
1441    defining``CONFIGURE_SHELL_NO_COMMAND_HEXDUMP`` when all shell commands have
1442    been configured.
1443
1444.. index:: rtems_shell_rtems_main_hexdump
1445
1446PROGRAMMING INFORMATION:
1447    The ``hexdump`` command is implemented by a C language function which has
1448    the following prototype:
1449
1450    .. code-block:: c
1451
1452        int rtems_shell_rtems_main_hexdump(
1453            int    argc,
1454            char **argv
1455        );
1456
1457    The configuration structure for the ``hexdump`` has the following prototype:
1458
1459    .. code-block:: c
1460
1461        extern rtems_shell_cmd_t rtems_shell_HEXDUMP_Command;
1462
1463.. raw:: latex
1464
1465   \clearpage
1466
1467.. _ln:
1468
1469ln - make links
1470---------------
1471.. index:: ln
1472
1473SYNOPSYS:
1474    .. code-block:: c
1475
1476        ln [-fhinsv] source_file [target_file]
1477        ln [-fhinsv] source_file ... target_dir
1478
1479DESCRIPTION:
1480    The ln utility creates a new directory entry (linked file) which has the
1481    same modes as the original file.  It is useful for maintaining multiple
1482    copies of a file in many places at once without using up storage for the
1483    "copies"; instead, a link "points" to the original copy.  There are two
1484    types of links; hard links and symbolic links.  How a link "points" to a
1485    file is one of the differences between a hard or symbolic link.
1486
1487    The options are as follows:
1488
1489    *-f*
1490        Unlink any already existing file, permitting the link to occur.
1491
1492    *-h*
1493        If the target_file or target_dir is a symbolic link, do not follow it.
1494        This is most useful with the -f option, to replace a symlink which may
1495        point to a directory.
1496
1497    *-i*
1498        Cause ln to write a prompt to standard error if the target file exists.
1499        If the response from the standard input begins with the character 'y'
1500        or 'Y', then unlink the target file so that the link may occur.
1501        Otherwise, do not attempt the link.  (The -i option overrides any
1502        previous -f options.)
1503
1504    *-n*
1505        Same as -h, for compatibility with other ln implementations.
1506
1507    *-s*
1508        Create a symbolic link.
1509
1510    *-v*
1511        Cause ln to be verbose, showing files as they are processed.
1512
1513    By default ln makes hard links.  A hard link to a file is indistinguishable
1514    from the original directory entry; any changes to a file are effective
1515    independent of the name used to reference the file.  Hard links may not
1516    normally refer to directories and may not span file systems.
1517
1518    A symbolic link contains the name of the file to which it is linked.  The
1519    referenced file is used when an *open* operation is performed on the link.
1520    A *stat* on a symbolic link will return the linked-to file; an *lstat* must
1521    be done to obtain information about the link.  The *readlink* call may be
1522    used to read the contents of a symbolic link.  Symbolic links may span file
1523    systems and may refer to directories.
1524
1525    Given one or two arguments, ln creates a link to an existing file
1526    source_file.  If target_file is given, the link has that name; target_file
1527    may also be a directory in which to place the link; otherwise it is placed
1528    in the current directory.  If only the directory is specified, the link
1529    will be made to the last component of source_file.
1530
1531    Given more than two arguments, ln makes links in target_dir to all the
1532    named source files.  The links made will have the same name as the files
1533    being linked to.
1534
1535EXIT STATUS:
1536    The ``ln`` utility exits 0 on success, and >0 if an error occurs.
1537
1538NOTES:
1539    None.
1540
1541EXAMPLES:
1542    .. code-block:: shell
1543
1544        SHLL [/] ln -s /dev/console /dev/con1
1545
1546.. index:: CONFIGURE_SHELL_NO_COMMAND_LN
1547.. index:: CONFIGURE_SHELL_COMMAND_LN
1548
1549CONFIGURATION:
1550    This command is included in the default shell command set.  When building a
1551    custom command set, define ``CONFIGURE_SHELL_COMMAND_LN`` to have this
1552    command included.
1553
1554    This command can be excluded from the shell command set by defining
1555    ``CONFIGURE_SHELL_NO_COMMAND_LN`` when all shell commands have been
1556    configured.
1557
1558.. index:: rtems_shell_rtems_main_ln
1559
1560PROGRAMMING INFORMATION:
1561    The ``ln`` command is implemented by a C language function which has the
1562    following prototype:
1563
1564    .. code-block:: c
1565
1566        int rtems_shell_rtems_main_ln(
1567            int    argc,
1568            char **argv
1569        );
1570
1571    The configuration structure for the ``ln`` has the following prototype:
1572
1573    .. code-block:: c
1574
1575        extern rtems_shell_cmd_t rtems_shell_LN_Command;
1576
1577ORIGIN:
1578    The implementation and portions of the documentation for this command are
1579    from NetBSD 4.0.
1580
1581.. raw:: latex
1582
1583   \clearpage
1584
1585.. _ls:
1586
1587ls - list files in the directory
1588--------------------------------
1589.. index:: ls
1590
1591SYNOPSYS:
1592    .. code-block:: shell
1593
1594        ls [dir]
1595
1596DESCRIPTION:
1597    This command displays the contents of the specified directory.  If no
1598    arguments are given, then it displays the contents of the current working
1599    directory.
1600
1601EXIT STATUS:
1602    This command returns 0 on success and non-zero if an error is encountered.
1603
1604NOTES:
1605    This command currently does not display information on a set of files like
1606    the POSIX ls(1).  It only displays the contents of entire directories.
1607
1608EXAMPLES:
1609    The following is an example of how to use ``ls``:
1610
1611    .. code-block:: shell
1612
1613        SHLL [/] $ ls
1614        drwxr-xr-x   1   root   root         536 Jan 01 00:00 dev/
1615        drwxr-xr-x   1   root   root        1072 Jan 01 00:00 etc/
1616        2 files 1608 bytes occupied
1617        SHLL [/] $ ls etc
1618        -rw-r--r--   1   root   root         102 Jan 01 00:00 passwd
1619        -rw-r--r--   1   root   root          42 Jan 01 00:00 group
1620        -rw-r--r--   1   root   root          30 Jan 01 00:00 issue
1621        -rw-r--r--   1   root   root          28 Jan 01 00:00 issue.net
1622        4 files 202 bytes occupied
1623        SHLL [/] $ ls dev etc
1624        -rwxr-xr-x   1  rtems   root           0 Jan 01 00:00 console
1625        -rwxr-xr-x   1   root   root           0 Jan 01 00:00 console_b
1626
1627.. index:: CONFIGURE_SHELL_NO_COMMAND_LS
1628.. index:: CONFIGURE_SHELL_COMMAND_LS
1629
1630CONFIGURATION:
1631    This command is included in the default shell command set.  When building a
1632    custom command set, define ``CONFIGURE_SHELL_COMMAND_LS`` to have this
1633    command included.
1634
1635    This command can be excluded from the shell command set by defining
1636    ``CONFIGURE_SHELL_NO_COMMAND_LS`` when all shell commands have been
1637    configured.
1638
1639.. index:: rtems_shell_rtems_main_ls
1640
1641PROGRAMMING INFORMATION:
1642    The ``ls`` is implemented by a C language function which has the following
1643    prototype:
1644
1645    .. code-block:: c
1646
1647        int rtems_shell_rtems_main_ls(
1648            int    argc,
1649            char **argv
1650        );
1651
1652    The configuration structure for the ``ls`` has the following prototype:
1653
1654    .. code-block:: c
1655
1656        extern rtems_shell_cmd_t rtems_shell_LS_Command;
1657
1658.. raw:: latex
1659
1660   \clearpage
1661
1662.. _md5:
1663
1664md5 - compute the Md5 hash of a file or list of files
1665-----------------------------------------------------
1666.. index:: md5
1667
1668SYNOPSYS:
1669    .. code-block:: shell
1670
1671        md5 <files>
1672
1673DESCRIPTION:
1674    This command prints the MD5 of a file. You can provide one or more files on
1675    the command line and a hash for each file is printed in a single line of
1676    output.
1677
1678EXIT STATUS:
1679    This command returns 0 on success and non-zero if an error is encountered.
1680
1681NOTES:
1682    None.
1683
1684EXAMPLES:
1685    The following is an example of how to use ``md5``:
1686
1687    .. code-block:: shell
1688
1689        SHLL [/] $ md5 shell-init
1690        MD5 (shell-init) = 43b4d2e71b47db79eae679a2efeacf31
1691
1692.. index:: CONFIGURE_SHELL_NO_COMMAND_MD5
1693.. index:: CONFIGURE_SHELL_COMMAND_MD5
1694
1695CONFIGURATION:
1696    This command is included in the default shell command set.  When building a
1697    custom command set, define``CONFIGURE_SHELL_COMMAND_MD5`` to have this
1698    command included.
1699
1700    This command can be excluded from the shell command set by defining
1701    ``CONFIGURE_SHELL_NO_COMMAND_MD5`` when all shell commands have been
1702    configured.
1703
1704.. index:: rtems_shell_rtems_main_md5
1705
1706PROGRAMMING INFORMATION:
1707    The ``md5`` is implemented by a C language function which has the following
1708    prototype:
1709
1710    .. code-block:: c
1711
1712        int rtems_shell_main_md5(
1713            int    argc,
1714            char **argv
1715        );
1716
1717    The configuration structure for the ``md5`` has the following prototype:
1718
1719    .. code-block:: c
1720
1721        extern rtems_shell_cmd_t rtems_shell_MD5_Command;
1722
1723.. raw:: latex
1724
1725   \clearpage
1726
1727.. _mkdir:
1728
1729mkdir - create a directory
1730--------------------------
1731.. index:: mkdir
1732
1733SYNOPSYS:
1734    .. code-block:: c
1735
1736        mkdir  dir [dir1 .. dirN]
1737
1738DESCRIPTION:
1739    This command creates the set of directories in the order they are specified
1740    on the command line.  If an error is encountered making one of the
1741    directories, the command will continue to attempt to create the remaining
1742    directories on the command line.
1743
1744EXIT STATUS:
1745    This command returns 0 on success and non-zero if an error is encountered.
1746
1747NOTES:
1748    If this command is invoked with no arguments, nothing occurs.
1749
1750    The user must have sufficient permissions to create the directory.  For the
1751    ``fileio`` test provided with RTEMS, this means the user must login as
1752    ``root`` not ``rtems``.
1753
1754EXAMPLES:
1755    The following is an example of how to use ``mkdir``:
1756
1757    .. code-block:: shell
1758
1759        SHLL [/] # ls
1760        drwxr-xr-x   1   root   root         536 Jan 01 00:00 dev/
1761        drwxr-xr-x   1   root   root        1072 Jan 01 00:00 etc/
1762        2 files 1608 bytes occupied
1763        SHLL [/] # mkdir joel
1764        SHLL [/] # ls joel
1765        0 files 0 bytes occupied
1766        SHLL [/] # cp etc/passwd joel
1767        SHLL [/] # ls joel
1768        -rw-r--r--   1   root   root         102 Jan 01 00:02 passwd
1769        1 files 102 bytes occupied
1770
1771.. index:: CONFIGURE_SHELL_NO_COMMAND_MKDIR
1772.. index:: CONFIGURE_SHELL_COMMAND_MKDIR
1773
1774CONFIGURATION:
1775    This command is included in the default shell command set.  When building a
1776    custom command set, define ``CONFIGURE_SHELL_COMMAND_MKDIR`` to have this
1777    command included.
1778
1779    This command can be excluded from the shell command set by defining
1780    ``CONFIGURE_SHELL_NO_COMMAND_MKDIR`` when all shell commands have been
1781    configured.
1782
1783.. index:: rtems_shell_rtems_main_mkdir
1784
1785PROGRAMMING INFORMATION:
1786    The ``mkdir`` is implemented by a C language function which has the
1787    following prototype:
1788
1789    .. code-block:: c
1790
1791        int rtems_shell_rtems_main_mkdir(
1792            int    argc,
1793            char **argv
1794        );
1795
1796    The configuration structure for the ``mkdir`` has the following prototype:
1797
1798    .. code-block:: c
1799
1800        extern rtems_shell_cmd_t rtems_shell_MKDIR_Command;
1801
1802.. raw:: latex
1803
1804   \clearpage
1805
1806.. _mkdos:
1807
1808mkdos - DOSFS file system format
1809--------------------------------
1810.. index:: mkdos
1811
1812SYNOPSYS:
1813    .. code-block:: shell
1814
1815        mkdos [-V label] [-s sectors/cluster] [-r size] [-v] path
1816
1817DESCRIPTION:
1818    This command formats a block device entry with the DOSFS file system.
1819
1820    *-V label*
1821        Specify the volume label.
1822
1823    *-s sectors/cluster*
1824        Specify the number of sectors per cluster.
1825
1826    *-r size*
1827        Specify the number  of entries in the root directory.
1828
1829    *-v*
1830        Enable verbose output mode.
1831
1832EXIT STATUS:
1833    This command returns 0 on success and non-zero if an error is encountered.
1834
1835NOTES:
1836    None.
1837
1838EXAMPLES:
1839    The following is an example of how to use ``mkdos``:
1840
1841    .. code-block:: shell
1842
1843        SHLL [/] $ mkdos /dev/rda1
1844
1845.. index:: CONFIGURE_SHELL_NO_COMMAND_MKDOS
1846.. index:: CONFIGURE_SHELL_COMMAND_MKDOS
1847
1848CONFIGURATION:
1849    This command is included in the default shell command set.  When building a
1850    custom command set, define ``CONFIGURE_SHELL_COMMAND_MKDOS`` to have this
1851    command included.
1852
1853    This command can be excluded from the shell command set by defining
1854    ``CONFIGURE_SHELL_NO_COMMAND_MKDOS`` when all shell commands have been
1855    configured.
1856
1857.. index:: rtems_shell_rtems_main_mkdos
1858
1859PROGRAMMING INFORMATION:
1860    The ``mkdos`` is implemented by a C language function which has the
1861    following prototype:
1862
1863    .. code-block:: c
1864
1865        int rtems_shell_rtems_main_mkdos(
1866            int    argc,
1867            char **argv
1868        );
1869
1870    The configuration structure for the ``mkdos`` has the following prototype:
1871
1872    .. code-block:: c
1873
1874        extern rtems_shell_cmd_t rtems_shell_MKDOS_Command;
1875
1876.. raw:: latex
1877
1878   \clearpage
1879
1880.. _mknod:
1881
1882mknod - make device special file
1883--------------------------------
1884.. index:: mknod
1885
1886SYNOPSYS:
1887    .. code-block:: shell
1888
1889        mknod [-rR] [-F fmt] [-g gid] [-m mode] [-u uid] name [c | b] [driver | major] minor
1890        mknod [-rR] [-F fmt] [-g gid] [-m mode] [-u uid] name [c | b] major unit subunit
1891        mknod [-rR] [-g gid] [-m mode] [-u uid] name [c | b] number
1892        mknod [-rR] [-g gid] [-m mode] [-u uid] name p
1893
1894DESCRIPTION:
1895    The mknod command creates device special files, or fifos.  Normally the
1896    shell script /dev/MAKEDEV is used to create special files for commonly
1897    known devices; it executes mknod with the appropriate arguments and can
1898    make all the files required for the device.
1899
1900    To make nodes manually, the arguments are:
1901
1902    *-r*
1903        Replace an existing file if its type is incorrect.
1904
1905    *-R*
1906        Replace an existing file if its type is incorrect.  Correct the mode,
1907        user and group.
1908
1909    *-g gid*
1910        Specify the group for the device node.  The gid operand may be a
1911        numeric group ID or a group name.  If a group name is also a numeric
1912        group ID, the operand is used as a group name.  Precede a numeric group
1913        ID with a # to stop it being treated as a name.
1914
1915    *-m mode*
1916        Specify the mode for the device node.  The mode may be absolute or
1917        symbolic, see *chmod*.
1918
1919    *-u uid*
1920        Specify the user for the device node.  The uid operand may be a numeric
1921        user ID or a user name.  If a user name is also a numeric user ID, the
1922        operand is used as a user name.  Precede a numeric user ID with a # to
1923        stop it being treated as a name.
1924
1925    *name*
1926        Device name, for example "tty" for a termios serial device or "hd" for
1927        a disk.
1928
1929    *b | c | p*
1930        Type of device.  If the device is a block type device such as a tape or
1931        disk drive which needs both cooked and raw special files, the type
1932        is b.  All other devices are character type devices, such as terminal
1933        and pseudo devices, and are type c.  Specifying p creates fifo files.
1934
1935    *driver | major*
1936        The major device number is an integer number which tells the kernel
1937        which device driver entry point to use.  If the device driver is
1938        configured into the current kernel it may be specified by driver name
1939        or major number.
1940
1941    *minor*
1942        The minor device number tells the kernel which one of several similar
1943        devices the node corresponds to; for example, it may be a specific
1944        serial port or pty.
1945
1946    *unit and subunit*
1947        The unit and subunit numbers select a subset of a device; for example,
1948        the unit may specify a particular disk, and the subunit a partition on
1949        that disk.  (Currently this form of specification is only supported by
1950        the bsdos format, for compatibility with the BSD/OS mknod).
1951
1952    *number*
1953        A single opaque device number.  Useful for netbooted computers which
1954        require device numbers packed in a format that isn't supported by -F.
1955
1956EXIT STATUS:
1957    The ``mknod`` utility exits 0 on success, and >0 if an error occurs.
1958
1959NOTES:
1960    None.
1961
1962EXAMPLES:
1963    .. code-block:: shell
1964
1965        SHLL [/] mknod c 3 0 /dev/ttyS10
1966
1967.. index:: CONFIGURE_SHELL_NO_COMMAND_MKNOD
1968.. index:: CONFIGURE_SHELL_COMMAND_MKNOD
1969
1970CONFIGURATION:
1971    This command is included in the default shell command set.  When building a
1972    custom command set, define ``CONFIGURE_SHELL_COMMAND_MKNOD`` to have this
1973    command included.
1974
1975    This command can be excluded from the shell command set by defining
1976    ``CONFIGURE_SHELL_NO_COMMAND_MKNOD`` when all shell commands have been
1977    configured.
1978
1979.. index:: rtems_shell_rtems_main_mknod
1980
1981PROGRAMMING INFORMATION:
1982    The ``mknod`` command is implemented by a C language function which has the
1983    following prototype:
1984
1985    .. code-block:: c
1986
1987        int rtems_shell_rtems_main_mknod(
1988            int    argc,
1989            char **argv
1990        );
1991
1992    The configuration structure for the ``mknod`` has the following prototype:
1993
1994    .. code-block:: c
1995
1996        extern rtems_shell_cmd_t rtems_shell_MKNOD_Command;
1997
1998ORIGIN:
1999    The implementation and portions of the documentation for this command are
2000    from NetBSD 4.0.
2001
2002.. raw:: latex
2003
2004   \clearpage
2005
2006.. _mkrfs:
2007
2008mkrfs - format RFS file system
2009------------------------------
2010.. index:: mkrfs
2011
2012SYNOPSYS:
2013    .. code-block:: shell
2014
2015        mkrfs [-vsbiIo] device
2016
2017DESCRIPTION:
2018    Format the block device with the RTEMS File System (RFS). The default
2019    configuration with not parameters selects a suitable block size based on
2020    the size of the media being formatted.
2021
2022    The media is broken up into groups of blocks. The number of blocks in a
2023    group is based on the number of bits a block contains. The large a block
2024    the more blocks a group contains and the fewer groups in the file system.
2025
2026    The following options are provided:
2027
2028    *-v*
2029        Display configuration and progress of the format.
2030
2031    *-s*
2032        Set the block size in bytes.
2033
2034    *-b*
2035        The number of blocks in a group. The block count must be equal or less
2036        than the number of bits in a block.
2037
2038    *-i*
2039        Number of inodes in a group. The inode count must be equal or less than
2040        the number of bits in a block.
2041
2042    *-I*
2043        Initialise the inodes. The default is not to initialise the inodes and
2044        to rely on the inode being initialised when allocated. Initialising the
2045        inode table helps recovery if a problem appears.
2046
2047    *-o*
2048        Integer percentage of the media used by inodes. The default is 1%.
2049
2050    *device*
2051        Path of the device to format.
2052
2053EXIT STATUS:
2054    This command returns 0 on success and non-zero if an error is encountered.
2055
2056NOTES:
2057    None.
2058
2059EXAMPLES:
2060    The following is an example of how to use ``mkrfs``:
2061
2062    .. code-block:: shell
2063
2064        SHLL [/] $ mkrfs /dev/fdda
2065
2066.. index:: CONFIGURE_SHELL_NO_COMMAND_MKRFS
2067.. index:: CONFIGURE_SHELL_COMMAND_MKRFS
2068
2069CONFIGURATION:
2070    This command is included in the default shell command set.  When building a
2071    custom command set, define ``CONFIGURE_SHELL_COMMAND_MKRFS`` to have this
2072    command included.
2073
2074    This command can be excluded from the shell command set by defining
2075    ``CONFIGURE_SHELL_NO_COMMAND_MKRFS`` when all shell commands have been
2076    configured.
2077
2078.. index:: rtems_shell_rtems_main_mkrfs
2079
2080PROGRAMMING INFORMATION:
2081    The ``mkrfs`` command is implemented by a C language function which has the
2082    following prototype:
2083
2084    .. code-block:: c
2085
2086        int rtems_shell_rtems_main_mkrfs(
2087            int    argc,
2088            char **argv
2089        );
2090
2091    The configuration structure for ``mkrfs`` has the following prototype:
2092
2093    .. code-block:: c
2094
2095        extern rtems_shell_cmd_t rtems_shell_MKRFS_Command;
2096
2097.. raw:: latex
2098
2099   \clearpage
2100
2101.. _mount:
2102
2103mount - mount disk
2104------------------
2105.. index:: mount
2106
2107SYNOPSYS:
2108    .. code-block:: shell
2109
2110        mount [-t fstype] [-r] [-L] device path
2111
2112DESCRIPTION:
2113    The ``mount`` command will mount a block device to a mount point using the
2114    specified file system. The files systems are:
2115
2116    - msdos - MSDOS File System
2117
2118    - tftp  - TFTP Network File System
2119
2120    - ftp   - FTP Network File System
2121
2122    - nfs   - Network File System
2123
2124    - rfs   - RTEMS File System
2125
2126    When the file system type is 'msdos' or 'rfs' the driver is a "block device
2127    driver" node present in the file system. The driver is ignored with the
2128    'tftp' and 'ftp' file systems. For the 'nfs' file system the driver is the
2129    'host:/path' string that described NFS host and the exported file system
2130    path.
2131
2132EXIT STATUS:
2133    This command returns 0 on success and non-zero if an error is encountered.
2134
2135NOTES:
2136    The mount point must exist.
2137
2138    The services offered by each file-system vary. For example you cannot list
2139    the directory of a TFTP file-system as this server is not provided in the
2140    TFTP protocol. You need to check each file-system's documentation for the
2141    services provided.
2142
2143EXAMPLES:
2144    Mount the Flash Disk driver to the '/fd' mount point:
2145
2146    .. code-block:: shell
2147
2148        SHLL [/] $ mount -t msdos /dev/flashdisk0 /fd
2149
2150    Mount the NFS file system exported path 'bar' by host 'foo':
2151
2152    .. code-block:: shell
2153
2154        $ mount -t nfs foo:/bar /nfs
2155
2156    Mount the TFTP file system on '/tftp':
2157
2158    .. code-block:: shell
2159
2160        $ mount -t tftp /tftp
2161
2162    To access the TFTP files on server '10.10.10.10':
2163    .. code-block:: shell
2164
2165        $ cat /tftp/10.10.10.10/test.txt
2166
2167.. index:: CONFIGURE_SHELL_NO_COMMAND_MOUNT
2168.. index:: CONFIGURE_SHELL_COMMAND_MOUNT
2169
2170CONFIGURATION:
2171    This command is included in the default shell command set.  When building a
2172    custom command set, define ``CONFIGURE_SHELL_COMMAND_MOUNT`` to have this
2173    command included.
2174
2175    This command can be excluded from the shell command set by defining
2176    ``CONFIGURE_SHELL_NO_COMMAND_MOUNT`` when all shell commands have been
2177    configured.
2178
2179    The mount command includes references to file-system code. If you do not
2180    wish to include file-system that you do not use do not define the mount
2181    command support for that file-system. The file-system mount command defines
2182    are:
2183
2184    - msdos - CONFIGURE_SHELL_MOUNT_MSDOS
2185
2186    - tftp - CONFIGURE_SHELL_MOUNT_TFTP
2187
2188    - ftp - CONFIGURE_SHELL_MOUNT_FTP
2189
2190    - nfs - CONFIGURE_SHELL_MOUNT_NFS
2191
2192    - rfs - CONFIGURE_SHELL_MOUNT_RFS
2193
2194    An example configuration is:
2195
2196    .. code-block:: c
2197
2198        #define CONFIGURE_SHELL_MOUNT_MSDOS
2199        #ifdef RTEMS_NETWORKING
2200        #define CONFIGURE_SHELL_MOUNT_TFTP
2201        #define CONFIGURE_SHELL_MOUNT_FTP
2202        #define CONFIGURE_SHELL_MOUNT_NFS
2203        #define CONFIGURE_SHELL_MOUNT_RFS
2204        #endif
2205
2206.. index:: rtems_shell_rtems_main_mount
2207
2208PROGRAMMING INFORMATION:
2209    The ``mount`` is implemented by a C language function which has the
2210    following prototype:
2211
2212    .. code-block:: c
2213
2214        int rtems_shell_rtems_main_mount(
2215            int    argc,
2216            char **argv
2217        );
2218
2219    The configuration structure for the ``mount`` has the following prototype:
2220
2221    .. code-block:: c
2222
2223        extern rtems_shell_cmd_t rtems_shell_MOUNT_Command;
2224
2225.. raw:: latex
2226
2227   \clearpage
2228
2229.. _mv:
2230
2231mv - move files
2232---------------
2233.. index:: mv
2234
2235SYNOPSYS:
2236    .. code-block:: shell
2237
2238        mv [-fiv] source_file target_file
2239        mv [-fiv] source_file... target_file
2240
2241DESCRIPTION:
2242    In its first form, the mv utility renames the file named by the source
2243    operand to the destination path named by the target operand.  This form is
2244    assumed when the last operand does not name an already existing directory.
2245
2246    In its second form, mv moves each file named by a source operand to a
2247    destination file in the existing directory named by the directory operand.
2248    The destination path for each operand is the pathname produced by the
2249    concatenation of the last operand, a slash, and the final pathname
2250    component of the named file.
2251
2252    The following options are available:
2253
2254    *-f*
2255        Do not prompt for confirmation before overwriting the destination path.
2256
2257    *-i*
2258        Causes mv to write a prompt to standard error before moving a file that
2259        would overwrite an existing file.  If the response from the standard
2260        input begins with the character 'y', the move is attempted.
2261
2262    *-v*
2263        Cause mv to be verbose, showing files as they are processed.
2264
2265    The last of any -f or -i options is the one which affects mv's behavior.
2266
2267    It is an error for any of the source operands to specify a nonexistent file
2268    or directory.
2269
2270    It is an error for the source operand to specify a directory if the target
2271    exists and is not a directory.
2272
2273    If the destination path does not have a mode which permits writing, mv
2274    prompts the user for confirmation as specified for the -i option.
2275
2276    Should the *rename* call fail because source and target are on different
2277    file systems, ``mv`` will remove the destination file, copy the source file
2278    to the destination, and then remove the source.  The effect is roughly
2279    equivalent to:
2280
2281    .. code-block:: shell
2282
2283        rm -f destination_path && \
2284        cp -PRp source_file destination_path && \
2285        rm -rf source_file
2286
2287EXIT STATUS:
2288    The ``mv`` utility exits 0 on success, and >0 if an error occurs.
2289
2290NOTES:
2291    None.
2292
2293EXAMPLES:
2294    .. code-block:: shell
2295
2296        SHLL [/] mv /dev/console /dev/con1
2297
2298.. index:: CONFIGURE_SHELL_NO_COMMAND_MV
2299.. index:: CONFIGURE_SHELL_COMMAND_MV
2300
2301CONFIGURATION:
2302    This command is included in the default shell command set.  When building a
2303    custom command set, define ``CONFIGURE_SHELL_COMMAND_MV`` to have this
2304    command included.
2305
2306    This command can be excluded from the shell command set by defining
2307    ``CONFIGURE_SHELL_NO_COMMAND_MV`` when all shell commands have been
2308    configured.
2309
2310.. index:: rtems_shell_main_mv
2311
2312PROGRAMMING INFORMATION:
2313    The ``mv`` command is implemented by a C language function which has the
2314    following prototype:
2315
2316    .. code-block:: c
2317
2318        int rtems_shell_main_mv(
2319            int    argc,
2320            char **argv
2321        );
2322
2323    The configuration structure for the ``mv`` has the following prototype:
2324
2325    .. code-block:: c
2326
2327        extern rtems_shell_cmd_t rtems_shell_MV_Command;
2328
2329ORIGIN:
2330    The implementation and portions of the documentation for this command are
2331    from NetBSD 4.0.
2332
2333.. raw:: latex
2334
2335   \clearpage
2336
2337.. _pwd:
2338
2339pwd - print work directory
2340--------------------------
2341.. index:: pwd
2342
2343SYNOPSYS:
2344    .. code-block:: shell
2345
2346        pwd
2347
2348DESCRIPTION:
2349    This command prints the fully qualified filename of the current working
2350    directory.
2351
2352EXIT STATUS:
2353    This command returns 0 on success and non-zero if an error is encountered.
2354
2355NOTES:
2356    None.
2357
2358EXAMPLES:
2359    The following is an example of how to use ``pwd``:
2360
2361    .. code-block:: shell
2362
2363        SHLL [/] $ pwd
2364        /
2365        SHLL [/] $ cd dev
2366        SHLL [/dev] $ pwd
2367        /dev
2368
2369.. index:: CONFIGURE_SHELL_NO_COMMAND_PWD
2370.. index:: CONFIGURE_SHELL_COMMAND_PWD
2371
2372CONFIGURATION:
2373    This command is included in the default shell command set.  When building a
2374    custom command set, define ``CONFIGURE_SHELL_COMMAND_PWD`` to have this
2375    command included.
2376
2377    This command can be excluded from the shell command set by defining
2378    ``CONFIGURE_SHELL_NO_COMMAND_PWD`` when all shell commands have been
2379    configured.
2380
2381.. index:: rtems_shell_rtems_main_pwd
2382
2383PROGRAMMING INFORMATION:
2384    The ``pwd`` is implemented by a C language function which has the following
2385    prototype:
2386
2387    .. code-block:: c
2388
2389        int rtems_shell_rtems_main_pwd(
2390            int    argc,
2391            char argv
2392        );
2393
2394    The configuration structure for the ``pwd`` has the following prototype:
2395
2396    .. code-block:: c
2397
2398    extern rtems_shell_cmd_t rtems_shell_PWD_Command;
2399
2400.. raw:: latex
2401
2402   \clearpage
2403
2404.. _rmdir:
2405
2406rmdir - remove empty directories
2407--------------------------------
2408.. index:: rmdir
2409
2410SYNOPSYS:
2411    .. code-block:: shell
2412
2413        rmdir  [dir1 .. dirN]
2414
2415DESCRIPTION:
2416    This command removes the specified set of directories.  If no directories
2417    are provided on the command line, no actions are taken.
2418
2419EXIT STATUS:
2420    This command returns 0 on success and non-zero if an error is encountered.
2421
2422NOTES:
2423    This command is a implemented using the ``rmdir(2)`` system call and all
2424    reasons that call may fail apply to this command.
2425
2426EXAMPLES:
2427    The following is an example of how to use ``rmdir``:
2428
2429    .. code-block:: shell
2430
2431        SHLL [/] # mkdir joeldir
2432        SHLL [/] # rmdir joeldir
2433        SHLL [/] # ls joeldir
2434        joeldir: No such file or directory.
2435
2436.. index:: CONFIGURE_SHELL_NO_COMMAND_RMDIR
2437.. index:: CONFIGURE_SHELL_COMMAND_RMDIR
2438
2439CONFIGURATION:
2440    This command is included in the default shell command set.  When building a
2441    custom command set, define ``CONFIGURE_SHELL_COMMAND_RMDIR`` to have this
2442    command included.
2443
2444    This command can be excluded from the shell command set by defining
2445    ``CONFIGURE_SHELL_NO_COMMAND_RMDIR`` when all shell commands have been
2446    configured.
2447
2448.. index:: rtems_shell_rtems_main_rmdir
2449
2450PROGRAMMING INFORMATION:
2451    The ``rmdir`` is implemented by a C language function which has the
2452    following prototype:
2453
2454    .. code-block:: c
2455
2456        int rtems_shell_rtems_main_rmdir(
2457            int    argc,
2458            char **argv
2459        );
2460
2461    The configuration structure for the ``rmdir`` has the following prototype:
2462
2463    .. code-block:: c
2464
2465        extern rtems_shell_cmd_t rtems_shell_RMDIR_Command;
2466
2467.. raw:: latex
2468
2469   \clearpage
2470
2471.. _rm:
2472
2473rm - remove files
2474-----------------
2475.. index:: rm
2476
2477SYNOPSYS:
2478    .. code-block:: shell
2479
2480        rm file1 [file2 ... fileN]
2481
2482DESCRIPTION:
2483    This command deletes a name from the filesystem.  If the specified file
2484    name was the last link to a file and there are no ``open`` file descriptor
2485    references to that file, then it is deleted and the associated space in the
2486    file system is made available for subsequent use.
2487
2488    If the filename specified was the last link to a file but there are open
2489    file descriptor references to it, then the file will remain in existence
2490    until the last file descriptor referencing it is closed.
2491
2492EXIT STATUS:
2493    This command returns 0 on success and non-zero if an error is encountered.
2494
2495NOTES:
2496    None.
2497
2498EXAMPLES:
2499    The following is an example of how to use ``rm``:
2500
2501    .. code-block:: shell
2502
2503        SHLL [/] # cp /etc/passwd tmpfile
2504        SHLL [/] # cat tmpfile
2505        root:*:0:0:root::/:/bin/sh
2506        rtems:*:1:1:RTEMS Application::/:/bin/sh
2507        tty:!:2:2:tty owner::/:/bin/false
2508        SHLL [/] # rm tmpfile
2509        SHLL [/] # cat tmpfile
2510        cat: tmpfile: No such file or directory
2511
2512.. index:: CONFIGURE_SHELL_NO_COMMAND_RM
2513.. index:: CONFIGURE_SHELL_COMMAND_RM
2514
2515CONFIGURATION:
2516    This command is included in the default shell command set.  When building a
2517    custom command set, define ``CONFIGURE_SHELL_COMMAND_RM`` to have this
2518    command included.
2519
2520    This command can be excluded from the shell command set by defining
2521    ``CONFIGURE_SHELL_NO_COMMAND_RM`` when all shell commands have been
2522    configured.
2523
2524.. index:: rtems_shell_main_rm
2525
2526PROGRAMMING INFORMATION:
2527    The ``rm`` is implemented by a C language function which has the following
2528    prototype:
2529
2530    .. code-block:: c
2531
2532        int rtems_shell_main_rm(
2533            int    argc,
2534            char **argv
2535        );
2536
2537    The configuration structure for the ``rm`` has the
2538    following prototype:
2539    .. code-block:: c
2540
2541        extern rtems_shell_cmd_t rtems_shell_RM_Command;
2542
2543.. raw:: latex
2544
2545   \clearpage
2546
2547.. _umask:
2548
2549umask - set file mode creation mask
2550-----------------------------------
2551.. index:: umask
2552
2553SYNOPSYS:
2554    .. code-block:: shell
2555
2556        umask [new_umask]
2557
2558DESCRIPTION:
2559    This command sets the user file creation mask to ``new_umask``.  The
2560    argument ``new_umask`` may be octal, hexadecimal, or decimal.
2561
2562EXIT STATUS:
2563    This command returns 0 on success and non-zero if an error is encountered.
2564
2565NOTES:
2566    This command does not currently support symbolic mode masks.
2567
2568EXAMPLES:
2569    The following is an example of how to use ``umask``:
2570
2571    .. code-block:: shell
2572
2573        SHLL [/] $ umask
2574        022
2575        SHLL [/] $ umask 0666
2576        0666
2577        SHLL [/] $ umask
2578        0666
2579
2580.. index:: CONFIGURE_SHELL_NO_COMMAND_UMASK
2581.. index:: CONFIGURE_SHELL_COMMAND_UMASK
2582
2583CONFIGURATION:
2584    This command is included in the default shell command set.  When building a
2585    custom command set, define ``CONFIGURE_SHELL_COMMAND_UMASK`` to have this
2586    command included.
2587
2588    This command can be excluded from the shell command set by defining
2589    ``CONFIGURE_SHELL_NO_COMMAND_UMASK`` when all shell commands have been
2590    configured.
2591
2592.. index:: rtems_shell_rtems_main_umask
2593
2594PROGRAMMING INFORMATION:
2595    The ``umask`` is implemented by a C language function which has the
2596    following prototype:
2597
2598    .. code-block:: c
2599
2600        int rtems_shell_rtems_main_umask(
2601            int    argc,
2602            char **argv
2603        );
2604
2605    The configuration structure for the ``umask`` has the following prototype:
2606
2607    .. code-block:: c
2608
2609        extern rtems_shell_cmd_t rtems_shell_UMASK_Command;
2610
2611.. raw:: latex
2612
2613   \clearpage
2614
2615.. _unmount:
2616
2617unmount - unmount disk
2618----------------------
2619.. index:: unmount
2620
2621SYNOPSYS:
2622    .. code-block:: shell
2623
2624        unmount path
2625
2626DESCRIPTION:
2627    This command unmounts the device at the specified ``path``.
2628
2629EXIT STATUS:
2630    This command returns 0 on success and non-zero if an error is encountered.
2631
2632NOTES:
2633    TBD - Surely there must be some warnings to go here.
2634
2635EXAMPLES:
2636    The following is an example of how to use ``unmount``:
2637
2638    .. code-block:: shell
2639
2640        # unmount /mnt
2641
2642.. index:: CONFIGURE_SHELL_NO_COMMAND_UNMOUNT
2643.. index:: CONFIGURE_SHELL_COMMAND_UNMOUNT
2644
2645CONFIGURATION:
2646    This command is included in the default shell command set.  When building a
2647    custom command set, define ``CONFIGURE_SHELL_COMMAND_UNMOUNT`` to have this
2648    command included.
2649
2650    This command can be excluded from the shell command set by defining
2651    ``CONFIGURE_SHELL_NO_COMMAND_UNMOUNT`` when all shell commands have been
2652    configured.
2653
2654.. index:: rtems_shell_rtems_main_unmount
2655
2656PROGRAMMING INFORMATION:
2657    The ``unmount`` is implemented by a C language function which has the
2658    following prototype:
2659
2660    .. code-block:: c
2661
2662        int rtems_shell_rtems_main_unmount(
2663            int    argc,
2664            char **argv
2665        );
2666
2667    The configuration structure for the ``unmount`` has the following prototype:
2668
2669    .. code-block:: c
2670
2671        extern rtems_shell_cmd_t rtems_shell_UNMOUNT_Command;
Note: See TracBrowser for help on using the repository browser.