source: rtems-docs/shell/file_and_directory.rst @ 36def91

4.115
Last change on this file since 36def91 was 36def91, checked in by Joel Sherrill <joel@…>, on 10/28/16 at 00:47:07

rtems-docs: Fix many unnecessary back slashes

  • Property mode set to 100644
File size: 73.3 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
1094.. code:: c
1095
1096    SHLL [/] $ df -B 4K
1097    Filesystem     4K-blocks        Used   Available       Use%     Mounted on
1098    /dev/rda               124         1         124         0%   /mnt/ramdisk
1099    SHLL [/] $ df
1100    Filesystem     1K-blocks        Used   Available       Use%     Mounted on
1101    /dev/rda               495         1         494         0%   /mnt/ramdisk
1102    SHLL [/] $ df -h
1103    Filesystem     Size             Used   Available       Use%     Mounted on
1104    /dev/rda              495K        1K        494K         0%   /mnt/ramdisk
1105
1106**CONFIGURATION:**
1107
1108.. index:: CONFIGURE_SHELL_NO_COMMAND_DF
1109.. index:: CONFIGURE_SHELL_COMMAND_DF
1110
1111This command is included in the default shell command set.  When building a
1112custom command set, define ``CONFIGURE_SHELL_COMMAND_DF`` to have this command
1113included.
1114
1115This command can be excluded from the shell command set by defining
1116``CONFIGURE_SHELL_NO_COMMAND_DF`` when all shell commands have been configured.
1117
1118**PROGRAMMING INFORMATION:**
1119
1120.. index:: rtems_shell_rtems_main_df
1121
1122The ``df`` is implemented by a C language function which has the following
1123prototype:
1124
1125.. code:: c
1126
1127    int rtems_shell_main_df(
1128        int    argc,
1129        char **argv
1130    );
1131
1132The configuration structure for the ``df`` has the following prototype:
1133
1134.. code:: c
1135
1136    extern rtems_shell_cmd_t rtems_shell_DF_Command;
1137
1138.. _dir:
1139
1140dir - alias for ls
1141------------------
1142.. index:: dir
1143
1144**SYNOPSYS:**
1145
1146.. code:: shell
1147
1148    dir [dir]
1149
1150**DESCRIPTION:**
1151
1152This command is an alias or alternate name for the ``ls``.  See `ls - list
1153files in the directory` for more information.
1154
1155**EXIT STATUS:**
1156
1157This command returns 0 on success and non-zero if an error is encountered.
1158
1159**NOTES:**
1160
1161NONE
1162
1163**EXAMPLES:**
1164
1165The following is an example of how to use ``dir``:
1166
1167.. code:: shell
1168
1169    SHLL [/] $ dir
1170    drwxr-xr-x   1   root   root         536 Jan 01 00:00 dev/
1171    drwxr-xr-x   1   root   root        1072 Jan 01 00:00 etc/
1172    2 files 1608 bytes occupied
1173    SHLL [/] $ dir etc
1174    -rw-r--r--   1   root   root         102 Jan 01 00:00 passwd
1175    -rw-r--r--   1   root   root          42 Jan 01 00:00 group
1176    -rw-r--r--   1   root   root          30 Jan 01 00:00 issue
1177    -rw-r--r--   1   root   root          28 Jan 01 00:00 issue.net
1178    4 files 202 bytes occupied
1179
1180**CONFIGURATION:**
1181
1182.. index:: CONFIGURE_SHELL_NO_COMMAND_DIR
1183.. index:: CONFIGURE_SHELL_COMMAND_DIR
1184
1185This command is included in the default shell command set.
1186When building a custom command set, define``CONFIGURE_SHELL_COMMAND_DIR`` to have this
1187command included.
1188
1189This command can be excluded from the shell command set by defining
1190``CONFIGURE_SHELL_NO_COMMAND_DIR`` when all shell commands have been
1191configured.
1192
1193**PROGRAMMING INFORMATION:**
1194
1195.. index:: rtems_shell_rtems_main_dir
1196
1197The ``dir`` is implemented by a C language function
1198which has the following prototype:
1199
1200.. code:: c
1201
1202    int rtems_shell_rtems_main_dir(
1203        int    argc,
1204        char **argv
1205    );
1206
1207The configuration structure for the ``dir`` has the following prototype:
1208
1209.. code:: c
1210
1211    extern rtems_shell_cmd_t rtems_shell_DIR_Command;
1212
1213.. _fdisk:
1214
1215fdisk - format disk
1216-------------------
1217.. index:: fdisk
1218
1219**SYNOPSYS:**
1220
1221.. code:: shell
1222
1223    fdisk
1224
1225**CONFIGURATION:**
1226
1227.. index:: CONFIGURE_SHELL_NO_COMMAND_FDISK
1228.. index:: CONFIGURE_SHELL_COMMAND_FDISK
1229
1230This command is included in the default shell command set.  When building a
1231custom command set, define ``CONFIGURE_SHELL_COMMAND_FDISK`` to have this
1232command included.
1233
1234This command can be excluded from the shell command set by defining
1235``CONFIGURE_SHELL_NO_COMMAND_FDISK`` when all shell commands have been
1236configured.
1237
1238.. _hexdump:
1239
1240hexdump - ascii/dec/hex/octal dump
1241----------------------------------
1242.. index:: hexdump
1243
1244**SYNOPSYS:**
1245
1246.. code:: shell
1247
1248    hexdump [-bcCdovx] [-e format_string] [-f format_file] [-n length] [-s skip] file ...
1249
1250**DESCRIPTION:**
1251
1252The hexdump utility is a filter which displays the specified files, or the
1253standard input, if no files are specified, in a user specified format.
1254
1255The options are as follows:
1256
1257*-b*
1258    One-byte octal display.  Display the input offset in hexadecimal, followed
1259    by sixteen space-separated, three column, zero-filled, bytes of input data,
1260    in octal, per line.
1261
1262*-c*
1263    One-byte character display.  Display the input offset in hexadecimal,
1264    followed by sixteen space-separated, three column, space-filled, characters
1265    of input data per line.
1266
1267*-C*
1268    Canonical hex+ASCII display.  Display the input offset in hexadecimal,
1269    followed by sixteen space-separated, two column, hexadecimal bytes,
1270    followed by the same sixteen bytes in %_p format enclosed in "|"
1271    characters.
1272
1273*-d*
1274    Two-byte decimal display.  Display the input offset in hexadecimal,
1275    followed by eight space-separated, five column, zero-filled, two-byte units
1276    of input data, in unsigned decimal, per line.
1277
1278*-e format_string*
1279    Specify a format string to be used for displaying data.
1280
1281*-f format_file*
1282    Specify a file that contains one or more newline separated format strings.
1283    Empty lines and lines whose first non-blank character is a hash mark (#)
1284    are ignored.
1285
1286*-n length*
1287    Interpret only length bytes of input.
1288
1289*-o*
1290    Two-byte octal display.  Display the input offset in hexadecimal, followed
1291    by eight space-separated, six column, zerofilled, two byte quantities of
1292    input data, in octal, per line.
1293
1294*-s offset*
1295    Skip offset bytes from the beginning of the input.  By default, offset is
1296    interpreted as a decimal number.  With a leading 0x or 0X, offset is
1297    interpreted as a hexadecimal number, otherwise, with a leading 0, offset is
1298    interpreted as an octal number.  Appending the character b, k, or m to
1299    offset causes it to be interpreted as a multiple of 512, 1024, or 1048576,
1300    respectively.
1301
1302*-v*
1303    The -v option causes hexdump to display all input data.  Without the -v
1304    option, any number of groups of output lines, which would be identical to
1305    the immediately preceding group of output lines (except for the input
1306    offsets), are replaced with a line containing a single asterisk.
1307
1308*-x*
1309    Two-byte hexadecimal display.  Display the input offset in hexadecimal,
1310    followed by eight, space separated, four column, zero-filled, two-byte
1311    quantities of input data, in hexadecimal, per line.
1312
1313For each input file, hexdump sequentially copies the input to standard output,
1314transforming the data according to the format strings specified by the -e and
1315-f options, in the order that they were specified.
1316
1317*Formats*
1318
1319A format string contains any number of format units, separated by whitespace.
1320A format unit contains up to three items: an iteration count, a byte count, and
1321a format.
1322
1323The iteration count is an optional positive integer, which defaults to one.
1324Each format is applied iteration count times.
1325
1326The byte count is an optional positive integer.  If specified it defines the
1327number of bytes to be interpreted by each iteration of the format.
1328
1329If an iteration count and/or a byte count is specified, a single slash must be
1330placed after the iteration count and/or before the byte count to disambiguate
1331them.  Any whitespace before or after the slash is ignored.
1332
1333The format is required and must be surrounded by double quote (" ") marks.  It
1334is interpreted as a fprintf-style format string (see*fprintf*), with the
1335following exceptions:
1336
1337- An asterisk (*) may not be used as a field width or precision.
1338
1339- A byte count or field precision is required for each "s" con- version
1340  character (unlike the fprintf(3) default which prints the entire string if
1341  the precision is unspecified).
1342
1343- The conversion characters "h", "l", "n", "p" and "q" are not supported.
1344
1345- The single character escape sequences described in the C standard are
1346  supported:
1347
1348      NUL                  \0
1349      <alert character>    \a
1350      <backspace>          \b
1351      <form-feed>          \f
1352      <newline>            \n
1353      <carriage return>    \r
1354      <tab>                \t
1355      <vertical tab>       \v
1356
1357Hexdump also supports the following additional conversion strings:
1358
1359*_a[dox]*
1360    Display the input offset, cumulative across input files, of the next byte
1361    to be displayed.  The appended characters d, o, and x specify the display
1362    base as decimal, octal or hexadecimal respectively.
1363
1364*_A[dox]*
1365    Identical to the _a conversion string except that it is only performed
1366    once, when all of the input data has been processed.
1367
1368*_c*
1369    Output characters in the default character set.  Nonprinting characters are
1370    displayed in three character, zero-padded octal, except for those
1371    representable by standard escape notation (see above), which are displayed
1372    as two character strings.
1373
1374*_p*
1375    Output characters in the default character set.  Nonprinting characters are
1376    displayed as a single ".".
1377
1378*_u*
1379    Output US ASCII characters, with the exception that control characters are
1380    displayed using the following, lower-case, names.  Characters greater than
1381    0xff, hexadecimal, are displayed as hexadecimal strings.
1382
1383    +-----------+-----------+-----------+-----------+-----------+-----------+
1384    |``000`` nul|``001`` soh|``002`` stx|``003`` etx|``004`` eot|``005`` enq|
1385    +-----------+-----------+-----------+-----------+-----------+-----------+
1386    |``006`` ack|``007`` bel|``008`` bs |``009`` ht |``00A`` lf |``00B`` vt |
1387    +-----------+-----------+-----------+-----------+-----------+-----------+
1388    |``00C`` ff |``00D`` cr |``00E`` so |``00F`` si |``010`` dle|``011`` dc1|
1389    +-----------+-----------+-----------+-----------+-----------+-----------+
1390    |``012`` dc2|``013`` dc3|``014`` dc4|``015`` nak|``016`` syn|``017`` etb|
1391    +-----------+-----------+-----------+-----------+-----------+-----------+
1392    |``018`` can|``019`` em |``01A`` sub|``01B`` esc|``01C`` fs |``01D`` gs |
1393    +-----------+-----------+-----------+-----------+-----------+-----------+
1394    |``01E`` rs |``01F`` us |``07F`` del|           |           |           |
1395    +-----------+-----------+-----------+-----------+-----------+-----------+
1396
1397The default and supported byte counts for the conversion characters
1398are as follows:
1399
1400    +----------------------+---------------------------------+
1401    |%_c, %_p, %_u, %c     |One byte counts only.            |
1402    +----------------------+---------------------------------+
1403    |%d, %i, %o, %u, %X, %x|Four byte default, one, two, four|
1404    |                      |and eight byte counts supported. |
1405    +----------------------+---------------------------------+
1406    |%E, %e, %f, %G, %g    |Eight byte default, four byte    |
1407    |                      |counts supported.                |
1408    +----------------------+---------------------------------+
1409
1410The amount of data interpreted by each format string is the sum of the data
1411required by each format unit, which is the iteration count times the byte
1412count, or the iteration count times the number of bytes required by the format
1413if the byte count is not specified.
1414
1415The input is manipulated in "blocks", where a block is defined as the largest
1416amount of data specified by any format string.  Format strings interpreting
1417less than an input block's worth of data, whose last format unit both
1418interprets some number of bytes and does not have a specified iteration count,
1419have the iteration count incremented until the entire input block has been
1420processed or there is not enough data remaining in the block to satisfy the
1421format string.
1422
1423If, either as a result of user specification or hexdump modifying the iteration
1424count as described above, an iteration count is greater than one, no trailing
1425whitespace characters are output during the last iteration.
1426
1427It is an error to specify a byte count as well as multiple conversion
1428characters or strings unless all but one of the conversion characters or
1429strings is _a or _A.
1430
1431If, as a result of the specification of the -n option or end-of-file being
1432reached, input data only partially satisfies a format string, the input block
1433is zero-padded sufficiently to display all available data (i.e. any format
1434units overlapping the end of data will display some num- ber of the zero
1435bytes).
1436
1437Further output by such format strings is replaced by an equivalent number of
1438spaces.  An equivalent number of spaces is defined as the number of spaces
1439output by an s conversion character with the same field width and precision as
1440the original conversion character or conversion string but with any "+", " ",
1441"#" conversion flag characters removed, and ref- erencing a NULL string.
1442
1443If no format strings are specified, the default display is equivalent to
1444specifying the -x option.
1445
1446**EXIT STATUS:**
1447
1448This command returns 0 on success and non-zero if an error is encountered.
1449
1450**NOTES:**
1451
1452NONE
1453
1454**EXAMPLES:**
1455
1456The following is an example of how to use ``hexdump``:
1457
1458.. code:: shell
1459
1460    SHLL [/] $ hexdump -C -n 512 /dev/hda1
1461
1462**CONFIGURATION:**
1463
1464.. index:: CONFIGURE_SHELL_NO_COMMAND_HEXDUMP
1465.. index:: CONFIGURE_SHELL_COMMAND_HEXDUMP
1466
1467This command is included in the default shell command set.  When building a
1468custom command set, define ``CONFIGURE_SHELL_COMMAND_HEXDUMP`` to have this
1469command included.
1470
1471This command can be excluded from the shell command set by
1472defining``CONFIGURE_SHELL_NO_COMMAND_HEXDUMP`` when all shell commands have
1473been configured.
1474
1475**PROGRAMMING INFORMATION:**
1476
1477.. index:: rtems_shell_rtems_main_hexdump
1478
1479The ``hexdump`` command is implemented by a C language function which has the
1480following prototype:
1481
1482.. code:: c
1483
1484    int rtems_shell_rtems_main_hexdump(
1485        int    argc,
1486        char **argv
1487    );
1488
1489The configuration structure for the ``hexdump`` has the following prototype:
1490
1491.. code:: c
1492
1493    extern rtems_shell_cmd_t rtems_shell_HEXDUMP_Command;
1494
1495.. _ln:
1496
1497ln - make links
1498---------------
1499.. index:: ln
1500
1501**SYNOPSYS:**
1502
1503.. code:: c
1504
1505    ln [-fhinsv] source_file [target_file]
1506    ln [-fhinsv] source_file ... target_dir
1507
1508**DESCRIPTION:**
1509
1510The ln utility creates a new directory entry (linked file) which has the same
1511modes as the original file.  It is useful for maintaining multiple copies of a
1512file in many places at once without using up storage for the "copies"; instead,
1513a link "points" to the original copy.  There are two types of links; hard links
1514and symbolic links.  How a link "points" to a file is one of the differences
1515between a hard or symbolic link.
1516
1517The options are as follows:
1518
1519*-f*
1520    Unlink any already existing file, permitting the link to occur.
1521
1522*-h*
1523    If the target_file or target_dir is a symbolic link, do not follow it.
1524    This is most useful with the -f option, to replace a symlink which may
1525    point to a directory.
1526
1527*-i*
1528    Cause ln to write a prompt to standard error if the target file exists.  If
1529    the response from the standard input begins with the character 'y' or 'Y',
1530    then unlink the target file so that the link may occur.  Otherwise, do not
1531    attempt the link.  (The -i option overrides any previous -f options.)
1532
1533*-n*
1534    Same as -h, for compatibility with other ln implementations.
1535
1536*-s*
1537    Create a symbolic link.
1538
1539*-v*
1540    Cause ln to be verbose, showing files as they are processed.
1541
1542By default ln makes hard links.  A hard link to a file is indistinguishable
1543from the original directory entry; any changes to a file are effective
1544independent of the name used to reference the file.  Hard links may not
1545normally refer to directories and may not span file systems.
1546
1547A symbolic link contains the name of the file to which it is linked.  The
1548referenced file is used when an *open* operation is performed on the link.  A
1549*stat* on a symbolic link will return the linked-to file; an *lstat* must be
1550done to obtain information about the link.  The *readlink* call may be used to
1551read the contents of a symbolic link.  Symbolic links may span file systems and
1552may refer to directories.
1553
1554Given one or two arguments, ln creates a link to an existing file source_file.
1555If target_file is given, the link has that name; target_file may also be a
1556directory in which to place the link; otherwise it is placed in the current
1557directory.  If only the directory is specified, the link will be made to the
1558last component of source_file.
1559
1560Given more than two arguments, ln makes links in target_dir to all the named
1561source files.  The links made will have the same name as the files being linked
1562to.
1563
1564**EXIT STATUS:**
1565
1566The ``ln`` utility exits 0 on success, and >0 if an error occurs.
1567
1568**NOTES:**
1569
1570None.
1571
1572**EXAMPLES:**
1573
1574.. code:: shell
1575
1576    SHLL [/] ln -s /dev/console /dev/con1
1577
1578**CONFIGURATION:**
1579
1580.. index:: CONFIGURE_SHELL_NO_COMMAND_LN
1581.. index:: CONFIGURE_SHELL_COMMAND_LN
1582
1583This command is included in the default shell command set.  When building a
1584custom command set, define ``CONFIGURE_SHELL_COMMAND_LN`` to have this command
1585included.
1586
1587This command can be excluded from the shell command set by defining
1588``CONFIGURE_SHELL_NO_COMMAND_LN`` when all shell commands have been configured.
1589
1590**PROGRAMMING INFORMATION:**
1591
1592.. index:: rtems_shell_rtems_main_ln
1593
1594The ``ln`` command is implemented by a C language function which has the
1595following prototype:
1596
1597.. code:: c
1598
1599    int rtems_shell_rtems_main_ln(
1600        int    argc,
1601        char **argv
1602    );
1603
1604The configuration structure for the ``ln`` has the following prototype:
1605
1606.. code:: c
1607
1608    extern rtems_shell_cmd_t rtems_shell_LN_Command;
1609
1610**ORIGIN:**
1611
1612The implementation and portions of the documentation for this command are from
1613NetBSD 4.0.
1614
1615.. _ls:
1616
1617ls - list files in the directory
1618--------------------------------
1619.. index:: ls
1620
1621**SYNOPSYS:**
1622
1623.. code:: shell
1624
1625    ls [dir]
1626
1627**DESCRIPTION:**
1628
1629This command displays the contents of the specified directory.  If no arguments
1630are given, then it displays the contents of the current working directory.
1631
1632**EXIT STATUS:**
1633
1634This command returns 0 on success and non-zero if an error is encountered.
1635
1636**NOTES:**
1637
1638This command currently does not display information on a set of files like the
1639POSIX ls(1).  It only displays the contents of entire directories.
1640
1641**EXAMPLES:**
1642
1643The following is an example of how to use ``ls``:
1644
1645.. code:: shell
1646
1647    SHLL [/] $ ls
1648    drwxr-xr-x   1   root   root         536 Jan 01 00:00 dev/
1649    drwxr-xr-x   1   root   root        1072 Jan 01 00:00 etc/
1650    2 files 1608 bytes occupied
1651    SHLL [/] $ ls etc
1652    -rw-r--r--   1   root   root         102 Jan 01 00:00 passwd
1653    -rw-r--r--   1   root   root          42 Jan 01 00:00 group
1654    -rw-r--r--   1   root   root          30 Jan 01 00:00 issue
1655    -rw-r--r--   1   root   root          28 Jan 01 00:00 issue.net
1656    4 files 202 bytes occupied
1657    SHLL [/] $ ls dev etc
1658    -rwxr-xr-x   1  rtems   root           0 Jan 01 00:00 console
1659    -rwxr-xr-x   1   root   root           0 Jan 01 00:00 console_b
1660
1661**CONFIGURATION:**
1662
1663.. index:: CONFIGURE_SHELL_NO_COMMAND_LS
1664.. index:: CONFIGURE_SHELL_COMMAND_LS
1665
1666This command is included in the default shell command set.  When building a
1667custom command set, define ``CONFIGURE_SHELL_COMMAND_LS`` to have this command
1668included.
1669
1670This command can be excluded from the shell command set by defining
1671``CONFIGURE_SHELL_NO_COMMAND_LS`` when all shell commands have been configured.
1672
1673**PROGRAMMING INFORMATION:**
1674
1675.. index:: rtems_shell_rtems_main_ls
1676
1677The ``ls`` is implemented by a C language function which has the following
1678prototype:
1679
1680.. code:: c
1681
1682    int rtems_shell_rtems_main_ls(
1683        int    argc,
1684        char **argv
1685    );
1686
1687The configuration structure for the ``ls`` has the following prototype:
1688
1689.. code:: c
1690
1691    extern rtems_shell_cmd_t rtems_shell_LS_Command;
1692
1693.. _md5:
1694
1695md5 - compute the Md5 hash of a file or list of files
1696-----------------------------------------------------
1697.. index:: md5
1698
1699**SYNOPSYS:**
1700
1701.. code:: shell
1702
1703    md5 <files>
1704
1705**DESCRIPTION:**
1706
1707This command prints the MD5 of a file. You can provide one or more files on the
1708command line and a hash for each file is printed in a single line of output.
1709
1710**EXIT STATUS:**
1711
1712This command returns 0 on success and non-zero if an error is encountered.
1713
1714**NOTES:**
1715
1716None.
1717
1718**EXAMPLES:**
1719
1720The following is an example of how to use ``md5``:
1721
1722.. code:: shell
1723
1724    SHLL [/] $ md5 shell-init
1725    MD5 (shell-init) = 43b4d2e71b47db79eae679a2efeacf31
1726
1727**CONFIGURATION:**
1728
1729.. index:: CONFIGURE_SHELL_NO_COMMAND_MD5
1730.. index:: CONFIGURE_SHELL_COMMAND_MD5
1731
1732This command is included in the default shell command set.  When building a
1733custom command set, define``CONFIGURE_SHELL_COMMAND_MD5`` to have this command
1734included.
1735
1736This command can be excluded from the shell command set by defining
1737``CONFIGURE_SHELL_NO_COMMAND_MD5`` when all shell commands have been
1738configured.
1739
1740**PROGRAMMING INFORMATION:**
1741
1742.. index:: rtems_shell_rtems_main_md5
1743
1744The ``md5`` is implemented by a C language function which has the following
1745prototype:
1746
1747.. code:: c
1748
1749    int rtems_shell_main_md5(
1750        int    argc,
1751        char **argv
1752    );
1753
1754The configuration structure for the ``md5`` has the following prototype:
1755
1756.. code:: c
1757
1758    extern rtems_shell_cmd_t rtems_shell_MD5_Command;
1759
1760.. _mkdir:
1761
1762mkdir - create a directory
1763--------------------------
1764.. index:: mkdir
1765
1766**SYNOPSYS:**
1767
1768.. code:: c
1769
1770    mkdir  dir [dir1 .. dirN]
1771
1772**DESCRIPTION:**
1773
1774This command creates the set of directories in the order they are specified on
1775the command line.  If an error is encountered making one of the directories,
1776the command will continue to attempt to create the remaining directories on the
1777command line.
1778
1779**EXIT STATUS:**
1780
1781This command returns 0 on success and non-zero if an error is encountered.
1782
1783**NOTES:**
1784
1785If this command is invoked with no arguments, nothing occurs.
1786
1787The user must have sufficient permissions to create the directory.  For the
1788``fileio`` test provided with RTEMS, this means the user must login as ``root``
1789not ``rtems``.
1790
1791**EXAMPLES:**
1792
1793The following is an example of how to use ``mkdir``:
1794
1795.. code:: shell
1796
1797    SHLL [/] # ls
1798    drwxr-xr-x   1   root   root         536 Jan 01 00:00 dev/
1799    drwxr-xr-x   1   root   root        1072 Jan 01 00:00 etc/
1800    2 files 1608 bytes occupied
1801    SHLL [/] # mkdir joel
1802    SHLL [/] # ls joel
1803    0 files 0 bytes occupied
1804    SHLL [/] # cp etc/passwd joel
1805    SHLL [/] # ls joel
1806    -rw-r--r--   1   root   root         102 Jan 01 00:02 passwd
1807    1 files 102 bytes occupied
1808
1809**CONFIGURATION:**
1810
1811.. index:: CONFIGURE_SHELL_NO_COMMAND_MKDIR
1812.. index:: CONFIGURE_SHELL_COMMAND_MKDIR
1813
1814This command is included in the default shell command set.  When building a
1815custom command set, define ``CONFIGURE_SHELL_COMMAND_MKDIR`` to have this
1816command included.
1817
1818This command can be excluded from the shell command set by defining
1819``CONFIGURE_SHELL_NO_COMMAND_MKDIR`` when all shell commands have been
1820configured.
1821
1822**PROGRAMMING INFORMATION:**
1823
1824.. index:: rtems_shell_rtems_main_mkdir
1825
1826The ``mkdir`` is implemented by a C language function which has the following
1827prototype:
1828
1829.. code:: c
1830
1831    int rtems_shell_rtems_main_mkdir(
1832        int    argc,
1833        char **argv
1834    );
1835
1836The configuration structure for the ``mkdir`` has the following prototype:
1837
1838.. code:: c
1839
1840    extern rtems_shell_cmd_t rtems_shell_MKDIR_Command;
1841
1842.. _mkdos:
1843
1844mkdos - DOSFS file system format
1845--------------------------------
1846.. index:: mkdos
1847
1848**SYNOPSYS:**
1849
1850.. code:: shell
1851
1852    mkdos [-V label] [-s sectors/cluster] [-r size] [-v] path
1853
1854**DESCRIPTION:**
1855
1856This command formats a block device entry with the DOSFS file system.
1857
1858*-V label*
1859    Specify the volume label.
1860
1861*-s sectors/cluster*
1862    Specify the number of sectors per cluster.
1863
1864*-r size*
1865    Specify the number  of entries in the root directory.
1866
1867*-v*
1868    Enable verbose output mode.
1869
1870**EXIT STATUS:**
1871
1872This command returns 0 on success and non-zero if an error is encountered.
1873
1874**NOTES:**
1875
1876None.
1877
1878**EXAMPLES:**
1879
1880The following is an example of how to use ``mkdos``:
1881
1882.. code:: shell
1883
1884    SHLL [/] $ mkdos /dev/rda1
1885
1886**CONFIGURATION:**
1887
1888.. index:: CONFIGURE_SHELL_NO_COMMAND_MKDOS
1889.. index:: CONFIGURE_SHELL_COMMAND_MKDOS
1890
1891This command is included in the default shell command set.  When building a
1892custom command set, define ``CONFIGURE_SHELL_COMMAND_MKDOS`` to have this
1893command included.
1894
1895This command can be excluded from the shell command set by defining
1896``CONFIGURE_SHELL_NO_COMMAND_MKDOS`` when all shell commands have been
1897configured.
1898
1899**PROGRAMMING INFORMATION:**
1900
1901.. index:: rtems_shell_rtems_main_mkdos
1902
1903The ``mkdos`` is implemented by a C language function which has the following
1904prototype:
1905
1906.. code:: c
1907
1908    int rtems_shell_rtems_main_mkdos(
1909        int    argc,
1910        char **argv
1911    );
1912
1913The configuration structure for the ``mkdos`` has the following prototype:
1914
1915.. code:: c
1916
1917    extern rtems_shell_cmd_t rtems_shell_MKDOS_Command;
1918
1919.. _mknod:
1920
1921mknod - make device special file
1922--------------------------------
1923.. index:: mknod
1924
1925**SYNOPSYS:**
1926
1927.. code:: shell
1928
1929    mknod [-rR] [-F fmt] [-g gid] [-m mode] [-u uid] name [c | b] [driver | major] minor
1930    mknod [-rR] [-F fmt] [-g gid] [-m mode] [-u uid] name [c | b] major unit subunit
1931    mknod [-rR] [-g gid] [-m mode] [-u uid] name [c | b] number
1932    mknod [-rR] [-g gid] [-m mode] [-u uid] name p
1933
1934**DESCRIPTION:**
1935
1936The mknod command creates device special files, or fifos.  Normally the shell
1937script /dev/MAKEDEV is used to create special files for commonly known devices;
1938it executes mknod with the appropriate arguments and can make all the files
1939required for the device.
1940
1941To make nodes manually, the arguments are:
1942
1943*-r*
1944    Replace an existing file if its type is incorrect.
1945
1946*-R*
1947    Replace an existing file if its type is incorrect.  Correct the mode, user
1948    and group.
1949
1950*-g gid*
1951    Specify the group for the device node.  The gid operand may be a numeric
1952    group ID or a group name.  If a group name is also a numeric group ID, the
1953    operand is used as a group name.  Precede a numeric group ID with a # to
1954    stop it being treated as a name.
1955
1956*-m mode*
1957    Specify the mode for the device node.  The mode may be absolute or
1958    symbolic, see *chmod*.
1959
1960*-u uid*
1961    Specify the user for the device node.  The uid operand may be a numeric
1962    user ID or a user name.  If a user name is also a numeric user ID, the
1963    operand is used as a user name.  Precede a numeric user ID with a # to stop
1964    it being treated as a name.
1965
1966*name*
1967    Device name, for example "tty" for a termios serial device or "hd" for a
1968    disk.
1969
1970*b | c | p*
1971    Type of device.  If the device is a block type device such as a tape or
1972    disk drive which needs both cooked and raw special files, the type is b.
1973    All other devices are character type devices, such as terminal and pseudo
1974    devices, and are type c.  Specifying p creates fifo files.
1975
1976*driver | major*
1977    The major device number is an integer number which tells the kernel which
1978    device driver entry point to use.  If the device driver is configured into
1979    the current kernel it may be specified by driver name or major number.
1980
1981*minor*
1982    The minor device number tells the kernel which one of several similar
1983    devices the node corresponds to; for example, it may be a specific serial
1984    port or pty.
1985
1986*unit and subunit*
1987    The unit and subunit numbers select a subset of a device; for example, the
1988    unit may specify a particular disk, and the subunit a partition on that
1989    disk.  (Currently this form of specification is only supported by the bsdos
1990    format, for compatibility with the BSD/OS mknod).
1991
1992*number*
1993
1994    A single opaque device number.  Useful for netbooted computers which
1995    require device numbers packed in a format that isn't supported by -F.
1996
1997**EXIT STATUS:**
1998
1999The ``mknod`` utility exits 0 on success, and >0 if an error occurs.
2000
2001**NOTES:**
2002
2003None.
2004
2005**EXAMPLES:**
2006
2007.. code:: shell
2008
2009    SHLL [/] mknod c 3 0 /dev/ttyS10
2010
2011**CONFIGURATION:**
2012
2013.. index:: CONFIGURE_SHELL_NO_COMMAND_MKNOD
2014.. index:: CONFIGURE_SHELL_COMMAND_MKNOD
2015
2016This command is included in the default shell command set.  When building a
2017custom command set, define ``CONFIGURE_SHELL_COMMAND_MKNOD`` to have this
2018command included.
2019
2020This command can be excluded from the shell command set by defining
2021``CONFIGURE_SHELL_NO_COMMAND_MKNOD`` when all shell commands have been
2022configured.
2023
2024**PROGRAMMING INFORMATION:**
2025
2026.. index:: rtems_shell_rtems_main_mknod
2027
2028The ``mknod`` command is implemented by a C language function which has the
2029following prototype:
2030
2031.. code:: c
2032
2033    int rtems_shell_rtems_main_mknod(
2034        int    argc,
2035        char **argv
2036    );
2037
2038The configuration structure for the ``mknod`` has the following prototype:
2039
2040.. code:: c
2041
2042    extern rtems_shell_cmd_t rtems_shell_MKNOD_Command;
2043
2044**ORIGIN:**
2045
2046The implementation and portions of the documentation for this command are from
2047NetBSD 4.0.
2048
2049.. _mkrfs:
2050
2051mkrfs - format RFS file system
2052------------------------------
2053.. index:: mkrfs
2054
2055**SYNOPSYS:**
2056
2057.. code:: shell
2058
2059    mkrfs [-vsbiIo] device
2060
2061**DESCRIPTION:**
2062
2063Format the block device with the RTEMS File System (RFS). The default
2064configuration with not parameters selects a suitable block size based on the
2065size of the media being formatted.
2066
2067The media is broken up into groups of blocks. The number of blocks in a group
2068is based on the number of bits a block contains. The large a block the more
2069blocks a group contains and the fewer groups in the file system.
2070
2071The following options are provided:
2072
2073*-v*
2074    Display configuration and progress of the format.
2075
2076*-s*
2077    Set the block size in bytes.
2078
2079*-b*
2080    The number of blocks in a group. The block count must be equal or less than
2081    the number of bits in a block.
2082
2083*-i*
2084    Number of inodes in a group. The inode count must be equal or less than the
2085    number of bits in a block.
2086
2087*-I*
2088    Initialise the inodes. The default is not to initialise the inodes and to
2089    rely on the inode being initialised when allocated. Initialising the inode
2090    table helps recovery if a problem appears.
2091
2092*-o*
2093    Integer percentage of the media used by inodes. The default is 1%.
2094
2095*device*
2096    Path of the device to format.
2097
2098**EXIT STATUS:**
2099
2100This command returns 0 on success and non-zero if an error is encountered.
2101
2102**NOTES:**
2103
2104None.
2105
2106**EXAMPLES:**
2107
2108The following is an example of how to use ``mkrfs``:
2109
2110.. code:: shell
2111
2112    SHLL [/] $ mkrfs /dev/fdda
2113
2114**CONFIGURATION:**
2115
2116.. index:: CONFIGURE_SHELL_NO_COMMAND_MKRFS
2117.. index:: CONFIGURE_SHELL_COMMAND_MKRFS
2118
2119This command is included in the default shell command set.  When building a
2120custom command set, define ``CONFIGURE_SHELL_COMMAND_MKRFS`` to have this
2121command included.
2122
2123This command can be excluded from the shell command set by defining
2124``CONFIGURE_SHELL_NO_COMMAND_MKRFS`` when all shell commands have been
2125configured.
2126
2127**PROGRAMMING INFORMATION:**
2128
2129.. index:: rtems_shell_rtems_main_mkrfs
2130
2131The ``mkrfs`` command is implemented by a C language function which has the
2132following prototype:
2133
2134.. code:: c
2135
2136    int rtems_shell_rtems_main_mkrfs(
2137        int    argc,
2138        char **argv
2139    );
2140
2141The configuration structure for ``mkrfs`` has the following prototype:
2142
2143.. code:: c
2144
2145    extern rtems_shell_cmd_t rtems_shell_MKRFS_Command;
2146
2147.. _mount:
2148
2149mount - mount disk
2150------------------
2151.. index:: mount
2152
2153**SYNOPSYS:**
2154
2155.. code:: shell
2156
2157    mount [-t fstype] [-r] [-L] device path
2158
2159**DESCRIPTION:**
2160
2161The ``mount`` command will mount a block device to a mount point using the
2162specified file system. The files systems are:
2163
2164- msdos - MSDOS File System
2165
2166- tftp  - TFTP Network File System
2167
2168- ftp   - FTP Network File System
2169
2170- nfs   - Network File System
2171
2172- rfs   - RTEMS File System
2173
2174When the file system type is 'msdos' or 'rfs' the driver is a "block device
2175driver" node present in the file system. The driver is ignored with the 'tftp'
2176and 'ftp' file systems. For the 'nfs' file system the driver is the
2177'host:/path' string that described NFS host and the exported file system path.
2178
2179**EXIT STATUS:**
2180
2181This command returns 0 on success and non-zero if an error is encountered.
2182
2183**NOTES:**
2184
2185The mount point must exist.
2186
2187The services offered by each file-system vary. For example you cannot list the
2188directory of a TFTP file-system as this server is not provided in the TFTP
2189protocol. You need to check each file-system's documentation for the services
2190provided.
2191
2192**EXAMPLES:**
2193
2194Mount the Flash Disk driver to the '/fd' mount point:
2195
2196.. code:: shell
2197
2198    SHLL [/] $ mount -t msdos /dev/flashdisk0 /fd
2199
2200Mount the NFS file system exported path 'bar' by host 'foo':
2201
2202.. code:: shell
2203
2204    $ mount -t nfs foo:/bar /nfs
2205
2206Mount the TFTP file system on '/tftp':
2207
2208.. code:: shell
2209
2210    $ mount -t tftp /tftp
2211
2212To access the TFTP files on server '10.10.10.10':
2213.. code:: shell
2214
2215    $ cat /tftp/10.10.10.10/test.txt
2216
2217**CONFIGURATION:**
2218
2219.. index:: CONFIGURE_SHELL_NO_COMMAND_MOUNT
2220.. index:: CONFIGURE_SHELL_COMMAND_MOUNT
2221
2222This command is included in the default shell command set.  When building a
2223custom command set, define ``CONFIGURE_SHELL_COMMAND_MOUNT`` to have this
2224command included.
2225
2226This command can be excluded from the shell command set by defining
2227``CONFIGURE_SHELL_NO_COMMAND_MOUNT`` when all shell commands have been
2228configured.
2229
2230The mount command includes references to file-system code. If you do not wish
2231to include file-system that you do not use do not define the mount command
2232support for that file-system. The file-system mount command defines are:
2233
2234- msdos - CONFIGURE_SHELL_MOUNT_MSDOS
2235
2236- tftp - CONFIGURE_SHELL_MOUNT_TFTP
2237
2238- ftp - CONFIGURE_SHELL_MOUNT_FTP
2239
2240- nfs - CONFIGURE_SHELL_MOUNT_NFS
2241
2242- rfs - CONFIGURE_SHELL_MOUNT_RFS
2243
2244An example configuration is:
2245
2246.. code:: c
2247
2248    #define CONFIGURE_SHELL_MOUNT_MSDOS
2249    #ifdef RTEMS_NETWORKING
2250    #define CONFIGURE_SHELL_MOUNT_TFTP
2251    #define CONFIGURE_SHELL_MOUNT_FTP
2252    #define CONFIGURE_SHELL_MOUNT_NFS
2253    #define CONFIGURE_SHELL_MOUNT_RFS
2254    #endif
2255
2256**PROGRAMMING INFORMATION:**
2257
2258.. index:: rtems_shell_rtems_main_mount
2259
2260The ``mount`` is implemented by a C language function which has the following
2261prototype:
2262
2263.. code:: c
2264
2265    int rtems_shell_rtems_main_mount(
2266        int    argc,
2267        char **argv
2268    );
2269
2270The configuration structure for the ``mount`` has the following prototype:
2271
2272.. code:: c
2273
2274    extern rtems_shell_cmd_t rtems_shell_MOUNT_Command;
2275
2276.. _mv:
2277
2278mv - move files
2279---------------
2280.. index:: mv
2281
2282**SYNOPSYS:**
2283
2284.. code:: shell
2285
2286    mv [-fiv] source_file target_file
2287    mv [-fiv] source_file... target_file
2288
2289**DESCRIPTION:**
2290
2291In its first form, the mv utility renames the file named by the source operand
2292to the destination path named by the target operand.  This form is assumed when
2293the last operand does not name an already existing directory.
2294
2295In its second form, mv moves each file named by a source operand to a
2296destination file in the existing directory named by the directory operand.  The
2297destination path for each operand is the pathname produced by the concatenation
2298of the last operand, a slash, and the final pathname component of the named
2299file.
2300
2301The following options are available:
2302
2303*-f*
2304    Do not prompt for confirmation before overwriting the destination path.
2305
2306*-i*
2307    Causes mv to write a prompt to standard error before moving a file that
2308    would overwrite an existing file.  If the response from the standard input
2309    begins with the character 'y', the move is attempted.
2310
2311*-v*
2312    Cause mv to be verbose, showing files as they are processed.
2313
2314The last of any -f or -i options is the one which affects mv's behavior.
2315
2316It is an error for any of the source operands to specify a nonexistent file or
2317directory.
2318
2319It is an error for the source operand to specify a directory if the target
2320exists and is not a directory.
2321
2322If the destination path does not have a mode which permits writing, mv prompts
2323the user for confirmation as specified for the -i option.
2324
2325Should the *rename* call fail because source and target are on different file
2326systems, ``mv`` will remove the destination file, copy the source file to the
2327destination, and then remove the source.  The effect is roughly equivalent to:
2328
2329.. code:: shell
2330
2331    rm -f destination_path && \
2332    cp -PRp source_file destination_path && \
2333    rm -rf source_file
2334
2335**EXIT STATUS:**
2336
2337The ``mv`` utility exits 0 on success, and >0 if an error occurs.
2338
2339**NOTES:**
2340
2341None.
2342
2343**EXAMPLES:**
2344
2345.. code:: shell
2346
2347    SHLL [/] mv /dev/console /dev/con1
2348
2349**CONFIGURATION:**
2350
2351.. index:: CONFIGURE_SHELL_NO_COMMAND_MV
2352.. index:: CONFIGURE_SHELL_COMMAND_MV
2353
2354This command is included in the default shell command set.  When building a
2355custom command set, define ``CONFIGURE_SHELL_COMMAND_MV`` to have this command
2356included.
2357
2358This command can be excluded from the shell command set by defining
2359``CONFIGURE_SHELL_NO_COMMAND_MV`` when all shell commands have been configured.
2360
2361**PROGRAMMING INFORMATION:**
2362
2363.. index:: rtems_shell_main_mv
2364
2365The ``mv`` command is implemented by a C language function which has the
2366following prototype:
2367
2368.. code:: c
2369
2370    int rtems_shell_main_mv(
2371        int    argc,
2372        char **argv
2373    );
2374
2375The configuration structure for the ``mv`` has the following prototype:
2376
2377.. code:: c
2378
2379    extern rtems_shell_cmd_t rtems_shell_MV_Command;
2380
2381**ORIGIN:**
2382
2383The implementation and portions of the documentation for this command are from
2384NetBSD 4.0.
2385
2386.. _pwd:
2387
2388pwd - print work directory
2389--------------------------
2390.. index:: pwd
2391
2392**SYNOPSYS:**
2393
2394.. code:: shell
2395
2396    pwd
2397
2398**DESCRIPTION:**
2399
2400This command prints the fully qualified filename of the current working
2401directory.
2402
2403**EXIT STATUS:**
2404
2405This command returns 0 on success and non-zero if an error is encountered.
2406
2407**NOTES:**
2408
2409None.
2410
2411**EXAMPLES:**
2412
2413The following is an example of how to use ``pwd``:
2414
2415.. code:: shell
2416
2417    SHLL [/] $ pwd
2418    /
2419    SHLL [/] $ cd dev
2420    SHLL [/dev] $ pwd
2421    /dev
2422
2423**CONFIGURATION:**
2424
2425.. index:: CONFIGURE_SHELL_NO_COMMAND_PWD
2426.. index:: CONFIGURE_SHELL_COMMAND_PWD
2427
2428This command is included in the default shell command set.  When building a
2429custom command set, define ``CONFIGURE_SHELL_COMMAND_PWD`` to have this command
2430included.
2431
2432This command can be excluded from the shell command set by defining
2433``CONFIGURE_SHELL_NO_COMMAND_PWD`` when all shell commands have been
2434configured.
2435
2436**PROGRAMMING INFORMATION:**
2437
2438.. index:: rtems_shell_rtems_main_pwd
2439
2440The ``pwd`` is implemented by a C language function which has the following
2441prototype:
2442
2443.. code:: c
2444
2445    int rtems_shell_rtems_main_pwd(
2446        int    argc,
2447        char **argv
2448    );
2449
2450The configuration structure for the ``pwd`` has the following prototype:
2451
2452.. code:: c
2453
2454    extern rtems_shell_cmd_t rtems_shell_PWD_Command;
2455
2456.. _rmdir:
2457
2458rmdir - remove empty directories
2459--------------------------------
2460.. index:: rmdir
2461
2462**SYNOPSYS:**
2463
2464.. code:: shell
2465
2466    rmdir  [dir1 .. dirN]
2467
2468**DESCRIPTION:**
2469
2470This command removes the specified set of directories.  If no directories are
2471provided on the command line, no actions are taken.
2472
2473**EXIT STATUS:**
2474
2475This command returns 0 on success and non-zero if an error is encountered.
2476
2477**NOTES:**
2478
2479This command is a implemented using the ``rmdir(2)`` system call and all
2480reasons that call may fail apply to this command.
2481
2482**EXAMPLES:**
2483
2484The following is an example of how to use ``rmdir``:
2485
2486.. code:: shell
2487
2488    SHLL [/] # mkdir joeldir
2489    SHLL [/] # rmdir joeldir
2490    SHLL [/] # ls joeldir
2491    joeldir: No such file or directory.
2492
2493**CONFIGURATION:**
2494
2495.. index:: CONFIGURE_SHELL_NO_COMMAND_RMDIR
2496.. index:: CONFIGURE_SHELL_COMMAND_RMDIR
2497
2498This command is included in the default shell command set.  When building a
2499custom command set, define ``CONFIGURE_SHELL_COMMAND_RMDIR`` to have this
2500command included.
2501
2502This command can be excluded from the shell command set by defining
2503``CONFIGURE_SHELL_NO_COMMAND_RMDIR`` when all shell commands have been
2504configured.
2505
2506**PROGRAMMING INFORMATION:**
2507
2508.. index:: rtems_shell_rtems_main_rmdir
2509
2510The ``rmdir`` is implemented by a C language function which has the following
2511prototype:
2512
2513.. code:: c
2514
2515    int rtems_shell_rtems_main_rmdir(
2516        int    argc,
2517        char **argv
2518    );
2519
2520The configuration structure for the ``rmdir`` has the following prototype:
2521
2522.. code:: c
2523
2524    extern rtems_shell_cmd_t rtems_shell_RMDIR_Command;
2525
2526.. _rm:
2527
2528rm - remove files
2529-----------------
2530.. index:: rm
2531
2532**SYNOPSYS:**
2533
2534.. code:: shell
2535
2536    rm file1 [file2 ... fileN]
2537
2538**DESCRIPTION:**
2539
2540This command deletes a name from the filesystem.  If the specified file name
2541was the last link to a file and there are no ``open`` file descriptor
2542references to that file, then it is deleted and the associated space in the
2543file system is made available for subsequent use.
2544
2545If the filename specified was the last link to a file but there are open file
2546descriptor references to it, then the file will remain in existence until the
2547last file descriptor referencing it is closed.
2548
2549**EXIT STATUS:**
2550
2551This command returns 0 on success and non-zero if an error is encountered.
2552
2553**NOTES:**
2554
2555None.
2556
2557**EXAMPLES:**
2558
2559The following is an example of how to use ``rm``:
2560
2561.. code:: c
2562
2563    SHLL [/] # cp /etc/passwd tmpfile
2564    SHLL [/] # cat tmpfile
2565    root:*:0:0:root::/:/bin/sh
2566    rtems:*:1:1:RTEMS Application::/:/bin/sh
2567    tty:!:2:2:tty owner::/:/bin/false
2568    SHLL [/] # rm tmpfile
2569    SHLL [/] # cat tmpfile
2570    cat: tmpfile: No such file or directory
2571
2572**CONFIGURATION:**
2573
2574.. index:: CONFIGURE_SHELL_NO_COMMAND_RM
2575.. index:: CONFIGURE_SHELL_COMMAND_RM
2576
2577This command is included in the default shell command set.  When building a
2578custom command set, define ``CONFIGURE_SHELL_COMMAND_RM`` to have this command
2579included.
2580
2581This command can be excluded from the shell command set by defining
2582``CONFIGURE_SHELL_NO_COMMAND_RM`` when all shell commands have been configured.
2583
2584**PROGRAMMING INFORMATION:**
2585
2586.. index:: rtems_shell_main_rm
2587
2588The ``rm`` is implemented by a C language function which has the following
2589prototype:
2590
2591.. code:: c
2592
2593    int rtems_shell_main_rm(
2594        int    argc,
2595        char **argv
2596    );
2597
2598The configuration structure for the ``rm`` has the
2599following prototype:
2600.. code:: c
2601
2602    extern rtems_shell_cmd_t rtems_shell_RM_Command;
2603
2604.. _umask:
2605
2606umask - set file mode creation mask
2607-----------------------------------
2608.. index:: umask
2609
2610**SYNOPSYS:**
2611
2612.. code:: shell
2613
2614    umask [new_umask]
2615
2616**DESCRIPTION:**
2617
2618This command sets the user file creation mask to ``new_umask``.  The argument
2619``new_umask`` may be octal, hexadecimal, or decimal.
2620
2621**EXIT STATUS:**
2622
2623This command returns 0 on success and non-zero if an error is encountered.
2624
2625**NOTES:**
2626
2627This command does not currently support symbolic mode masks.
2628
2629**EXAMPLES:**
2630
2631The following is an example of how to use ``umask``:
2632
2633.. code:: shell
2634
2635    SHLL [/] $ umask
2636    022
2637    SHLL [/] $ umask 0666
2638    0666
2639    SHLL [/] $ umask
2640    0666
2641
2642**CONFIGURATION:**
2643
2644.. index:: CONFIGURE_SHELL_NO_COMMAND_UMASK
2645.. index:: CONFIGURE_SHELL_COMMAND_UMASK
2646
2647This command is included in the default shell command set.  When building a
2648custom command set, define ``CONFIGURE_SHELL_COMMAND_UMASK`` to have this
2649command included.
2650
2651This command can be excluded from the shell command set by defining
2652``CONFIGURE_SHELL_NO_COMMAND_UMASK`` when all shell commands have been
2653configured.
2654
2655**PROGRAMMING INFORMATION:**
2656
2657.. index:: rtems_shell_rtems_main_umask
2658
2659The ``umask`` is implemented by a C language function which has the following
2660prototype:
2661
2662.. code:: c
2663
2664    int rtems_shell_rtems_main_umask(
2665        int    argc,
2666        char **argv
2667    );
2668
2669The configuration structure for the ``umask`` has the following prototype:
2670
2671.. code:: c
2672
2673    extern rtems_shell_cmd_t rtems_shell_UMASK_Command;
2674
2675.. _unmount:
2676
2677unmount - unmount disk
2678----------------------
2679.. index:: unmount
2680
2681**SYNOPSYS:**
2682
2683.. code:: shell
2684
2685    unmount path
2686
2687**DESCRIPTION:**
2688
2689This command unmounts the device at the specified ``path``.
2690
2691**EXIT STATUS:**
2692
2693This command returns 0 on success and non-zero if an error is encountered.
2694
2695**NOTES:**
2696
2697TBD - Surely there must be some warnings to go here.
2698
2699**EXAMPLES:**
2700
2701The following is an example of how to use ``unmount``:
2702
2703.. code:: shell
2704
2705    EXAMPLE_TBD
2706
2707**CONFIGURATION:**
2708
2709.. index:: CONFIGURE_SHELL_NO_COMMAND_UNMOUNT
2710.. index:: CONFIGURE_SHELL_COMMAND_UNMOUNT
2711
2712This command is included in the default shell command set.  When building a
2713custom command set, define ``CONFIGURE_SHELL_COMMAND_UNMOUNT`` to have this
2714command included.
2715
2716This command can be excluded from the shell command set by defining
2717``CONFIGURE_SHELL_NO_COMMAND_UNMOUNT`` when all shell commands have been
2718configured.
2719
2720**PROGRAMMING INFORMATION:**
2721
2722.. index:: rtems_shell_rtems_main_unmount
2723
2724The ``unmount`` is implemented by a C language function which has the following
2725prototype:
2726
2727.. code:: c
2728
2729    int rtems_shell_rtems_main_unmount(
2730        int    argc,
2731        char **argv
2732    );
2733
2734The configuration structure for the ``unmount`` has the following prototype:
2735
2736.. code:: c
2737
2738    extern rtems_shell_cmd_t rtems_shell_UNMOUNT_Command;
Note: See TracBrowser for help on using the repository browser.