source: rtems-docs/shell/file_and_directory.rst @ df77336

4.115am
Last change on this file since df77336 was df77336, checked in by Chris Johns <chrisj@…>, on 01/22/16 at 23:14:42

Add links from the command list to the commands.

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