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

4.115
Last change on this file since e5afcaa was e5afcaa, checked in by Chris Johns <chrisj@…>, on 01/23/16 at 03:24:32

Add OAR copyright to each file.

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