source: rtems-docs/shell/file_and_directory.rst @ 489740f

4.115
Last change on this file since 489740f was 489740f, checked in by Chris Johns <chrisj@…>, on 05/20/16 at 02:47:09

Set SPDX License Identifier in each source file.

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