Changeset fc9f8f5 in rtems for doc


Ignore:
Timestamp:
09/15/14 00:14:01 (10 years ago)
Author:
Chris Johns <chrisj@…>
Branches:
4.11, 5, master
Children:
6e1206a
Parents:
b299960
git-author:
Chris Johns <chrisj@…> (09/15/14 00:14:01)
git-committer:
Chris Johns <chrisj@…> (09/16/14 05:19:58)
Message:

doc: Sort the shell file commands into alphabetical order.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/shell/file.t

    rb299960 rfc9f8f5  
    1212@itemize @bullet
    1313
    14 @item @code{umask} - Set file mode creation mask
     14@item @code{blksync} - sync the block driver
     15@item @code{cat} - display file contents
     16@item @code{cd} - alias for chdir
     17@item @code{chdir} - change the current directory
     18@item @code{chmod} - change permissions of a file
     19@item @code{chroot} - change the root directory
    1520@item @code{cp} - copy files
     21@item @code{dd} - format disks
     22@item @code{debugrfs} - debug RFS file system
     23@item @code{df} - display file system disk space usage
     24@item @code{dir} - alias for ls
     25@item @code{fdisk} - format disks
     26@item @code{hexdump} - format disks
     27@item @code{ln} - make links
     28@item @code{ls} - list files in the directory
     29@item @code{md5} - display file system disk space usage
     30@item @code{mkdir} - create a directory
     31@item @code{mkdos} - DOSFS disk format
     32@item @code{mknod} - make device special file
     33@item @code{mkrfs} - format RFS file system
     34@item @code{mount} - mount disk
    1635@item @code{mv} - move files
    1736@item @code{pwd} - print work directory
    18 @item @code{ls} - list files in the directory
    19 @item @code{chdir} - change the current directory
    20 @item @code{mkdir} - create a directory
    2137@item @code{rmdir} - remove empty directories
    22 @item @code{ln} - make links
    23 @item @code{mknod} - make device special file
    24 @item @code{chroot} - change the root directory
    25 @item @code{chmod} - change permissions of a file
    26 @item @code{cat} - display file contents
    27 @item @code{msdosfmt} - format disk
    2838@item @code{rm} - remove files
    29 @item @code{mount} - mount disk
     39@item @code{umask} - Set file mode creation mask
    3040@item @code{unmount} - unmount disk
    31 @item @code{blksync} - sync the block driver
    32 @item @code{dd} - format disks
    33 @item @code{hexdump} - format disks
    34 @item @code{fdisk} - format disks
    35 @item @code{dir} - alias for ls
    36 @item @code{mkrfs} - format RFS file system
    37 @item @code{cd} - alias for chdir
    38 @item @code{df} - display file system disk space usage
    39 @item @code{md5} - display file system disk space usage
    4041
    4142@end itemize
     
    5253@c
    5354@page
    54 @subsection umask - set file mode creation mask
    55 
    56 @pgindex umask
     55@subsection blksync - sync the block driver
     56
     57@pgindex blksync
    5758
    5859@subheading SYNOPSYS:
    5960
    6061@example
    61 umask [new_umask]
     62blksync driver
    6263@end example
    6364
    6465@subheading DESCRIPTION:
    6566
    66 This command sets the user file creation mask to @code{new_umask}.  The
    67 argument @code{new_umask} may be octal, hexadecimal, or decimal.
     67This command XXX
    6868
    6969@subheading EXIT STATUS:
     
    7373@subheading NOTES:
    7474
    75 This command does not currently support symbolic mode masks.
     75NONE
    7676
    7777@subheading EXAMPLES:
    7878
    79 The following is an example of how to use @code{umask}:
    80 
    81 @example
    82 SHLL [/] $ umask
    83 022
    84 SHLL [/] $ umask 0666
    85 0666
    86 SHLL [/] $ umask
    87 0666
     79The following is an example of how to use @code{blksync}:
     80
     81@example
     82EXAMPLE_TBD
    8883@end example
    8984
    9085@subheading CONFIGURATION:
    9186
    92 @findex CONFIGURE_SHELL_NO_COMMAND_UMASK
    93 @findex CONFIGURE_SHELL_COMMAND_UMASK
     87@findex CONFIGURE_SHELL_NO_COMMAND_BLKSYNC
     88@findex CONFIGURE_SHELL_COMMAND_BLKSYNC
    9489
    9590This command is included in the default shell command set.
    9691When building a custom command set, define
    97 @code{CONFIGURE_SHELL_COMMAND_UMASK} to have this
     92@code{CONFIGURE_SHELL_COMMAND_BLKSYNC} to have this
    9893command included.
    9994
    10095This command can be excluded from the shell command set by
    101 defining @code{CONFIGURE_SHELL_NO_COMMAND_UMASK} when all
     96defining @code{CONFIGURE_SHELL_NO_COMMAND_BLKSYNC} when all
    10297shell commands have been configured.
    10398
    10499@subheading PROGRAMMING INFORMATION:
    105100
    106 @findex rtems_shell_rtems_main_umask
    107 
    108 The @code{umask} is implemented by a C language function
     101@findex rtems_shell_rtems_main_blksync
     102
     103The @code{blksync} is implemented by a C language function
    109104which has the following prototype:
    110105
    111106@example
    112 int rtems_shell_rtems_main_umask(
     107int rtems_shell_rtems_main_blksync(
    113108  int    argc,
    114109  char **argv
     
    116111@end example
    117112
    118 The configuration structure for the @code{umask} has the
     113The configuration structure for the @code{blksync} has the
    119114following prototype:
    120115
    121116@example
    122 extern rtems_shell_cmd_t rtems_shell_UMASK_Command;
     117extern rtems_shell_cmd_t rtems_shell_BLKSYNC_Command;
    123118@end example
    124119
     
    127122@c
    128123@page
    129 @subsection cp - copy files
    130 
    131 @pgindex cp
     124@subsection cat - display file contents
     125
     126@pgindex cat
    132127
    133128@subheading SYNOPSYS:
    134129
    135130@example
    136 cp [-R [-H | -L | -P]] [-f | -i] [-pv] src target
    137 cp [-R [-H | -L] ] [-f | -i] [-NpPv] source_file ... target_directory
     131cat file1 [file2 .. fileN]
    138132@end example
    139133
    140134@subheading DESCRIPTION:
    141135
    142 In the first synopsis form, the cp utility copies the contents of the
    143 source_file to the target_file. In the second synopsis form, the contents of
    144 each named source_file is copied to the destination target_directory. The names
    145 of the files themselves are not changed. If cp detects an attempt to copy a
    146 file to itself, the copy will fail.
    147 
    148 The following options are available:
    149 
    150 @table @b
    151 @item -f
    152 For each existing destination pathname, attempt to overwrite it. If permissions
    153 do not allow copy to succeed, remove it and create a new file, without
    154 prompting for confirmation. (The -i option is ignored if the -f option is
    155 specified.)
    156 
    157 @item -H
    158 If the -R option is specified, symbolic links on the command line are followed.
    159 (Symbolic links encountered in the tree traversal are not followed.)
    160 
    161 @item -i
    162 Causes cp to write a prompt to the standard error output before copying a file
    163 that would overwrite an existing file. If the response from the standard input
    164 begins with the character 'y', the file copy is attempted.
    165 
    166 @item -L
    167 If the -R option is specified, all symbolic links are followed.
    168 
    169 @item -N
    170 When used with -p, do not copy file flags.
    171 
    172 @item -P
    173 No symbolic links are followed.
    174 
    175 @item -p
    176 Causes cp to preserve in the copy as many of the modification time, access
    177 time, file flags, file mode, user ID, and group ID as allowed by permissions.
    178 
    179 If the user ID and group ID cannot be preserved, no error message is displayed
    180 and the exit value is not altered.
    181 
    182 If the source file has its set user ID bit on and the user ID cannot be
    183 preserved, the set user ID bit is not preserved in the copy's permissions. If
    184 the source file has its set group ID bit on and the group ID cannot be
    185 preserved, the set group ID bit is not preserved in the copy's permissions. If
    186 the source file has both its set user ID and set group ID bits on, and either
    187 the user ID or group ID cannot be preserved, neither the set user ID or set
    188 group ID bits are preserved in the copy's permissions.
    189 
    190 @item -R
    191 If source_file designates a directory, cp copies the directory and the entire
    192 subtree connected at that point. This option also causes symbolic links to be
    193 copied, rather than indirected through, and for cp to create special files
    194 rather than copying them as normal files. Created directories have the same
    195 mode as the corresponding source directory, unmodified by the process's umask.
    196 
    197 @item -v
    198 Cause cp to be verbose, showing files as they are copied.
    199 
    200 @end table
    201 
    202 For each destination file that already exists, its contents are overwritten if
    203 permissions allow, but its mode, user ID, and group ID are unchanged.
    204 
    205 In the second synopsis form, target_directory must exist unless there is only
    206 one named source_file which is a directory and the -R flag is specified.
    207 
    208 If the destination file does not exist, the mode of the source file is used as
    209 modified by the file mode creation mask (umask, see csh(1)). If the source file
    210 has its set user ID bit on, that bit is removed unless both the source file and
    211 the destination file are owned by the same user. If the source file has its set
    212 group ID bit on, that bit is removed unless both the source file and the
    213 destination file are in the same group and the user is a member of that group.
    214 If both the set user ID and set group ID bits are set, all of the above
    215 conditions must be fulfilled or both bits are removed.
    216 
    217 Appropriate permissions are required for file creation or overwriting.
    218 
    219 Symbolic links are always followed unless the -R flag is set, in which case
    220 symbolic links are not followed, by default. The -H or -L flags (in conjunction
    221 with the -R flag), as well as the -P flag cause symbolic links to be followed
    222 as described above. The -H and -L options are ignored unless the -R option is
    223 specified. In addition, these options override eachsubhedading other and the
    224 command's actions are determined by the last one specified.
     136This command displays the contents of the specified files.
    225137
    226138@subheading EXIT STATUS:
     
    230142@subheading NOTES:
    231143
    232 NONE
     144It is possible to read the input from a device file using @code{cat}.
    233145
    234146@subheading EXAMPLES:
    235147
    236 The following is an example of how to use @code{cp} to
    237 copy a file to a new name in the current directory:
    238 
    239 @example
    240 SHLL [/] # cat joel
    241 cat: joel: No such file or directory
    242 SHLL [/] # cp etc/passwd joel
    243 SHLL [/] # cat joel
     148The following is an example of how to use @code{cat}:
     149
     150@example
     151SHLL [/] # cat /etc/passwd
    244152root:*:0:0:root::/:/bin/sh
    245153rtems:*:1:1:RTEMS Application::/:/bin/sh
    246154tty:!:2:2:tty owner::/:/bin/false
    247 SHLL [/] # ls
    248 drwxr-xr-x   1   root   root         536 Jan 01 00:00 dev/
    249 drwxr-xr-x   1   root   root        1072 Jan 01 00:00 etc/
    250 -rw-r--r--   1   root   root         102 Jan 01 00:00 joel
    251 3 files 1710 bytes occupied
    252 @end example
    253 
    254 The following is an example of how to use @code{cp} to
    255 copy one or more files to a destination directory and
    256 use the same @code{basename} in the destination directory:
    257 
    258 @example
    259 SHLL [/] # mkdir tmp
    260 SHLL [/] # ls tmp
    261 0 files 0 bytes occupied
    262 SHLL [/] # cp /etc/passwd tmp
    263 SHLL [/] # ls /tmp
    264 -rw-r--r--   1   root   root         102 Jan 01 00:01 passwd
    265 1 files 102 bytes occupied
    266 SHLL [/] # cp /etc/passwd /etc/group /tmp
    267 SHLL [/] # ls /tmp
    268 -rw-r--r--   1   root   root         102 Jan 01 00:01 passwd
    269 -rw-r--r--   1   root   root          42 Jan 01 00:01 group
    270 2 files 144 bytes occupied
    271 SHLL [/] #
    272155@end example
    273156
    274157@subheading CONFIGURATION:
    275158
    276 @findex CONFIGURE_SHELL_NO_COMMAND_CP
    277 @findex CONFIGURE_SHELL_COMMAND_CP
     159@findex CONFIGURE_SHELL_NO_COMMAND_CAT
     160@findex CONFIGURE_SHELL_COMMAND_CAT
    278161
    279162This command is included in the default shell command set.
    280163When building a custom command set, define
    281 @code{CONFIGURE_SHELL_COMMAND_CP} to have this
     164@code{CONFIGURE_SHELL_COMMAND_CAT} to have this
    282165command included.
    283166
    284167This command can be excluded from the shell command set by
    285 defining @code{CONFIGURE_SHELL_NO_COMMAND_CP} when all
     168defining @code{CONFIGURE_SHELL_NO_COMMAND_CAT} when all
    286169shell commands have been configured.
    287170
    288171@subheading PROGRAMMING INFORMATION:
    289172
    290 @findex rtems_shell_rtems_main_cp
    291 
    292 The @code{cp} command is implemented by a C language function which
    293 has the following prototype:
    294 
    295 @example
    296 int rtems_shell_rtems_main_cp(
     173@findex rtems_shell_rtems_main_cat
     174
     175The @code{cat} is implemented by a C language function
     176which has the following prototype:
     177
     178@example
     179int rtems_shell_rtems_main_cat(
    297180  int    argc,
    298181  char **argv
     
    300183@end example
    301184
    302 The configuration structure for the @code{cp} has the
     185The configuration structure for the @code{cat} has the
    303186following prototype:
    304187
    305188@example
    306 extern rtems_shell_cmd_t rtems_shell_CP_Command;
    307 @end example
    308 
    309 @subheading ORIGIN:
    310 
    311 The implementation and portions of the documentation for this
    312 command are from NetBSD 4.0.
     189extern rtems_shell_cmd_t rtems_shell_CAT_Command;
     190@end example
    313191
    314192@c
     
    316194@c
    317195@page
    318 @subsection mv - move files
    319 
    320 @pgindex mv
     196@subsection cd - alias for chdir
     197
     198@pgindex cd
    321199
    322200@subheading SYNOPSYS:
    323201
    324202@example
    325 mv [-fiv] source_file target_file
    326 mv [-fiv] source_file... target_file
     203cd directory
    327204@end example
    328205
    329206@subheading DESCRIPTION:
    330207
    331 In its first form, the mv utility renames the file named by the source
    332 operand to the destination path named by the target operand.  This
    333 form is assumed when the last operand does not name an already
    334 existing directory.
    335 
    336 In its second form, mv moves each file named by a source operand to a
    337 destination file in the existing directory named by the directory
    338 operand.  The destination path for each operand is the pathname
    339 produced by the concatenation of the last operand, a slash, and the
    340 final pathname component of the named file.
    341 
    342 The following options are available:
    343 
    344 @table @b
    345 @item -f
    346 Do not prompt for confirmation before overwriting the destination
    347 path.
    348 
    349 @item -i
    350 Causes mv to write a prompt to standard error before moving a file
    351 that would overwrite an existing file.  If the response from the
    352 standard input begins with the character 'y', the move is attempted.
    353 
    354 @item -v
    355 Cause mv to be verbose, showing files as they are processed.
    356 
    357 @end table
    358 
    359 The last of any -f or -i options is the one which affects mv's
    360 behavior.
    361 
    362 It is an error for any of the source operands to specify a nonexistent
    363 file or directory.
    364 
    365 It is an error for the source operand to specify a directory if the
    366 target exists and is not a directory.
    367 
    368 If the destination path does not have a mode which permits writing, mv
    369 prompts the user for confirmation as specified for the -i option.
    370 
    371 Should the @b{rename} call fail because source and target are on
    372 different file systems, @code{mv} will remove the destination file,
    373 copy the source file to the destination, and then remove the source.
    374 The effect is roughly equivalent to:
    375 
    376 @example
    377 rm -f destination_path && \
    378 cp -PRp source_file destination_path && \
    379 rm -rf source_file
    380 @end example
     208This command is an alias or alternate name for the @code{chdir}.
     209See @ref{File and Directory Commands chdir - change the current directory, cd}
     210for more information.
    381211
    382212@subheading EXIT STATUS:
    383213
    384 The @code{mv} utility exits 0 on success, and >0 if an error occurs.
     214This command returns 0 on success and non-zero if an error is encountered.
    385215
    386216@subheading NOTES:
     
    390220@subheading EXAMPLES:
    391221
    392 @example
    393 SHLL [/] mv /dev/console /dev/con1
     222The following is an example of how to use @code{cd}:
     223
     224@example
     225SHLL [/] $ cd etc
     226SHLL [/etc] $ cd /
     227SHLL [/] $ cd /etc
     228SHLL [/etc] $ pwd
     229/etc
     230SHLL [/etc] $ cd /
     231SHLL [/] $ pwd
     232/
     233SHLL [/] $ cd etc
     234SHLL [/etc] $ cd ..
     235SHLL [/] $ pwd
     236/
    394237@end example
    395238
    396239@subheading CONFIGURATION:
    397240
    398 @findex CONFIGURE_SHELL_NO_COMMAND_MV
    399 @findex CONFIGURE_SHELL_COMMAND_MV
    400 
    401 This command is included in the default shell command set.  When
    402 building a custom command set, define
    403 @code{CONFIGURE_SHELL_COMMAND_MV} to have this command included.
     241@findex CONFIGURE_SHELL_NO_COMMAND_CD
     242@findex CONFIGURE_SHELL_COMMAND_CD
     243
     244This command is included in the default shell command set.
     245When building a custom command set, define
     246@code{CONFIGURE_SHELL_COMMAND_CD} to have this
     247command included.
    404248
    405249This command can be excluded from the shell command set by
    406 defining @code{CONFIGURE_SHELL_NO_COMMAND_MV} when all
     250defining @code{CONFIGURE_SHELL_NO_COMMAND_CD} when all
    407251shell commands have been configured.
    408252
    409253@subheading PROGRAMMING INFORMATION:
    410254
    411 @findex rtems_shell_rtems_main_mv
    412 
    413 The @code{mv} command is implemented by a C language function which
    414 has the following prototype:
    415 
    416 @example
    417 int rtems_shell_rtems_main_mv(
     255@findex rtems_shell_rtems_main_cd
     256
     257The @code{cd} is implemented by a C language function
     258which has the following prototype:
     259
     260@example
     261int rtems_shell_rtems_main_cd(
    418262  int    argc,
    419263  char **argv
     
    421265@end example
    422266
    423 The configuration structure for the @code{mv} has the
     267The configuration structure for the @code{cd} has the
    424268following prototype:
    425269
    426270@example
    427 extern rtems_shell_cmd_t rtems_shell_MV_Command;
    428 @end example
    429 
    430 @subheading ORIGIN:
    431 
    432 The implementation and portions of the documentation for this command
    433 are from NetBSD 4.0.
    434 
    435 @c
    436 @c
    437 @c
    438 @page
    439 @subsection pwd - print work directory
    440 
    441 @pgindex pwd
    442 
    443 @subheading SYNOPSYS:
    444 
    445 @example
    446 pwd
    447 @end example
    448 
    449 @subheading DESCRIPTION:
    450 
    451 This command prints the fully qualified filename of the current
    452 working directory.
    453 
    454 @subheading EXIT STATUS:
    455 
    456 This command returns 0 on success and non-zero if an error is encountered.
    457 
    458 @subheading NOTES:
    459 
    460 NONE
    461 
    462 @subheading EXAMPLES:
    463 
    464 The following is an example of how to use @code{pwd}:
    465 
    466 @example
    467 SHLL [/] $ pwd
    468 /
    469 SHLL [/] $ cd dev
    470 SHLL [/dev] $ pwd
    471 /dev
    472 @end example
    473 
    474 @subheading CONFIGURATION:
    475 
    476 @findex CONFIGURE_SHELL_NO_COMMAND_PWD
    477 @findex CONFIGURE_SHELL_COMMAND_PWD
    478 
    479 This command is included in the default shell command set.
    480 When building a custom command set, define
    481 @code{CONFIGURE_SHELL_COMMAND_PWD} to have this
    482 command included.
    483 
    484 This command can be excluded from the shell command set by
    485 defining @code{CONFIGURE_SHELL_NO_COMMAND_PWD} when all
    486 shell commands have been configured.
    487 
    488 @subheading PROGRAMMING INFORMATION:
    489 
    490 @findex rtems_shell_rtems_main_pwd
    491 
    492 The @code{pwd} is implemented by a C language function
    493 which has the following prototype:
    494 
    495 @example
    496 int rtems_shell_rtems_main_pwd(
    497   int    argc,
    498   char **argv
    499 );
    500 @end example
    501 
    502 The configuration structure for the @code{pwd} has the
    503 following prototype:
    504 
    505 @example
    506 extern rtems_shell_cmd_t rtems_shell_PWD_Command;
    507 @end example
    508 
    509 @c
    510 @c
    511 @c
    512 @page
    513 @subsection ls - list files in the directory
    514 
    515 @pgindex ls
    516 
    517 @subheading SYNOPSYS:
    518 
    519 @example
    520 ls [dir]
    521 @end example
    522 
    523 @subheading DESCRIPTION:
    524 
    525 This command displays the contents of the specified directory.  If
    526 no arguments are given, then it displays the contents of the current
    527 working directory.
    528 
    529 @subheading EXIT STATUS:
    530 
    531 This command returns 0 on success and non-zero if an error is encountered.
    532 
    533 @subheading NOTES:
    534 
    535 This command currently does not display information on a set of
    536 files like the POSIX ls(1).  It only displays the contents of
    537 entire directories.
    538 
    539 @subheading EXAMPLES:
    540 
    541 The following is an example of how to use @code{ls}:
    542 
    543 @example
    544 SHLL [/] $ ls
    545 drwxr-xr-x   1   root   root         536 Jan 01 00:00 dev/
    546 drwxr-xr-x   1   root   root        1072 Jan 01 00:00 etc/
    547 2 files 1608 bytes occupied
    548 SHLL [/] $ ls etc
    549 -rw-r--r--   1   root   root         102 Jan 01 00:00 passwd
    550 -rw-r--r--   1   root   root          42 Jan 01 00:00 group
    551 -rw-r--r--   1   root   root          30 Jan 01 00:00 issue
    552 -rw-r--r--   1   root   root          28 Jan 01 00:00 issue.net
    553 4 files 202 bytes occupied
    554 SHLL [/] $ ls dev etc
    555 -rwxr-xr-x   1  rtems   root           0 Jan 01 00:00 console
    556 -rwxr-xr-x   1   root   root           0 Jan 01 00:00 console_b
    557 @end example
    558 
    559 @subheading CONFIGURATION:
    560 
    561 @findex CONFIGURE_SHELL_NO_COMMAND_LS
    562 @findex CONFIGURE_SHELL_COMMAND_LS
    563 
    564 This command is included in the default shell command set.
    565 When building a custom command set, define
    566 @code{CONFIGURE_SHELL_COMMAND_LS} to have this
    567 command included.
    568 
    569 This command can be excluded from the shell command set by
    570 defining @code{CONFIGURE_SHELL_NO_COMMAND_LS} when all
    571 shell commands have been configured.
    572 
    573 @subheading PROGRAMMING INFORMATION:
    574 
    575 @findex rtems_shell_rtems_main_ls
    576 
    577 The @code{ls} is implemented by a C language function
    578 which has the following prototype:
    579 
    580 @example
    581 int rtems_shell_rtems_main_ls(
    582   int    argc,
    583   char **argv
    584 );
    585 @end example
    586 
    587 The configuration structure for the @code{ls} has the
    588 following prototype:
    589 
    590 @example
    591 extern rtems_shell_cmd_t rtems_shell_LS_Command;
     271extern rtems_shell_cmd_t rtems_shell_CD_Command;
    592272@end example
    593273
     
    665345@example
    666346extern rtems_shell_cmd_t rtems_shell_CHDIR_Command;
    667 @end example
    668 
    669 @c
    670 @c
    671 @c
    672 @page
    673 @subsection mkdir - create a directory
    674 
    675 @pgindex mkdir
    676 
    677 @subheading SYNOPSYS:
    678 
    679 @example
    680 mkdir  dir [dir1 .. dirN]
    681 @end example
    682 
    683 @subheading DESCRIPTION:
    684 
    685 This command creates the set of directories in the order they
    686 are specified on the command line.  If an error is encountered
    687 making one of the directories, the command will continue to
    688 attempt to create the remaining directories on the command line.
    689 
    690 @subheading EXIT STATUS:
    691 
    692 This command returns 0 on success and non-zero if an error is encountered.
    693 
    694 @subheading NOTES:
    695 
    696 If this command is invoked with no arguments, nothing occurs.
    697 
    698 The user must have sufficient permissions to create the directory.
    699 For the @code{fileio} test provided with RTEMS, this means the user
    700 must login as @code{root} not @code{rtems}.
    701 
    702 @subheading EXAMPLES:
    703 
    704 The following is an example of how to use @code{mkdir}:
    705 
    706 @example
    707 SHLL [/] # ls
    708 drwxr-xr-x   1   root   root         536 Jan 01 00:00 dev/
    709 drwxr-xr-x   1   root   root        1072 Jan 01 00:00 etc/
    710 2 files 1608 bytes occupied
    711 SHLL [/] # mkdir joel
    712 SHLL [/] # ls joel
    713 0 files 0 bytes occupied
    714 SHLL [/] # cp etc/passwd joel
    715 SHLL [/] # ls joel
    716 -rw-r--r--   1   root   root         102 Jan 01 00:02 passwd
    717 1 files 102 bytes occupied
    718 @end example
    719 
    720 @subheading CONFIGURATION:
    721 
    722 @findex CONFIGURE_SHELL_NO_COMMAND_MKDIR
    723 @findex CONFIGURE_SHELL_COMMAND_MKDIR
    724 
    725 This command is included in the default shell command set.
    726 When building a custom command set, define
    727 @code{CONFIGURE_SHELL_COMMAND_MKDIR} to have this
    728 command included.
    729 
    730 This command can be excluded from the shell command set by
    731 defining @code{CONFIGURE_SHELL_NO_COMMAND_MKDIR} when all
    732 shell commands have been configured.
    733 
    734 @subheading PROGRAMMING INFORMATION:
    735 
    736 @findex rtems_shell_rtems_main_mkdir
    737 
    738 The @code{mkdir} is implemented by a C language function
    739 which has the following prototype:
    740 
    741 @example
    742 int rtems_shell_rtems_main_mkdir(
    743   int    argc,
    744   char **argv
    745 );
    746 @end example
    747 
    748 The configuration structure for the @code{mkdir} has the
    749 following prototype:
    750 
    751 @example
    752 extern rtems_shell_cmd_t rtems_shell_MKDIR_Command;
    753 @end example
    754 
    755 @c
    756 @c
    757 @c
    758 @page
    759 @subsection rmdir - remove empty directories
    760 
    761 @pgindex rmdir
    762 
    763 @subheading SYNOPSYS:
    764 
    765 @example
    766 rmdir  [dir1 .. dirN]
    767 @end example
    768 
    769 @subheading DESCRIPTION:
    770 
    771 This command removes the specified set of directories.  If no
    772 directories are provided on the command line, no actions are taken.
    773 
    774 @subheading EXIT STATUS:
    775 
    776 This command returns 0 on success and non-zero if an error is encountered.
    777 
    778 @subheading NOTES:
    779 
    780 This command is a implemented using the @code{rmdir(2)} system
    781 call and all reasons that call may fail apply to this command.
    782 
    783 @subheading EXAMPLES:
    784 
    785 The following is an example of how to use @code{rmdir}:
    786 
    787 @example
    788 SHLL [/] # mkdir joeldir
    789 SHLL [/] # rmdir joeldir
    790 SHLL [/] # ls joeldir
    791 joeldir: No such file or directory.
    792 @end example
    793 
    794 @subheading CONFIGURATION:
    795 
    796 @findex CONFIGURE_SHELL_NO_COMMAND_RMDIR
    797 @findex CONFIGURE_SHELL_COMMAND_RMDIR
    798 
    799 This command is included in the default shell command set.
    800 When building a custom command set, define
    801 @code{CONFIGURE_SHELL_COMMAND_RMDIR} to have this
    802 command included.
    803 
    804 This command can be excluded from the shell command set by
    805 defining @code{CONFIGURE_SHELL_NO_COMMAND_RMDIR} when all
    806 shell commands have been configured.
    807 
    808 @subheading PROGRAMMING INFORMATION:
    809 
    810 @findex rtems_shell_rtems_main_rmdir
    811 
    812 The @code{rmdir} is implemented by a C language function
    813 which has the following prototype:
    814 
    815 @example
    816 int rtems_shell_rtems_main_rmdir(
    817   int    argc,
    818   char **argv
    819 );
    820 @end example
    821 
    822 The configuration structure for the @code{rmdir} has the
    823 following prototype:
    824 
    825 @example
    826 extern rtems_shell_cmd_t rtems_shell_RMDIR_Command;
    827 @end example
    828 
    829 @c
    830 @c
    831 @c
    832 @page
    833 @subsection ln - make links
    834 
    835 @pgindex ln
    836 
    837 @subheading SYNOPSYS:
    838 
    839 @example
    840 ln [-fhinsv] source_file [target_file]
    841 ln [-fhinsv] source_file ... target_dir
    842 @end example
    843 
    844 @subheading DESCRIPTION:
    845 
    846 The ln utility creates a new directory entry (linked file) which has
    847 the same modes as the original file.  It is useful for maintaining
    848 multiple copies of a file in many places at once without using up
    849 storage for the ``copies''; instead, a link ``points'' to the original
    850 copy.  There are two types of links; hard links and symbolic links.
    851 How a link ``points'' to a file is one of the differences between a
    852 hard or symbolic link.
    853 
    854 The options are as follows:
    855 @table @b
    856 @item -f
    857 Unlink any already existing file, permitting the link to occur.
    858 
    859 @item -h
    860 If the target_file or target_dir is a symbolic link, do not follow it.
    861 This is most useful with the -f option, to replace a symlink which may
    862 point to a directory.
    863 
    864 @item -i
    865 Cause ln to write a prompt to standard error if the target file
    866 exists.  If the response from the standard input begins with the
    867 character `y' or `Y', then unlink the target file so that the link may
    868 occur.  Otherwise, do not attempt the link.  (The -i option overrides
    869 any previous -f options.)
    870 
    871 @item -n
    872 Same as -h, for compatibility with other ln implementations.
    873 
    874 @item -s
    875 Create a symbolic link.
    876 
    877 @item -v
    878 Cause ln to be verbose, showing files as they are processed.
    879 @end table
    880 
    881 By default ln makes hard links.  A hard link to a file is
    882 indistinguishable from the original directory entry; any changes to a
    883 file are effective independent of the name used to reference the file.
    884 Hard links may not normally refer to directories and may not span file
    885 systems.
    886 
    887 A symbolic link contains the name of the file to which it is linked.
    888 The referenced file is used when an @i{open} operation is performed on
    889 the link.  A @i{stat} on a symbolic link will return the linked-to
    890 file; an @i{lstat} must be done to obtain information about the link.
    891 The @i{readlink} call may be used to read the contents of a symbolic
    892 link.  Symbolic links may span file systems and may refer to
    893 directories.
    894 
    895 Given one or two arguments, ln creates a link to an existing file
    896 source_file.  If target_file is given, the link has that name;
    897 target_file may also be a directory in which to place the link;
    898 otherwise it is placed in the current directory.  If only the
    899 directory is specified, the link will be made to the last component of
    900 source_file.
    901 
    902 Given more than two arguments, ln makes links in target_dir to all the
    903 named source files.  The links made will have the same name as the
    904 files being linked to.
    905 
    906 @subheading EXIT STATUS:
    907 
    908 The @code{ln} utility exits 0 on success, and >0 if an error occurs.
    909 
    910 @subheading NOTES:
    911 
    912 NONE
    913 
    914 @subheading EXAMPLES:
    915 
    916 @example
    917 SHLL [/] ln -s /dev/console /dev/con1
    918 @end example
    919 
    920 @subheading CONFIGURATION:
    921 
    922 @findex CONFIGURE_SHELL_NO_COMMAND_LN
    923 @findex CONFIGURE_SHELL_COMMAND_LN
    924 
    925 This command is included in the default shell command set.  When
    926 building a custom command set, define
    927 @code{CONFIGURE_SHELL_COMMAND_LN} to have this command included.
    928 
    929 This command can be excluded from the shell command set by
    930 defining @code{CONFIGURE_SHELL_NO_COMMAND_LN} when all
    931 shell commands have been configured.
    932 
    933 @subheading PROGRAMMING INFORMATION:
    934 
    935 @findex rtems_shell_rtems_main_ln
    936 
    937 The @code{ln} command is implemented by a C language function which
    938 has the following prototype:
    939 
    940 @example
    941 int rtems_shell_rtems_main_ln(
    942   int    argc,
    943   char **argv
    944 );
    945 @end example
    946 
    947 The configuration structure for the @code{ln} has the following
    948 prototype:
    949 
    950 @example
    951 extern rtems_shell_cmd_t rtems_shell_LN_Command;
    952 @end example
    953 
    954 @subheading ORIGIN:
    955 
    956 The implementation and portions of the documentation for this command
    957 are from NetBSD 4.0.
    958 
    959 @c
    960 @c
    961 @c
    962 @page
    963 @subsection mknod - make device special file
    964 
    965 @pgindex mknod
    966 
    967 @subheading SYNOPSYS:
    968 
    969 @example
    970 mknod [-rR] [-F fmt] [-g gid] [-m mode] [-u uid] name [c | b]
    971       [driver | major] minor
    972 mknod [-rR] [-F fmt] [-g gid] [-m mode] [-u uid] name [c | b]
    973       major unit subunit
    974 mknod [-rR] [-g gid] [-m mode] [-u uid] name [c | b] number
    975 mknod [-rR] [-g gid] [-m mode] [-u uid] name p
    976 @end example
    977 
    978 @subheading DESCRIPTION:
    979 
    980 The mknod command creates device special files, or fifos.  Normally
    981 the shell script /dev/MAKEDEV is used to create special files for
    982 commonly known devices; it executes mknod with the appropriate
    983 arguments and can make all the files required for the device.
    984 
    985 To make nodes manually, the arguments are:
    986 
    987 @table @b
    988 @item -r
    989 Replace an existing file if its type is incorrect.
    990 
    991 @item -R
    992 Replace an existing file if its type is incorrect.  Correct the
    993 mode, user and group.
    994 
    995 @item -g gid
    996 Specify the group for the device node.  The gid operand may be a
    997 numeric group ID or a group name.  If a group name is also a numeric
    998 group ID, the operand is used as a group name.  Precede a numeric
    999 group ID with a # to stop it being treated as a name.
    1000 
    1001 @item -m mode
    1002 Specify the mode for the device node.  The mode may be absolute or
    1003 symbolic, see @i{chmod}.
    1004 
    1005 @item -u uid
    1006 Specify the user for the device node.  The uid operand may be a
    1007 numeric user ID or a user name.  If a user name is also a numeric user
    1008 ID, the operand is used as a user name.  Precede a numeric user ID
    1009 with a # to stop it being treated as a name.
    1010 
    1011 @item name
    1012 Device name, for example ``tty'' for a termios serial device or ``hd''
    1013 for a disk.
    1014 
    1015 @item  b | c | p
    1016 Type of device.  If the device is a block type device such as a tape
    1017 or disk drive which needs both cooked and raw special files, the type
    1018 is b.  All other devices are character type devices, such as terminal
    1019 and pseudo devices, and are type c.  Specifying p creates fifo files.
    1020 
    1021 @item driver | major
    1022 The major device number is an integer number which tells the kernel
    1023 which device driver entry point to use.  If the device driver is
    1024 configured into the current kernel it may be specified by driver name
    1025 or major number.
    1026 
    1027 @item minor
    1028 The minor device number tells the kernel which one of several similar
    1029 devices the node corresponds to; for example, it may be a specific
    1030 serial port or pty.
    1031 
    1032 @item unit and subunit
    1033 The unit and subunit numbers select a subset of a device; for example,
    1034 the unit may specify a particular disk, and the subunit a partition on
    1035 that disk.  (Currently this form of specification is only supported
    1036 by the bsdos format, for compatibility with the BSD/OS mknod).
    1037 
    1038 @item number
    1039 A single opaque device number.  Useful for netbooted computers which
    1040 require device numbers packed in a format that isn't supported by
    1041 -F.
    1042 @end table
    1043 
    1044 @subheading EXIT STATUS:
    1045 
    1046 The @code{mknod} utility exits 0 on success, and >0 if an error occurs.
    1047 
    1048 @subheading NOTES:
    1049 
    1050 NONE
    1051 
    1052 @subheading EXAMPLES:
    1053 
    1054 @example
    1055 SHLL [/] mknod c 3 0 /dev/ttyS10
    1056 @end example
    1057 
    1058 @subheading CONFIGURATION:
    1059 
    1060 @findex CONFIGURE_SHELL_NO_COMMAND_MKNOD
    1061 @findex CONFIGURE_SHELL_COMMAND_MKNOD
    1062 
    1063 This command is included in the default shell command set.  When
    1064 building a custom command set, define
    1065 @code{CONFIGURE_SHELL_COMMAND_MKNOD} to have this command included.
    1066 
    1067 This command can be excluded from the shell command set by
    1068 defining @code{CONFIGURE_SHELL_NO_COMMAND_MKNOD} when all
    1069 shell commands have been configured.
    1070 
    1071 @subheading PROGRAMMING INFORMATION:
    1072 
    1073 @findex rtems_shell_rtems_main_mknod
    1074 
    1075 The @code{mknod} command is implemented by a C language function which
    1076 has the following prototype:
    1077 
    1078 @example
    1079 int rtems_shell_rtems_main_mknod(
    1080   int    argc,
    1081   char **argv
    1082 );
    1083 @end example
    1084 
    1085 The configuration structure for the @code{mknod} has the following
    1086 prototype:
    1087 
    1088 @example
    1089 extern rtems_shell_cmd_t rtems_shell_MKNOD_Command;
    1090 @end example
    1091 
    1092 @subheading ORIGIN:
    1093 
    1094 The implementation and portions of the documentation for this command
    1095 are from NetBSD 4.0.
    1096 
    1097 @c
    1098 @c
    1099 @c
    1100 @page
    1101 @subsection chroot - change the root directory
    1102 
    1103 @pgindex chroot
    1104 
    1105 @subheading SYNOPSYS:
    1106 
    1107 @example
    1108 chroot [dir]
    1109 @end example
    1110 
    1111 @subheading DESCRIPTION:
    1112 
    1113 This command changes the root directory to @code{dir} for subsequent
    1114 commands.
    1115 
    1116 @subheading EXIT STATUS:
    1117 
    1118 This command returns 0 on success and non-zero if an error is encountered.
    1119 
    1120 The destination directory @code{dir} must exist.
    1121 
    1122 @subheading NOTES:
    1123 
    1124 NONE
    1125 
    1126 @subheading EXAMPLES:
    1127 
    1128 The following is an example of how to use @code{chroot}
    1129 and the impact it has on the environment for subsequent
    1130 command invocations:
    1131 
    1132 @example
    1133 SHLL [/] $ cat passwd
    1134 cat: passwd: No such file or directory
    1135 SHLL [/] $ chroot etc
    1136 SHLL [/] $ cat passwd
    1137 root:*:0:0:root::/:/bin/sh
    1138 rtems:*:1:1:RTEMS Application::/:/bin/sh
    1139 tty:!:2:2:tty owner::/:/bin/false
    1140 SHLL [/] $ cat /etc/passwd
    1141 cat: /etc/passwd: No such file or directory
    1142 @end example
    1143 
    1144 @subheading CONFIGURATION:
    1145 
    1146 @findex CONFIGURE_SHELL_NO_COMMAND_CHROOT
    1147 @findex CONFIGURE_SHELL_COMMAND_CHROOT
    1148 
    1149 This command is included in the default shell command set.
    1150 When building a custom command set, define
    1151 @code{CONFIGURE_SHELL_COMMAND_CHROOT} to have this
    1152 command included. Additional to that you have to add one
    1153 POSIX key value pair for each thread where you want to use
    1154 the command.
    1155 
    1156 This command can be excluded from the shell command set by
    1157 defining @code{CONFIGURE_SHELL_NO_COMMAND_CHROOT} when all
    1158 shell commands have been configured.
    1159 
    1160 @subheading PROGRAMMING INFORMATION:
    1161 
    1162 @findex rtems_shell_rtems_main_chroot
    1163 
    1164 The @code{chroot} is implemented by a C language function
    1165 which has the following prototype:
    1166 
    1167 @example
    1168 int rtems_shell_rtems_main_chroot(
    1169   int    argc,
    1170   char **argv
    1171 );
    1172 @end example
    1173 
    1174 The configuration structure for the @code{chroot} has the
    1175 following prototype:
    1176 
    1177 @example
    1178 extern rtems_shell_cmd_t rtems_shell_CHROOT_Command;
    1179347@end example
    1180348
     
    1283451@c
    1284452@page
    1285 @subsection cat - display file contents
    1286 
    1287 @pgindex cat
     453@subsection chroot - change the root directory
     454
     455@pgindex chroot
    1288456
    1289457@subheading SYNOPSYS:
    1290458
    1291459@example
    1292 cat file1 [file2 .. fileN]
     460chroot [dir]
    1293461@end example
    1294462
    1295463@subheading DESCRIPTION:
    1296464
    1297 This command displays the contents of the specified files.
     465This command changes the root directory to @code{dir} for subsequent
     466commands.
    1298467
    1299468@subheading EXIT STATUS:
     
    1301470This command returns 0 on success and non-zero if an error is encountered.
    1302471
     472The destination directory @code{dir} must exist.
     473
    1303474@subheading NOTES:
    1304475
    1305 It is possible to read the input from a device file using @code{cat}.
     476NONE
    1306477
    1307478@subheading EXAMPLES:
    1308479
    1309 The following is an example of how to use @code{cat}:
    1310 
    1311 @example
    1312 SHLL [/] # cat /etc/passwd
     480The following is an example of how to use @code{chroot}
     481and the impact it has on the environment for subsequent
     482command invocations:
     483
     484@example
     485SHLL [/] $ cat passwd
     486cat: passwd: No such file or directory
     487SHLL [/] $ chroot etc
     488SHLL [/] $ cat passwd
    1313489root:*:0:0:root::/:/bin/sh
    1314490rtems:*:1:1:RTEMS Application::/:/bin/sh
    1315491tty:!:2:2:tty owner::/:/bin/false
     492SHLL [/] $ cat /etc/passwd
     493cat: /etc/passwd: No such file or directory
    1316494@end example
    1317495
    1318496@subheading CONFIGURATION:
    1319497
    1320 @findex CONFIGURE_SHELL_NO_COMMAND_CAT
    1321 @findex CONFIGURE_SHELL_COMMAND_CAT
     498@findex CONFIGURE_SHELL_NO_COMMAND_CHROOT
     499@findex CONFIGURE_SHELL_COMMAND_CHROOT
    1322500
    1323501This command is included in the default shell command set.
    1324502When building a custom command set, define
    1325 @code{CONFIGURE_SHELL_COMMAND_CAT} to have this
    1326 command included.
     503@code{CONFIGURE_SHELL_COMMAND_CHROOT} to have this
     504command included. Additional to that you have to add one
     505POSIX key value pair for each thread where you want to use
     506the command.
    1327507
    1328508This command can be excluded from the shell command set by
    1329 defining @code{CONFIGURE_SHELL_NO_COMMAND_CAT} when all
     509defining @code{CONFIGURE_SHELL_NO_COMMAND_CHROOT} when all
    1330510shell commands have been configured.
    1331511
    1332512@subheading PROGRAMMING INFORMATION:
    1333513
    1334 @findex rtems_shell_rtems_main_cat
    1335 
    1336 The @code{cat} is implemented by a C language function
     514@findex rtems_shell_rtems_main_chroot
     515
     516The @code{chroot} is implemented by a C language function
    1337517which has the following prototype:
    1338518
    1339519@example
    1340 int rtems_shell_rtems_main_cat(
     520int rtems_shell_rtems_main_chroot(
    1341521  int    argc,
    1342522  char **argv
     
    1344524@end example
    1345525
    1346 The configuration structure for the @code{cat} has the
     526The configuration structure for the @code{chroot} has the
    1347527following prototype:
    1348528
    1349529@example
    1350 extern rtems_shell_cmd_t rtems_shell_CAT_Command;
     530extern rtems_shell_cmd_t rtems_shell_CHROOT_Command;
    1351531@end example
    1352532
     
    1355535@c
    1356536@page
    1357 @subsection rm - remove files
    1358 
    1359 @pgindex rm
     537@subsection cp - copy files
     538
     539@pgindex cp
    1360540
    1361541@subheading SYNOPSYS:
    1362542
    1363543@example
    1364 rm file1 [file2 ... fileN]
     544cp [-R [-H | -L | -P]] [-f | -i] [-pv] src target
     545cp [-R [-H | -L] ] [-f | -i] [-NpPv] source_file ... target_directory
    1365546@end example
    1366547
    1367548@subheading DESCRIPTION:
    1368549
    1369 This command deletes a name from the filesystem.  If the specified file name
    1370 was the last link to a file and there are no @code{open} file descriptor
    1371 references to that file, then it is deleted and the associated space in
    1372 the file system is made available for subsequent use.
    1373 
    1374 If the filename specified was the last link to a file but there
    1375 are open file descriptor references to it, then the file will
    1376 remain in existence until the last file descriptor referencing
    1377 it is closed.
     550In the first synopsis form, the cp utility copies the contents of the
     551source_file to the target_file. In the second synopsis form, the contents of
     552each named source_file is copied to the destination target_directory. The names
     553of the files themselves are not changed. If cp detects an attempt to copy a
     554file to itself, the copy will fail.
     555
     556The following options are available:
     557
     558@table @b
     559@item -f
     560For each existing destination pathname, attempt to overwrite it. If permissions
     561do not allow copy to succeed, remove it and create a new file, without
     562prompting for confirmation. (The -i option is ignored if the -f option is
     563specified.)
     564
     565@item -H
     566If the -R option is specified, symbolic links on the command line are followed.
     567(Symbolic links encountered in the tree traversal are not followed.)
     568
     569@item -i
     570Causes cp to write a prompt to the standard error output before copying a file
     571that would overwrite an existing file. If the response from the standard input
     572begins with the character 'y', the file copy is attempted.
     573
     574@item -L
     575If the -R option is specified, all symbolic links are followed.
     576
     577@item -N
     578When used with -p, do not copy file flags.
     579
     580@item -P
     581No symbolic links are followed.
     582
     583@item -p
     584Causes cp to preserve in the copy as many of the modification time, access
     585time, file flags, file mode, user ID, and group ID as allowed by permissions.
     586
     587If the user ID and group ID cannot be preserved, no error message is displayed
     588and the exit value is not altered.
     589
     590If the source file has its set user ID bit on and the user ID cannot be
     591preserved, the set user ID bit is not preserved in the copy's permissions. If
     592the source file has its set group ID bit on and the group ID cannot be
     593preserved, the set group ID bit is not preserved in the copy's permissions. If
     594the source file has both its set user ID and set group ID bits on, and either
     595the user ID or group ID cannot be preserved, neither the set user ID or set
     596group ID bits are preserved in the copy's permissions.
     597
     598@item -R
     599If source_file designates a directory, cp copies the directory and the entire
     600subtree connected at that point. This option also causes symbolic links to be
     601copied, rather than indirected through, and for cp to create special files
     602rather than copying them as normal files. Created directories have the same
     603mode as the corresponding source directory, unmodified by the process's umask.
     604
     605@item -v
     606Cause cp to be verbose, showing files as they are copied.
     607
     608@end table
     609
     610For each destination file that already exists, its contents are overwritten if
     611permissions allow, but its mode, user ID, and group ID are unchanged.
     612
     613In the second synopsis form, target_directory must exist unless there is only
     614one named source_file which is a directory and the -R flag is specified.
     615
     616If the destination file does not exist, the mode of the source file is used as
     617modified by the file mode creation mask (umask, see csh(1)). If the source file
     618has its set user ID bit on, that bit is removed unless both the source file and
     619the destination file are owned by the same user. If the source file has its set
     620group ID bit on, that bit is removed unless both the source file and the
     621destination file are in the same group and the user is a member of that group.
     622If both the set user ID and set group ID bits are set, all of the above
     623conditions must be fulfilled or both bits are removed.
     624
     625Appropriate permissions are required for file creation or overwriting.
     626
     627Symbolic links are always followed unless the -R flag is set, in which case
     628symbolic links are not followed, by default. The -H or -L flags (in conjunction
     629with the -R flag), as well as the -P flag cause symbolic links to be followed
     630as described above. The -H and -L options are ignored unless the -R option is
     631specified. In addition, these options override eachsubhedading other and the
     632command's actions are determined by the last one specified.
    1378633
    1379634@subheading EXIT STATUS:
     
    1387642@subheading EXAMPLES:
    1388643
    1389 The following is an example of how to use @code{rm}:
    1390 
    1391 @example
    1392 SHLL [/] # cp /etc/passwd tmpfile
    1393 SHLL [/] # cat tmpfile
     644The following is an example of how to use @code{cp} to
     645copy a file to a new name in the current directory:
     646
     647@example
     648SHLL [/] # cat joel
     649cat: joel: No such file or directory
     650SHLL [/] # cp etc/passwd joel
     651SHLL [/] # cat joel
    1394652root:*:0:0:root::/:/bin/sh
    1395653rtems:*:1:1:RTEMS Application::/:/bin/sh
    1396654tty:!:2:2:tty owner::/:/bin/false
    1397 SHLL [/] # rm tmpfile
    1398 SHLL [/] # cat tmpfile
    1399 cat: tmpfile: No such file or directory
     655SHLL [/] # ls
     656drwxr-xr-x   1   root   root         536 Jan 01 00:00 dev/
     657drwxr-xr-x   1   root   root        1072 Jan 01 00:00 etc/
     658-rw-r--r--   1   root   root         102 Jan 01 00:00 joel
     6593 files 1710 bytes occupied
     660@end example
     661
     662The following is an example of how to use @code{cp} to
     663copy one or more files to a destination directory and
     664use the same @code{basename} in the destination directory:
     665
     666@example
     667SHLL [/] # mkdir tmp
     668SHLL [/] # ls tmp
     6690 files 0 bytes occupied
     670SHLL [/] # cp /etc/passwd tmp
     671SHLL [/] # ls /tmp
     672-rw-r--r--   1   root   root         102 Jan 01 00:01 passwd
     6731 files 102 bytes occupied
     674SHLL [/] # cp /etc/passwd /etc/group /tmp
     675SHLL [/] # ls /tmp
     676-rw-r--r--   1   root   root         102 Jan 01 00:01 passwd
     677-rw-r--r--   1   root   root          42 Jan 01 00:01 group
     6782 files 144 bytes occupied
     679SHLL [/] #
    1400680@end example
    1401681
    1402682@subheading CONFIGURATION:
    1403683
    1404 @findex CONFIGURE_SHELL_NO_COMMAND_RM
    1405 @findex CONFIGURE_SHELL_COMMAND_RM
     684@findex CONFIGURE_SHELL_NO_COMMAND_CP
     685@findex CONFIGURE_SHELL_COMMAND_CP
    1406686
    1407687This command is included in the default shell command set.
    1408688When building a custom command set, define
    1409 @code{CONFIGURE_SHELL_COMMAND_RM} to have this
     689@code{CONFIGURE_SHELL_COMMAND_CP} to have this
    1410690command included.
    1411691
    1412692This command can be excluded from the shell command set by
    1413 defining @code{CONFIGURE_SHELL_NO_COMMAND_RM} when all
     693defining @code{CONFIGURE_SHELL_NO_COMMAND_CP} when all
    1414694shell commands have been configured.
    1415695
    1416696@subheading PROGRAMMING INFORMATION:
    1417697
    1418 @findex rtems_shell_rtems_main_rm
    1419 
    1420 The @code{rm} is implemented by a C language function
    1421 which has the following prototype:
    1422 
    1423 @example
    1424 int rtems_shell_rtems_main_rm(
     698@findex rtems_shell_rtems_main_cp
     699
     700The @code{cp} command is implemented by a C language function which
     701has the following prototype:
     702
     703@example
     704int rtems_shell_rtems_main_cp(
    1425705  int    argc,
    1426706  char **argv
     
    1428708@end example
    1429709
    1430 The configuration structure for the @code{rm} has the
     710The configuration structure for the @code{cp} has the
    1431711following prototype:
    1432712
    1433713@example
    1434 extern rtems_shell_cmd_t rtems_shell_RM_Command;
    1435 @end example
    1436 
    1437 @c
    1438 @c
    1439 @c
    1440 @page
    1441 @subsection mount - mount disk
    1442 
    1443 @pgindex mount
    1444 
    1445 @subheading SYNOPSYS:
    1446 
    1447 @example
    1448 mount [-t fstype] [-r] [-L] device path
    1449 @end example
    1450 
    1451 @subheading DESCRIPTION:
    1452 
    1453 The @code{mount} command will mount a block device to a mount point
    1454 using the specified file system. The files systems are:
    1455 
    1456 @itemize @bullet
    1457 @item msdos - MSDOS File System
    1458 @item tftp  - TFTP Network File System
    1459 @item ftp   - FTP Network File System
    1460 @item nfs   - Network File System
    1461 @item rfs   - RTEMS File System
    1462 @end itemize
    1463 
    1464 When the file system type is 'msdos' or 'rfs' the driver is a "block
    1465 device driver" node present in the file system. The driver is ignored
    1466 with the 'tftp' and 'ftp' file systems. For the 'nfs' file system the
    1467 driver is the 'host:/path' string that described NFS host and the
    1468 exported file system path.
    1469 
    1470 @subheading EXIT STATUS:
    1471 
    1472 This command returns 0 on success and non-zero if an error is encountered.
    1473 
    1474 @subheading NOTES:
    1475 
    1476 The mount point must exist.
    1477 
    1478 The services offered by each file-system vary. For example you cannot list the
    1479 directory of a TFTP file-system as this server is not provided in the TFTP
    1480 protocol. You need to check each file-system's documentation for the services
    1481 provided.
    1482 
    1483 @subheading EXAMPLES:
    1484 
    1485 Mount the Flash Disk driver to the '/fd' mount point:
    1486 
    1487 @example
    1488 SHLL [/] $ mount -t msdos /dev/flashdisk0 /fd
    1489 @end example
    1490 
    1491 Mount the NFS file system exported path 'bar' by host 'foo':
    1492 
    1493 @example
    1494 $ mount -t nfs foo:/bar /nfs
    1495 @end example
    1496 
    1497 Mount the TFTP file system on '/tftp':
    1498 
    1499 @example
    1500 $ mount -t tftp /tftp
    1501 @end example
    1502 
    1503 To access the TFTP files on server '10.10.10.10':
    1504 
    1505 @example
    1506 $ cat /tftp/10.10.10.10/test.txt
    1507 @end example
    1508 
    1509 @subheading CONFIGURATION:
    1510 
    1511 @findex CONFIGURE_SHELL_NO_COMMAND_MOUNT
    1512 @findex CONFIGURE_SHELL_COMMAND_MOUNT
    1513 
    1514 This command is included in the default shell command set.
    1515 When building a custom command set, define
    1516 @code{CONFIGURE_SHELL_COMMAND_MOUNT} to have this
    1517 command included.
    1518 
    1519 This command can be excluded from the shell command set by
    1520 defining @code{CONFIGURE_SHELL_NO_COMMAND_MOUNT} when all
    1521 shell commands have been configured.
    1522 
    1523 The mount command includes references to file-system code. If you do not wish
    1524 to include file-system that you do not use do not define the mount command
    1525 support for that file-system. The file-system mount command defines are:
    1526 
    1527 @itemize @bullet
    1528 @item msdos - CONFIGURE_SHELL_MOUNT_MSDOS
    1529 @item tftp - CONFIGURE_SHELL_MOUNT_TFTP
    1530 @item ftp - CONFIGURE_SHELL_MOUNT_FTP
    1531 @item nfs - CONFIGURE_SHELL_MOUNT_NFS
    1532 @item rfs - CONFIGURE_SHELL_MOUNT_RFS
    1533 @end itemize
    1534 
    1535 An example configuration is:
    1536 
    1537 @example
    1538 #define CONFIGURE_SHELL_MOUNT_MSDOS
    1539 #ifdef RTEMS_NETWORKING
    1540   #define CONFIGURE_SHELL_MOUNT_TFTP
    1541   #define CONFIGURE_SHELL_MOUNT_FTP
    1542   #define CONFIGURE_SHELL_MOUNT_NFS
    1543   #define CONFIGURE_SHELL_MOUNT_RFS
    1544 #endif
    1545 @end example
    1546 
    1547 @subheading PROGRAMMING INFORMATION:
    1548 
    1549 @findex rtems_shell_rtems_main_mount
    1550 
    1551 The @code{mount} is implemented by a C language function
    1552 which has the following prototype:
    1553 
    1554 @example
    1555 int rtems_shell_rtems_main_mount(
    1556   int    argc,
    1557   char **argv
    1558 );
    1559 @end example
    1560 
    1561 The configuration structure for the @code{mount} has the
    1562 following prototype:
    1563 
    1564 @example
    1565 extern rtems_shell_cmd_t rtems_shell_MOUNT_Command;
    1566 @end example
    1567 
    1568 @c
    1569 @c
    1570 @c
    1571 @page
    1572 @subsection unmount - unmount disk
    1573 
    1574 @pgindex unmount
    1575 
    1576 @subheading SYNOPSYS:
    1577 
    1578 @example
    1579 unmount path
    1580 @end example
    1581 
    1582 @subheading DESCRIPTION:
    1583 
    1584 This command unmounts the device at the specified @code{path}.
    1585 
    1586 @subheading EXIT STATUS:
    1587 
    1588 This command returns 0 on success and non-zero if an error is encountered.
    1589 
    1590 @subheading NOTES:
    1591 
    1592 TBD - Surely there must be some warnings to go here.
    1593 
    1594 @subheading EXAMPLES:
    1595 
    1596 The following is an example of how to use @code{unmount}:
    1597 
    1598 @example
    1599 EXAMPLE_TBD
    1600 @end example
    1601 
    1602 @subheading CONFIGURATION:
    1603 
    1604 @findex CONFIGURE_SHELL_NO_COMMAND_UNMOUNT
    1605 @findex CONFIGURE_SHELL_COMMAND_UNMOUNT
    1606 
    1607 This command is included in the default shell command set.
    1608 When building a custom command set, define
    1609 @code{CONFIGURE_SHELL_COMMAND_UNMOUNT} to have this
    1610 command included.
    1611 
    1612 This command can be excluded from the shell command set by
    1613 defining @code{CONFIGURE_SHELL_NO_COMMAND_UNMOUNT} when all
    1614 shell commands have been configured.
    1615 
    1616 @subheading PROGRAMMING INFORMATION:
    1617 
    1618 @findex rtems_shell_rtems_main_unmount
    1619 
    1620 The @code{unmount} is implemented by a C language function
    1621 which has the following prototype:
    1622 
    1623 @example
    1624 int rtems_shell_rtems_main_unmount(
    1625   int    argc,
    1626   char **argv
    1627 );
    1628 @end example
    1629 
    1630 The configuration structure for the @code{unmount} has the
    1631 following prototype:
    1632 
    1633 @example
    1634 extern rtems_shell_cmd_t rtems_shell_UNMOUNT_Command;
    1635 @end example
    1636 
    1637 @c
    1638 @c
    1639 @c
    1640 @page
    1641 @subsection blksync - sync the block driver
    1642 
    1643 @pgindex blksync
    1644 
    1645 @subheading SYNOPSYS:
    1646 
    1647 @example
    1648 blksync driver
    1649 @end example
    1650 
    1651 @subheading DESCRIPTION:
    1652 
    1653 This command XXX
    1654 
    1655 @subheading EXIT STATUS:
    1656 
    1657 This command returns 0 on success and non-zero if an error is encountered.
    1658 
    1659 @subheading NOTES:
    1660 
    1661 NONE
    1662 
    1663 @subheading EXAMPLES:
    1664 
    1665 The following is an example of how to use @code{blksync}:
    1666 
    1667 @example
    1668 EXAMPLE_TBD
    1669 @end example
    1670 
    1671 @subheading CONFIGURATION:
    1672 
    1673 @findex CONFIGURE_SHELL_NO_COMMAND_BLKSYNC
    1674 @findex CONFIGURE_SHELL_COMMAND_BLKSYNC
    1675 
    1676 This command is included in the default shell command set.
    1677 When building a custom command set, define
    1678 @code{CONFIGURE_SHELL_COMMAND_BLKSYNC} to have this
    1679 command included.
    1680 
    1681 This command can be excluded from the shell command set by
    1682 defining @code{CONFIGURE_SHELL_NO_COMMAND_BLKSYNC} when all
    1683 shell commands have been configured.
    1684 
    1685 @subheading PROGRAMMING INFORMATION:
    1686 
    1687 @findex rtems_shell_rtems_main_blksync
    1688 
    1689 The @code{blksync} is implemented by a C language function
    1690 which has the following prototype:
    1691 
    1692 @example
    1693 int rtems_shell_rtems_main_blksync(
    1694   int    argc,
    1695   char **argv
    1696 );
    1697 @end example
    1698 
    1699 The configuration structure for the @code{blksync} has the
    1700 following prototype:
    1701 
    1702 @example
    1703 extern rtems_shell_cmd_t rtems_shell_BLKSYNC_Command;
    1704 @end example
     714extern rtems_shell_cmd_t rtems_shell_CP_Command;
     715@end example
     716
     717@subheading ORIGIN:
     718
     719The implementation and portions of the documentation for this
     720command are from NetBSD 4.0.
    1705721
    1706722@c
     
    1953969extern rtems_shell_cmd_t rtems_shell_DD_Command;
    1954970@end example
     971
     972@c
     973@c
     974@c
     975@page
     976@subsection debugrfs - debug RFS file system
     977
     978@pgindex debugrfs
     979
     980@subheading SYNOPSYS:
     981
     982@example
     983debugrfs [-hl] path command [options]
     984@end example
     985
     986@subheading DESCRIPTION:
     987
     988The command provides debugging information for the RFS file system.
     989
     990The options are:
     991
     992@table @b
     993@item -h
     994Print a help message.
     995
     996@item -l
     997List the commands.
     998
     999@item path
     1000Path to the mounted RFS file system. The file system has to be mounted
     1001to view to use this command.
     1002@end table
     1003
     1004The commands are:
     1005
     1006@table @b
     1007@item block start [end]
     1008Display the contents of the blocks from start to end.
     1009
     1010@item data
     1011Display the file system data and configuration.
     1012
     1013@item dir bno
     1014Process the block as a directory displaying the entries.
     1015
     1016@item group start [end]
     1017Display the group data from the start group to the end group.
     1018
     1019@item inode [-aef] [start] [end]
     1020Display the inodes between start and end. If no start and end is
     1021provides all inodes are displayed.
     1022
     1023@table @b
     1024@item -a
     1025Display all inodes. That is allocated and unallocated inodes.
     1026@item -e
     1027Search and display on inodes that have an error.
     1028@item -f
     1029Force display of inodes, even when in error.
     1030@end table
     1031@end table
     1032
     1033@subheading EXIT STATUS:
     1034
     1035This command returns 0 on success and non-zero if an error is encountered.
     1036
     1037@subheading NOTES:
     1038
     1039NONE
     1040
     1041@subheading EXAMPLES:
     1042
     1043The following is an example of how to use @code{debugrfs}:
     1044
     1045@example
     1046SHLL [/] $ debugrfs /c data
     1047@end example
     1048
     1049@subheading CONFIGURATION:
     1050
     1051@findex CONFIGURE_SHELL_NO_COMMAND_DEBUGRFS
     1052@findex CONFIGURE_SHELL_COMMAND_DEBUGRFS
     1053
     1054This command is included in the default shell command set.
     1055When building a custom command set, define
     1056@code{CONFIGURE_SHELL_COMMAND_DEBUGRFS} to have this
     1057command included.
     1058
     1059This command can be excluded from the shell command set by
     1060defining @code{CONFIGURE_SHELL_NO_COMMAND_DEBUGRFS} when all
     1061shell commands have been configured.
     1062
     1063@subheading PROGRAMMING INFORMATION:
     1064
     1065@findex rtems_shell_rtems_main_debugrfs
     1066
     1067The @code{debugrfs} command is implemented by a C language function which
     1068has the following prototype:
     1069
     1070@example
     1071int rtems_shell_rtems_main_debugrfs(
     1072  int    argc,
     1073  char **argv
     1074);
     1075@end example
     1076
     1077The configuration structure for @code{debugrfs} has the following
     1078prototype:
     1079
     1080@example
     1081extern rtems_shell_cmd_t rtems_shell_DEBUGRFS_Command;
     1082@end example
     1083
     1084@c
     1085@c
     1086@c
     1087@page
     1088@subsection df - display file system disk space usage
     1089
     1090@pgindex df
     1091
     1092@subheading SYNOPSYS:
     1093
     1094@example
     1095df [-h] [-B block_size]
     1096@end example
     1097
     1098@subheading DESCRIPTION:
     1099
     1100This command print disk space usage for mounted file systems.
     1101
     1102@subheading EXIT STATUS:
     1103
     1104This command returns 0 on success and non-zero if an error is encountered.
     1105
     1106@subheading NOTES:
     1107
     1108NONE
     1109
     1110@subheading EXAMPLES:
     1111
     1112The following is an example of how to use @code{df}:
     1113
     1114@example
     1115SHLL [/] $ df -B 4K
     1116Filesystem     4K-blocks        Used   Available       Use%     Mounted on
     1117/dev/rda               124         1         124         0%   /mnt/ramdisk
     1118SHLL [/] $ df
     1119Filesystem     1K-blocks        Used   Available       Use%     Mounted on
     1120/dev/rda               495         1         494         0%   /mnt/ramdisk
     1121SHLL [/] $ df -h
     1122Filesystem     Size             Used   Available       Use%     Mounted on
     1123/dev/rda              495K        1K        494K         0%   /mnt/ramdisk
     1124@end example
     1125
     1126@subheading CONFIGURATION:
     1127
     1128@findex CONFIGURE_SHELL_NO_COMMAND_DF
     1129@findex CONFIGURE_SHELL_COMMAND_DF
     1130
     1131This command is included in the default shell command set.
     1132When building a custom command set, define
     1133@code{CONFIGURE_SHELL_COMMAND_DF} to have this
     1134command included.
     1135
     1136This command can be excluded from the shell command set by
     1137defining @code{CONFIGURE_SHELL_NO_COMMAND_DF} when all
     1138shell commands have been configured.
     1139
     1140@subheading PROGRAMMING INFORMATION:
     1141
     1142@findex rtems_shell_rtems_main_df
     1143
     1144The @code{df} is implemented by a C language function
     1145which has the following prototype:
     1146
     1147@example
     1148int rtems_shell_main_df(
     1149  int argc,
     1150  char **argv
     1151);
     1152@end example
     1153
     1154The configuration structure for the @code{df} has the
     1155following prototype:
     1156
     1157@example
     1158extern rtems_shell_cmd_t rtems_shell_DF_Command;
     1159@end example
     1160
     1161@c
     1162@c
     1163@c
     1164@page
     1165@subsection dir - alias for ls
     1166
     1167@pgindex dir
     1168
     1169@subheading SYNOPSYS:
     1170
     1171@example
     1172dir [dir]
     1173@end example
     1174
     1175@subheading DESCRIPTION:
     1176
     1177This command is an alias or alternate name for the @code{ls}.
     1178See @ref{File and Directory Commands ls - list files in the directory, ls}
     1179for more information.
     1180
     1181@subheading EXIT STATUS:
     1182
     1183This command returns 0 on success and non-zero if an error is encountered.
     1184
     1185@subheading NOTES:
     1186
     1187NONE
     1188
     1189@subheading EXAMPLES:
     1190
     1191The following is an example of how to use @code{dir}:
     1192
     1193@example
     1194SHLL [/] $ dir
     1195drwxr-xr-x   1   root   root         536 Jan 01 00:00 dev/
     1196drwxr-xr-x   1   root   root        1072 Jan 01 00:00 etc/
     11972 files 1608 bytes occupied
     1198SHLL [/] $ dir etc
     1199-rw-r--r--   1   root   root         102 Jan 01 00:00 passwd
     1200-rw-r--r--   1   root   root          42 Jan 01 00:00 group
     1201-rw-r--r--   1   root   root          30 Jan 01 00:00 issue
     1202-rw-r--r--   1   root   root          28 Jan 01 00:00 issue.net
     12034 files 202 bytes occupied
     1204@end example
     1205
     1206@subheading CONFIGURATION:
     1207
     1208@findex CONFIGURE_SHELL_NO_COMMAND_DIR
     1209@findex CONFIGURE_SHELL_COMMAND_DIR
     1210
     1211This command is included in the default shell command set.
     1212When building a custom command set, define
     1213@code{CONFIGURE_SHELL_COMMAND_DIR} to have this
     1214command included.
     1215
     1216This command can be excluded from the shell command set by
     1217defining @code{CONFIGURE_SHELL_NO_COMMAND_DIR} when all
     1218shell commands have been configured.
     1219
     1220@subheading PROGRAMMING INFORMATION:
     1221
     1222@findex rtems_shell_rtems_main_dir
     1223
     1224The @code{dir} is implemented by a C language function
     1225which has the following prototype:
     1226
     1227@example
     1228int rtems_shell_rtems_main_dir(
     1229  int    argc,
     1230  char **argv
     1231);
     1232@end example
     1233
     1234The configuration structure for the @code{dir} has the
     1235following prototype:
     1236
     1237@example
     1238extern rtems_shell_cmd_t rtems_shell_DIR_Command;
     1239@end example
     1240
     1241@c
     1242@c
     1243@c
     1244@page
     1245@subsection fdisk - format disk
     1246
     1247@pgindex fdisk
     1248
     1249@subheading SYNOPSYS:
     1250
     1251@example
     1252fdisk
     1253@end example
     1254
     1255@subheading CONFIGURATION:
     1256
     1257@findex CONFIGURE_SHELL_NO_COMMAND_FDISK
     1258@findex CONFIGURE_SHELL_COMMAND_FDISK
     1259
     1260This command is included in the default shell command set.
     1261When building a custom command set, define
     1262@code{CONFIGURE_SHELL_COMMAND_FDISK} to have this
     1263command included.
     1264
     1265This command can be excluded from the shell command set by
     1266defining @code{CONFIGURE_SHELL_NO_COMMAND_FDISK} when all
     1267shell commands have been configured.
    19551268
    19561269@c
     
    22301543@c
    22311544@page
    2232 @subsection fdisk - format disk
    2233 
    2234 @pgindex fdisk
     1545@subsection ln - make links
     1546
     1547@pgindex ln
    22351548
    22361549@subheading SYNOPSYS:
    22371550
    22381551@example
    2239 fdisk
     1552ln [-fhinsv] source_file [target_file]
     1553ln [-fhinsv] source_file ... target_dir
     1554@end example
     1555
     1556@subheading DESCRIPTION:
     1557
     1558The ln utility creates a new directory entry (linked file) which has
     1559the same modes as the original file.  It is useful for maintaining
     1560multiple copies of a file in many places at once without using up
     1561storage for the ``copies''; instead, a link ``points'' to the original
     1562copy.  There are two types of links; hard links and symbolic links.
     1563How a link ``points'' to a file is one of the differences between a
     1564hard or symbolic link.
     1565
     1566The options are as follows:
     1567@table @b
     1568@item -f
     1569Unlink any already existing file, permitting the link to occur.
     1570
     1571@item -h
     1572If the target_file or target_dir is a symbolic link, do not follow it.
     1573This is most useful with the -f option, to replace a symlink which may
     1574point to a directory.
     1575
     1576@item -i
     1577Cause ln to write a prompt to standard error if the target file
     1578exists.  If the response from the standard input begins with the
     1579character `y' or `Y', then unlink the target file so that the link may
     1580occur.  Otherwise, do not attempt the link.  (The -i option overrides
     1581any previous -f options.)
     1582
     1583@item -n
     1584Same as -h, for compatibility with other ln implementations.
     1585
     1586@item -s
     1587Create a symbolic link.
     1588
     1589@item -v
     1590Cause ln to be verbose, showing files as they are processed.
     1591@end table
     1592
     1593By default ln makes hard links.  A hard link to a file is
     1594indistinguishable from the original directory entry; any changes to a
     1595file are effective independent of the name used to reference the file.
     1596Hard links may not normally refer to directories and may not span file
     1597systems.
     1598
     1599A symbolic link contains the name of the file to which it is linked.
     1600The referenced file is used when an @i{open} operation is performed on
     1601the link.  A @i{stat} on a symbolic link will return the linked-to
     1602file; an @i{lstat} must be done to obtain information about the link.
     1603The @i{readlink} call may be used to read the contents of a symbolic
     1604link.  Symbolic links may span file systems and may refer to
     1605directories.
     1606
     1607Given one or two arguments, ln creates a link to an existing file
     1608source_file.  If target_file is given, the link has that name;
     1609target_file may also be a directory in which to place the link;
     1610otherwise it is placed in the current directory.  If only the
     1611directory is specified, the link will be made to the last component of
     1612source_file.
     1613
     1614Given more than two arguments, ln makes links in target_dir to all the
     1615named source files.  The links made will have the same name as the
     1616files being linked to.
     1617
     1618@subheading EXIT STATUS:
     1619
     1620The @code{ln} utility exits 0 on success, and >0 if an error occurs.
     1621
     1622@subheading NOTES:
     1623
     1624NONE
     1625
     1626@subheading EXAMPLES:
     1627
     1628@example
     1629SHLL [/] ln -s /dev/console /dev/con1
    22401630@end example
    22411631
    22421632@subheading CONFIGURATION:
    22431633
    2244 @findex CONFIGURE_SHELL_NO_COMMAND_FDISK
    2245 @findex CONFIGURE_SHELL_COMMAND_FDISK
    2246 
    2247 This command is included in the default shell command set.
    2248 When building a custom command set, define
    2249 @code{CONFIGURE_SHELL_COMMAND_FDISK} to have this
    2250 command included.
     1634@findex CONFIGURE_SHELL_NO_COMMAND_LN
     1635@findex CONFIGURE_SHELL_COMMAND_LN
     1636
     1637This command is included in the default shell command set.  When
     1638building a custom command set, define
     1639@code{CONFIGURE_SHELL_COMMAND_LN} to have this command included.
    22511640
    22521641This command can be excluded from the shell command set by
    2253 defining @code{CONFIGURE_SHELL_NO_COMMAND_FDISK} when all
     1642defining @code{CONFIGURE_SHELL_NO_COMMAND_LN} when all
    22541643shell commands have been configured.
    22551644
     1645@subheading PROGRAMMING INFORMATION:
     1646
     1647@findex rtems_shell_rtems_main_ln
     1648
     1649The @code{ln} command is implemented by a C language function which
     1650has the following prototype:
     1651
     1652@example
     1653int rtems_shell_rtems_main_ln(
     1654  int    argc,
     1655  char **argv
     1656);
     1657@end example
     1658
     1659The configuration structure for the @code{ln} has the following
     1660prototype:
     1661
     1662@example
     1663extern rtems_shell_cmd_t rtems_shell_LN_Command;
     1664@end example
     1665
     1666@subheading ORIGIN:
     1667
     1668The implementation and portions of the documentation for this command
     1669are from NetBSD 4.0.
     1670
    22561671@c
    22571672@c
    22581673@c
    22591674@page
    2260 @subsection dir - alias for ls
    2261 
    2262 @pgindex dir
     1675@subsection ls - list files in the directory
     1676
     1677@pgindex ls
    22631678
    22641679@subheading SYNOPSYS:
    22651680
    22661681@example
    2267 dir [dir]
     1682ls [dir]
    22681683@end example
    22691684
    22701685@subheading DESCRIPTION:
    22711686
    2272 This command is an alias or alternate name for the @code{ls}.
    2273 See @ref{File and Directory Commands ls - list files in the directory, ls}
    2274 for more information.
     1687This command displays the contents of the specified directory.  If
     1688no arguments are given, then it displays the contents of the current
     1689working directory.
    22751690
    22761691@subheading EXIT STATUS:
     
    22801695@subheading NOTES:
    22811696
    2282 NONE
     1697This command currently does not display information on a set of
     1698files like the POSIX ls(1).  It only displays the contents of
     1699entire directories.
    22831700
    22841701@subheading EXAMPLES:
    22851702
    2286 The following is an example of how to use @code{dir}:
    2287 
    2288 @example
    2289 SHLL [/] $ dir
     1703The following is an example of how to use @code{ls}:
     1704
     1705@example
     1706SHLL [/] $ ls
    22901707drwxr-xr-x   1   root   root         536 Jan 01 00:00 dev/
    22911708drwxr-xr-x   1   root   root        1072 Jan 01 00:00 etc/
    229217092 files 1608 bytes occupied
    2293 SHLL [/] $ dir etc
     1710SHLL [/] $ ls etc
    22941711-rw-r--r--   1   root   root         102 Jan 01 00:00 passwd
    22951712-rw-r--r--   1   root   root          42 Jan 01 00:00 group
     
    22971714-rw-r--r--   1   root   root          28 Jan 01 00:00 issue.net
    229817154 files 202 bytes occupied
     1716SHLL [/] $ ls dev etc
     1717-rwxr-xr-x   1  rtems   root           0 Jan 01 00:00 console
     1718-rwxr-xr-x   1   root   root           0 Jan 01 00:00 console_b
    22991719@end example
    23001720
    23011721@subheading CONFIGURATION:
    23021722
    2303 @findex CONFIGURE_SHELL_NO_COMMAND_DIR
    2304 @findex CONFIGURE_SHELL_COMMAND_DIR
     1723@findex CONFIGURE_SHELL_NO_COMMAND_LS
     1724@findex CONFIGURE_SHELL_COMMAND_LS
    23051725
    23061726This command is included in the default shell command set.
    23071727When building a custom command set, define
    2308 @code{CONFIGURE_SHELL_COMMAND_DIR} to have this
     1728@code{CONFIGURE_SHELL_COMMAND_LS} to have this
    23091729command included.
    23101730
    23111731This command can be excluded from the shell command set by
    2312 defining @code{CONFIGURE_SHELL_NO_COMMAND_DIR} when all
     1732defining @code{CONFIGURE_SHELL_NO_COMMAND_LS} when all
    23131733shell commands have been configured.
    23141734
    23151735@subheading PROGRAMMING INFORMATION:
    23161736
    2317 @findex rtems_shell_rtems_main_dir
    2318 
    2319 The @code{dir} is implemented by a C language function
     1737@findex rtems_shell_rtems_main_ls
     1738
     1739The @code{ls} is implemented by a C language function
    23201740which has the following prototype:
    23211741
    23221742@example
    2323 int rtems_shell_rtems_main_dir(
     1743int rtems_shell_rtems_main_ls(
    23241744  int    argc,
    23251745  char **argv
     
    23271747@end example
    23281748
    2329 The configuration structure for the @code{dir} has the
     1749The configuration structure for the @code{ls} has the
    23301750following prototype:
    23311751
    23321752@example
    2333 extern rtems_shell_cmd_t rtems_shell_DIR_Command;
    2334 @end example
     1753extern rtems_shell_cmd_t rtems_shell_LS_Command;
     1754@end example
     1755
     1756@c
     1757@c
     1758@c
     1759@page
     1760@subsection md5 - compute the Md5 hash of a file or list of files
     1761
     1762@pgindex md5
     1763
     1764@subheading SYNOPSYS:
     1765
     1766@example
     1767md5 <files>
     1768@end example
     1769
     1770@subheading DESCRIPTION:
     1771
     1772This command prints the MD5 of a file. You can provide one or more
     1773files on the command line and a hash for each file is printed in a
     1774single line of output.
     1775
     1776@subheading EXIT STATUS:
     1777
     1778This command returns 0 on success and non-zero if an error is encountered.
     1779
     1780@subheading NOTES:
     1781
     1782NONE
     1783
     1784@subheading EXAMPLES:
     1785
     1786The following is an example of how to use @code{md5}:
     1787
     1788@example
     1789SHLL [/] $ md5 shell-init
     1790MD5 (shell-init) = 43b4d2e71b47db79eae679a2efeacf31
     1791@end example
     1792
     1793@subheading CONFIGURATION:
     1794
     1795@findex CONFIGURE_SHELL_NO_COMMAND_MD5
     1796@findex CONFIGURE_SHELL_COMMAND_MD5
     1797
     1798This command is included in the default shell command set.
     1799When building a custom command set, define
     1800@code{CONFIGURE_SHELL_COMMAND_MD5} to have this
     1801command included.
     1802
     1803This command can be excluded from the shell command set by
     1804defining @code{CONFIGURE_SHELL_NO_COMMAND_MD5} when all
     1805shell commands have been configured.
     1806
     1807@subheading PROGRAMMING INFORMATION:
     1808
     1809@findex rtems_shell_rtems_main_md5
     1810
     1811The @code{df} is implemented by a C language function
     1812which has the following prototype:
     1813
     1814@example
     1815int rtems_shell_main_md5(
     1816  int argc,
     1817  char **argv
     1818);
     1819@end example
     1820
     1821The configuration structure for the @code{md5} has the
     1822following prototype:
     1823
     1824@example
     1825extern rtems_shell_cmd_t rtems_shell_MD5_Command;
     1826@end example
     1827
     1828@c
     1829@c
     1830@c
     1831@page
     1832@subsection mkdir - create a directory
     1833
     1834@pgindex mkdir
     1835
     1836@subheading SYNOPSYS:
     1837
     1838@example
     1839mkdir  dir [dir1 .. dirN]
     1840@end example
     1841
     1842@subheading DESCRIPTION:
     1843
     1844This command creates the set of directories in the order they
     1845are specified on the command line.  If an error is encountered
     1846making one of the directories, the command will continue to
     1847attempt to create the remaining directories on the command line.
     1848
     1849@subheading EXIT STATUS:
     1850
     1851This command returns 0 on success and non-zero if an error is encountered.
     1852
     1853@subheading NOTES:
     1854
     1855If this command is invoked with no arguments, nothing occurs.
     1856
     1857The user must have sufficient permissions to create the directory.
     1858For the @code{fileio} test provided with RTEMS, this means the user
     1859must login as @code{root} not @code{rtems}.
     1860
     1861@subheading EXAMPLES:
     1862
     1863The following is an example of how to use @code{mkdir}:
     1864
     1865@example
     1866SHLL [/] # ls
     1867drwxr-xr-x   1   root   root         536 Jan 01 00:00 dev/
     1868drwxr-xr-x   1   root   root        1072 Jan 01 00:00 etc/
     18692 files 1608 bytes occupied
     1870SHLL [/] # mkdir joel
     1871SHLL [/] # ls joel
     18720 files 0 bytes occupied
     1873SHLL [/] # cp etc/passwd joel
     1874SHLL [/] # ls joel
     1875-rw-r--r--   1   root   root         102 Jan 01 00:02 passwd
     18761 files 102 bytes occupied
     1877@end example
     1878
     1879@subheading CONFIGURATION:
     1880
     1881@findex CONFIGURE_SHELL_NO_COMMAND_MKDIR
     1882@findex CONFIGURE_SHELL_COMMAND_MKDIR
     1883
     1884This command is included in the default shell command set.
     1885When building a custom command set, define
     1886@code{CONFIGURE_SHELL_COMMAND_MKDIR} to have this
     1887command included.
     1888
     1889This command can be excluded from the shell command set by
     1890defining @code{CONFIGURE_SHELL_NO_COMMAND_MKDIR} when all
     1891shell commands have been configured.
     1892
     1893@subheading PROGRAMMING INFORMATION:
     1894
     1895@findex rtems_shell_rtems_main_mkdir
     1896
     1897The @code{mkdir} is implemented by a C language function
     1898which has the following prototype:
     1899
     1900@example
     1901int rtems_shell_rtems_main_mkdir(
     1902  int    argc,
     1903  char **argv
     1904);
     1905@end example
     1906
     1907The configuration structure for the @code{mkdir} has the
     1908following prototype:
     1909
     1910@example
     1911extern rtems_shell_cmd_t rtems_shell_MKDIR_Command;
     1912@end example
     1913
     1914@c
     1915@c
     1916@c
     1917@page
     1918@subsection mldos - DOSFS file system format
     1919
     1920@pgindex pwd
     1921
     1922@subheading SYNOPSYS:
     1923
     1924@example
     1925mkdir [-V label] [-s sectors/cluster] [-r size] [-v] path
     1926@end example
     1927
     1928@subheading DESCRIPTION:
     1929
     1930This command formats a block device entry with the DOSFS file system.
     1931
     1932@table @b
     1933@item -V label
     1934
     1935@item -s sectors/cluster
     1936
     1937@item -r size
     1938
     1939@end table
     1940
     1941@subheading EXIT STATUS:
     1942
     1943This command returns 0 on success and non-zero if an error is encountered.
     1944
     1945@subheading NOTES:
     1946
     1947NONE
     1948
     1949@subheading EXAMPLES:
     1950
     1951The following is an example of how to use @code{mkdos}:
     1952
     1953@example
     1954SHLL [/] $ mkdos /dev/rda1
     1955@end example
     1956
     1957@subheading CONFIGURATION:
     1958
     1959@findex CONFIGURE_SHELL_NO_COMMAND_MKDOS
     1960@findex CONFIGURE_SHELL_COMMAND_MKDOS
     1961
     1962This command is included in the default shell command set.
     1963When building a custom command set, define
     1964@code{CONFIGURE_SHELL_COMMAND_MKDOS} to have this
     1965command included.
     1966
     1967This command can be excluded from the shell command set by
     1968defining @code{CONFIGURE_SHELL_NO_COMMAND_MKDOS} when all
     1969shell commands have been configured.
     1970
     1971@subheading PROGRAMMING INFORMATION:
     1972
     1973@findex rtems_shell_rtems_main_mkdos
     1974
     1975The @code{mkdos} is implemented by a C language function
     1976which has the following prototype:
     1977
     1978@example
     1979int rtems_shell_rtems_main_mkdos(
     1980  int    argc,
     1981  char **argv
     1982);
     1983@end example
     1984
     1985The configuration structure for the @code{mkdos} has the
     1986following prototype:
     1987
     1988@example
     1989extern rtems_shell_cmd_t rtems_shell_MKDOS_Command;
     1990@end example
     1991
     1992@c
     1993@c
     1994@c
     1995@page
     1996@subsection mknod - make device special file
     1997
     1998@pgindex mknod
     1999
     2000@subheading SYNOPSYS:
     2001
     2002@example
     2003mknod [-rR] [-F fmt] [-g gid] [-m mode] [-u uid] name [c | b]
     2004      [driver | major] minor
     2005mknod [-rR] [-F fmt] [-g gid] [-m mode] [-u uid] name [c | b]
     2006      major unit subunit
     2007mknod [-rR] [-g gid] [-m mode] [-u uid] name [c | b] number
     2008mknod [-rR] [-g gid] [-m mode] [-u uid] name p
     2009@end example
     2010
     2011@subheading DESCRIPTION:
     2012
     2013The mknod command creates device special files, or fifos.  Normally
     2014the shell script /dev/MAKEDEV is used to create special files for
     2015commonly known devices; it executes mknod with the appropriate
     2016arguments and can make all the files required for the device.
     2017
     2018To make nodes manually, the arguments are:
     2019
     2020@table @b
     2021@item -r
     2022Replace an existing file if its type is incorrect.
     2023
     2024@item -R
     2025Replace an existing file if its type is incorrect.  Correct the
     2026mode, user and group.
     2027
     2028@item -g gid
     2029Specify the group for the device node.  The gid operand may be a
     2030numeric group ID or a group name.  If a group name is also a numeric
     2031group ID, the operand is used as a group name.  Precede a numeric
     2032group ID with a # to stop it being treated as a name.
     2033
     2034@item -m mode
     2035Specify the mode for the device node.  The mode may be absolute or
     2036symbolic, see @i{chmod}.
     2037
     2038@item -u uid
     2039Specify the user for the device node.  The uid operand may be a
     2040numeric user ID or a user name.  If a user name is also a numeric user
     2041ID, the operand is used as a user name.  Precede a numeric user ID
     2042with a # to stop it being treated as a name.
     2043
     2044@item name
     2045Device name, for example ``tty'' for a termios serial device or ``hd''
     2046for a disk.
     2047
     2048@item  b | c | p
     2049Type of device.  If the device is a block type device such as a tape
     2050or disk drive which needs both cooked and raw special files, the type
     2051is b.  All other devices are character type devices, such as terminal
     2052and pseudo devices, and are type c.  Specifying p creates fifo files.
     2053
     2054@item driver | major
     2055The major device number is an integer number which tells the kernel
     2056which device driver entry point to use.  If the device driver is
     2057configured into the current kernel it may be specified by driver name
     2058or major number.
     2059
     2060@item minor
     2061The minor device number tells the kernel which one of several similar
     2062devices the node corresponds to; for example, it may be a specific
     2063serial port or pty.
     2064
     2065@item unit and subunit
     2066The unit and subunit numbers select a subset of a device; for example,
     2067the unit may specify a particular disk, and the subunit a partition on
     2068that disk.  (Currently this form of specification is only supported
     2069by the bsdos format, for compatibility with the BSD/OS mknod).
     2070
     2071@item number
     2072A single opaque device number.  Useful for netbooted computers which
     2073require device numbers packed in a format that isn't supported by
     2074-F.
     2075@end table
     2076
     2077@subheading EXIT STATUS:
     2078
     2079The @code{mknod} utility exits 0 on success, and >0 if an error occurs.
     2080
     2081@subheading NOTES:
     2082
     2083NONE
     2084
     2085@subheading EXAMPLES:
     2086
     2087@example
     2088SHLL [/] mknod c 3 0 /dev/ttyS10
     2089@end example
     2090
     2091@subheading CONFIGURATION:
     2092
     2093@findex CONFIGURE_SHELL_NO_COMMAND_MKNOD
     2094@findex CONFIGURE_SHELL_COMMAND_MKNOD
     2095
     2096This command is included in the default shell command set.  When
     2097building a custom command set, define
     2098@code{CONFIGURE_SHELL_COMMAND_MKNOD} to have this command included.
     2099
     2100This command can be excluded from the shell command set by
     2101defining @code{CONFIGURE_SHELL_NO_COMMAND_MKNOD} when all
     2102shell commands have been configured.
     2103
     2104@subheading PROGRAMMING INFORMATION:
     2105
     2106@findex rtems_shell_rtems_main_mknod
     2107
     2108The @code{mknod} command is implemented by a C language function which
     2109has the following prototype:
     2110
     2111@example
     2112int rtems_shell_rtems_main_mknod(
     2113  int    argc,
     2114  char **argv
     2115);
     2116@end example
     2117
     2118The configuration structure for the @code{mknod} has the following
     2119prototype:
     2120
     2121@example
     2122extern rtems_shell_cmd_t rtems_shell_MKNOD_Command;
     2123@end example
     2124
     2125@subheading ORIGIN:
     2126
     2127The implementation and portions of the documentation for this command
     2128are from NetBSD 4.0.
    23352129
    23362130@c
     
    24432237@c
    24442238@page
    2445 @subsection debugrfs - debug RFS file system
    2446 
    2447 @pgindex debugrfs
     2239@subsection mount - mount disk
     2240
     2241@pgindex mount
    24482242
    24492243@subheading SYNOPSYS:
    24502244
    24512245@example
    2452 debugrfs [-hl] path command [options]
     2246mount [-t fstype] [-r] [-L] device path
    24532247@end example
    24542248
    24552249@subheading DESCRIPTION:
    24562250
    2457 The command provides debugging information for the RFS file system.
    2458 
    2459 The options are:
    2460 
    2461 @table @b
    2462 @item -h
    2463 Print a help message.
    2464 
    2465 @item -l
    2466 List the commands.
    2467 
    2468 @item path
    2469 Path to the mounted RFS file system. The file system has to be mounted
    2470 to view to use this command.
    2471 @end table
    2472 
    2473 The commands are:
    2474 
    2475 @table @b
    2476 @item block start [end]
    2477 Display the contents of the blocks from start to end.
    2478 
    2479 @item data
    2480 Display the file system data and configuration.
    2481 
    2482 @item dir bno
    2483 Process the block as a directory displaying the entries.
    2484 
    2485 @item group start [end]
    2486 Display the group data from the start group to the end group.
    2487 
    2488 @item inode [-aef] [start] [end]
    2489 Display the inodes between start and end. If no start and end is
    2490 provides all inodes are displayed.
    2491 
    2492 @table @b
    2493 @item -a
    2494 Display all inodes. That is allocated and unallocated inodes.
    2495 @item -e
    2496 Search and display on inodes that have an error.
    2497 @item -f
    2498 Force display of inodes, even when in error.
    2499 @end table
    2500 @end table
     2251The @code{mount} command will mount a block device to a mount point
     2252using the specified file system. The files systems are:
     2253
     2254@itemize @bullet
     2255@item msdos - MSDOS File System
     2256@item tftp  - TFTP Network File System
     2257@item ftp   - FTP Network File System
     2258@item nfs   - Network File System
     2259@item rfs   - RTEMS File System
     2260@end itemize
     2261
     2262When the file system type is 'msdos' or 'rfs' the driver is a "block
     2263device driver" node present in the file system. The driver is ignored
     2264with the 'tftp' and 'ftp' file systems. For the 'nfs' file system the
     2265driver is the 'host:/path' string that described NFS host and the
     2266exported file system path.
    25012267
    25022268@subheading EXIT STATUS:
     
    25062272@subheading NOTES:
    25072273
    2508 NONE
     2274The mount point must exist.
     2275
     2276The services offered by each file-system vary. For example you cannot list the
     2277directory of a TFTP file-system as this server is not provided in the TFTP
     2278protocol. You need to check each file-system's documentation for the services
     2279provided.
    25092280
    25102281@subheading EXAMPLES:
    25112282
    2512 The following is an example of how to use @code{debugrfs}:
    2513 
    2514 @example
    2515 SHLL [/] $ debugrfs /c data
     2283Mount the Flash Disk driver to the '/fd' mount point:
     2284
     2285@example
     2286SHLL [/] $ mount -t msdos /dev/flashdisk0 /fd
     2287@end example
     2288
     2289Mount the NFS file system exported path 'bar' by host 'foo':
     2290
     2291@example
     2292$ mount -t nfs foo:/bar /nfs
     2293@end example
     2294
     2295Mount the TFTP file system on '/tftp':
     2296
     2297@example
     2298$ mount -t tftp /tftp
     2299@end example
     2300
     2301To access the TFTP files on server '10.10.10.10':
     2302
     2303@example
     2304$ cat /tftp/10.10.10.10/test.txt
    25162305@end example
    25172306
    25182307@subheading CONFIGURATION:
    25192308
    2520 @findex CONFIGURE_SHELL_NO_COMMAND_DEBUGRFS
    2521 @findex CONFIGURE_SHELL_COMMAND_DEBUGRFS
     2309@findex CONFIGURE_SHELL_NO_COMMAND_MOUNT
     2310@findex CONFIGURE_SHELL_COMMAND_MOUNT
    25222311
    25232312This command is included in the default shell command set.
    25242313When building a custom command set, define
    2525 @code{CONFIGURE_SHELL_COMMAND_DEBUGRFS} to have this
     2314@code{CONFIGURE_SHELL_COMMAND_MOUNT} to have this
    25262315command included.
    25272316
    25282317This command can be excluded from the shell command set by
    2529 defining @code{CONFIGURE_SHELL_NO_COMMAND_DEBUGRFS} when all
     2318defining @code{CONFIGURE_SHELL_NO_COMMAND_MOUNT} when all
    25302319shell commands have been configured.
    25312320
     2321The mount command includes references to file-system code. If you do not wish
     2322to include file-system that you do not use do not define the mount command
     2323support for that file-system. The file-system mount command defines are:
     2324
     2325@itemize @bullet
     2326@item msdos - CONFIGURE_SHELL_MOUNT_MSDOS
     2327@item tftp - CONFIGURE_SHELL_MOUNT_TFTP
     2328@item ftp - CONFIGURE_SHELL_MOUNT_FTP
     2329@item nfs - CONFIGURE_SHELL_MOUNT_NFS
     2330@item rfs - CONFIGURE_SHELL_MOUNT_RFS
     2331@end itemize
     2332
     2333An example configuration is:
     2334
     2335@example
     2336#define CONFIGURE_SHELL_MOUNT_MSDOS
     2337#ifdef RTEMS_NETWORKING
     2338  #define CONFIGURE_SHELL_MOUNT_TFTP
     2339  #define CONFIGURE_SHELL_MOUNT_FTP
     2340  #define CONFIGURE_SHELL_MOUNT_NFS
     2341  #define CONFIGURE_SHELL_MOUNT_RFS
     2342#endif
     2343@end example
     2344
    25322345@subheading PROGRAMMING INFORMATION:
    25332346
    2534 @findex rtems_shell_rtems_main_debugrfs
    2535 
    2536 The @code{debugrfs} command is implemented by a C language function which
    2537 has the following prototype:
    2538 
    2539 @example
    2540 int rtems_shell_rtems_main_debugrfs(
     2347@findex rtems_shell_rtems_main_mount
     2348
     2349The @code{mount} is implemented by a C language function
     2350which has the following prototype:
     2351
     2352@example
     2353int rtems_shell_rtems_main_mount(
    25412354  int    argc,
    25422355  char **argv
     
    25442357@end example
    25452358
    2546 The configuration structure for @code{debugrfs} has the following
    2547 prototype:
    2548 
    2549 @example
    2550 extern rtems_shell_cmd_t rtems_shell_DEBUGRFS_Command;
     2359The configuration structure for the @code{mount} has the
     2360following prototype:
     2361
     2362@example
     2363extern rtems_shell_cmd_t rtems_shell_MOUNT_Command;
    25512364@end example
    25522365
     
    25552368@c
    25562369@page
    2557 @subsection cd - alias for chdir
    2558 
    2559 @pgindex cd
     2370@subsection mv - move files
     2371
     2372@pgindex mv
    25602373
    25612374@subheading SYNOPSYS:
    25622375
    25632376@example
    2564 cd directory
     2377mv [-fiv] source_file target_file
     2378mv [-fiv] source_file... target_file
    25652379@end example
    25662380
    25672381@subheading DESCRIPTION:
    25682382
    2569 This command is an alias or alternate name for the @code{chdir}.
    2570 See @ref{File and Directory Commands chdir - change the current directory, cd}
    2571 for more information.
     2383In its first form, the mv utility renames the file named by the source
     2384operand to the destination path named by the target operand.  This
     2385form is assumed when the last operand does not name an already
     2386existing directory.
     2387
     2388In its second form, mv moves each file named by a source operand to a
     2389destination file in the existing directory named by the directory
     2390operand.  The destination path for each operand is the pathname
     2391produced by the concatenation of the last operand, a slash, and the
     2392final pathname component of the named file.
     2393
     2394The following options are available:
     2395
     2396@table @b
     2397@item -f
     2398Do not prompt for confirmation before overwriting the destination
     2399path.
     2400
     2401@item -i
     2402Causes mv to write a prompt to standard error before moving a file
     2403that would overwrite an existing file.  If the response from the
     2404standard input begins with the character 'y', the move is attempted.
     2405
     2406@item -v
     2407Cause mv to be verbose, showing files as they are processed.
     2408
     2409@end table
     2410
     2411The last of any -f or -i options is the one which affects mv's
     2412behavior.
     2413
     2414It is an error for any of the source operands to specify a nonexistent
     2415file or directory.
     2416
     2417It is an error for the source operand to specify a directory if the
     2418target exists and is not a directory.
     2419
     2420If the destination path does not have a mode which permits writing, mv
     2421prompts the user for confirmation as specified for the -i option.
     2422
     2423Should the @b{rename} call fail because source and target are on
     2424different file systems, @code{mv} will remove the destination file,
     2425copy the source file to the destination, and then remove the source.
     2426The effect is roughly equivalent to:
     2427
     2428@example
     2429rm -f destination_path && \
     2430cp -PRp source_file destination_path && \
     2431rm -rf source_file
     2432@end example
    25722433
    25732434@subheading EXIT STATUS:
    25742435
    2575 This command returns 0 on success and non-zero if an error is encountered.
     2436The @code{mv} utility exits 0 on success, and >0 if an error occurs.
    25762437
    25772438@subheading NOTES:
     
    25812442@subheading EXAMPLES:
    25822443
    2583 The following is an example of how to use @code{cd}:
    2584 
    2585 @example
    2586 SHLL [/] $ cd etc
    2587 SHLL [/etc] $ cd /
    2588 SHLL [/] $ cd /etc
    2589 SHLL [/etc] $ pwd
    2590 /etc
    2591 SHLL [/etc] $ cd /
    2592 SHLL [/] $ pwd
    2593 /
    2594 SHLL [/] $ cd etc
    2595 SHLL [/etc] $ cd ..
    2596 SHLL [/] $ pwd
    2597 /
     2444@example
     2445SHLL [/] mv /dev/console /dev/con1
    25982446@end example
    25992447
    26002448@subheading CONFIGURATION:
    26012449
    2602 @findex CONFIGURE_SHELL_NO_COMMAND_CD
    2603 @findex CONFIGURE_SHELL_COMMAND_CD
    2604 
    2605 This command is included in the default shell command set.
    2606 When building a custom command set, define
    2607 @code{CONFIGURE_SHELL_COMMAND_CD} to have this
    2608 command included.
     2450@findex CONFIGURE_SHELL_NO_COMMAND_MV
     2451@findex CONFIGURE_SHELL_COMMAND_MV
     2452
     2453This command is included in the default shell command set.  When
     2454building a custom command set, define
     2455@code{CONFIGURE_SHELL_COMMAND_MV} to have this command included.
    26092456
    26102457This command can be excluded from the shell command set by
    2611 defining @code{CONFIGURE_SHELL_NO_COMMAND_CD} when all
     2458defining @code{CONFIGURE_SHELL_NO_COMMAND_MV} when all
    26122459shell commands have been configured.
    26132460
    26142461@subheading PROGRAMMING INFORMATION:
    26152462
    2616 @findex rtems_shell_rtems_main_cd
    2617 
    2618 The @code{cd} is implemented by a C language function
    2619 which has the following prototype:
    2620 
    2621 @example
    2622 int rtems_shell_rtems_main_cd(
     2463@findex rtems_shell_rtems_main_mv
     2464
     2465The @code{mv} command is implemented by a C language function which
     2466has the following prototype:
     2467
     2468@example
     2469int rtems_shell_rtems_main_mv(
    26232470  int    argc,
    26242471  char **argv
     
    26262473@end example
    26272474
    2628 The configuration structure for the @code{cd} has the
     2475The configuration structure for the @code{mv} has the
    26292476following prototype:
    26302477
    26312478@example
    2632 extern rtems_shell_cmd_t rtems_shell_CD_Command;
    2633 @end example
     2479extern rtems_shell_cmd_t rtems_shell_MV_Command;
     2480@end example
     2481
     2482@subheading ORIGIN:
     2483
     2484The implementation and portions of the documentation for this command
     2485are from NetBSD 4.0.
    26342486
    26352487@c
     
    26372489@c
    26382490@page
    2639 @subsection df - display file system disk space usage
    2640 
    2641 @pgindex df
     2491@subsection pwd - print work directory
     2492
     2493@pgindex pwd
    26422494
    26432495@subheading SYNOPSYS:
    26442496
    26452497@example
    2646 df [-h] [-B block_size]
     2498pwd
    26472499@end example
    26482500
    26492501@subheading DESCRIPTION:
    26502502
    2651 This command print disk space usage for mounted file systems.
     2503This command prints the fully qualified filename of the current
     2504working directory.
    26522505
    26532506@subheading EXIT STATUS:
     
    26612514@subheading EXAMPLES:
    26622515
    2663 The following is an example of how to use @code{df}:
    2664 
    2665 @example
    2666 SHLL [/] $ df -B 4K
    2667 Filesystem     4K-blocks        Used   Available       Use%     Mounted on
    2668 /dev/rda               124         1         124         0%   /mnt/ramdisk
    2669 SHLL [/] $ df
    2670 Filesystem     1K-blocks        Used   Available       Use%     Mounted on
    2671 /dev/rda               495         1         494         0%   /mnt/ramdisk
    2672 SHLL [/] $ df -h
    2673 Filesystem     Size             Used   Available       Use%     Mounted on
    2674 /dev/rda              495K        1K        494K         0%   /mnt/ramdisk
     2516The following is an example of how to use @code{pwd}:
     2517
     2518@example
     2519SHLL [/] $ pwd
     2520/
     2521SHLL [/] $ cd dev
     2522SHLL [/dev] $ pwd
     2523/dev
    26752524@end example
    26762525
    26772526@subheading CONFIGURATION:
    26782527
    2679 @findex CONFIGURE_SHELL_NO_COMMAND_DF
    2680 @findex CONFIGURE_SHELL_COMMAND_DF
     2528@findex CONFIGURE_SHELL_NO_COMMAND_PWD
     2529@findex CONFIGURE_SHELL_COMMAND_PWD
    26812530
    26822531This command is included in the default shell command set.
    26832532When building a custom command set, define
    2684 @code{CONFIGURE_SHELL_COMMAND_DF} to have this
     2533@code{CONFIGURE_SHELL_COMMAND_PWD} to have this
    26852534command included.
    26862535
    26872536This command can be excluded from the shell command set by
    2688 defining @code{CONFIGURE_SHELL_NO_COMMAND_DF} when all
     2537defining @code{CONFIGURE_SHELL_NO_COMMAND_PWD} when all
    26892538shell commands have been configured.
    26902539
    26912540@subheading PROGRAMMING INFORMATION:
    26922541
    2693 @findex rtems_shell_rtems_main_df
    2694 
    2695 The @code{df} is implemented by a C language function
     2542@findex rtems_shell_rtems_main_pwd
     2543
     2544The @code{pwd} is implemented by a C language function
    26962545which has the following prototype:
    26972546
    26982547@example
    2699 int rtems_shell_main_df(
    2700   int argc,
     2548int rtems_shell_rtems_main_pwd(
     2549  int    argc,
    27012550  char **argv
    27022551);
    27032552@end example
    27042553
    2705 The configuration structure for the @code{df} has the
     2554The configuration structure for the @code{pwd} has the
    27062555following prototype:
    27072556
    27082557@example
    2709 extern rtems_shell_cmd_t rtems_shell_DF_Command;
     2558extern rtems_shell_cmd_t rtems_shell_PWD_Command;
    27102559@end example
    27112560
     
    27142563@c
    27152564@page
    2716 @subsection md5 - compute the Md5 hash of a file or list of files
    2717 
    2718 @pgindex md5
     2565@subsection rmdir - remove empty directories
     2566
     2567@pgindex rmdir
    27192568
    27202569@subheading SYNOPSYS:
    27212570
    27222571@example
    2723 md5 <files>
     2572rmdir  [dir1 .. dirN]
    27242573@end example
    27252574
    27262575@subheading DESCRIPTION:
    27272576
    2728 This command prints the MD5 of a file. You can provide one or more
    2729 files on the command line and a hash for each file is printed in a
    2730 single line of output.
     2577This command removes the specified set of directories.  If no
     2578directories are provided on the command line, no actions are taken.
    27312579
    27322580@subheading EXIT STATUS:
     
    27362584@subheading NOTES:
    27372585
    2738 NONE
     2586This command is a implemented using the @code{rmdir(2)} system
     2587call and all reasons that call may fail apply to this command.
    27392588
    27402589@subheading EXAMPLES:
    27412590
    2742 The following is an example of how to use @code{md5}:
    2743 
    2744 @example
    2745 SHLL [/] $ md5 shell-init
    2746 MD5 (shell-init) = 43b4d2e71b47db79eae679a2efeacf31
     2591The following is an example of how to use @code{rmdir}:
     2592
     2593@example
     2594SHLL [/] # mkdir joeldir
     2595SHLL [/] # rmdir joeldir
     2596SHLL [/] # ls joeldir
     2597joeldir: No such file or directory.
    27472598@end example
    27482599
    27492600@subheading CONFIGURATION:
    27502601
    2751 @findex CONFIGURE_SHELL_NO_COMMAND_MD5
    2752 @findex CONFIGURE_SHELL_COMMAND_MD5
     2602@findex CONFIGURE_SHELL_NO_COMMAND_RMDIR
     2603@findex CONFIGURE_SHELL_COMMAND_RMDIR
    27532604
    27542605This command is included in the default shell command set.
    27552606When building a custom command set, define
    2756 @code{CONFIGURE_SHELL_COMMAND_MD5} to have this
     2607@code{CONFIGURE_SHELL_COMMAND_RMDIR} to have this
    27572608command included.
    27582609
    27592610This command can be excluded from the shell command set by
    2760 defining @code{CONFIGURE_SHELL_NO_COMMAND_MD5} when all
     2611defining @code{CONFIGURE_SHELL_NO_COMMAND_RMDIR} when all
    27612612shell commands have been configured.
    27622613
    27632614@subheading PROGRAMMING INFORMATION:
    27642615
    2765 @findex rtems_shell_rtems_main_md5
    2766 
    2767 The @code{df} is implemented by a C language function
     2616@findex rtems_shell_rtems_main_rmdir
     2617
     2618The @code{rmdir} is implemented by a C language function
    27682619which has the following prototype:
    27692620
    27702621@example
    2771 int rtems_shell_main_md5(
    2772   int argc,
     2622int rtems_shell_rtems_main_rmdir(
     2623  int    argc,
    27732624  char **argv
    27742625);
    27752626@end example
    27762627
    2777 The configuration structure for the @code{md5} has the
     2628The configuration structure for the @code{rmdir} has the
    27782629following prototype:
    27792630
    27802631@example
    2781 extern rtems_shell_cmd_t rtems_shell_MD5_Command;
    2782 @end example
     2632extern rtems_shell_cmd_t rtems_shell_RMDIR_Command;
     2633@end example
     2634
     2635@c
     2636@c
     2637@c
     2638@page
     2639@subsection rm - remove files
     2640
     2641@pgindex rm
     2642
     2643@subheading SYNOPSYS:
     2644
     2645@example
     2646rm file1 [file2 ... fileN]
     2647@end example
     2648
     2649@subheading DESCRIPTION:
     2650
     2651This command deletes a name from the filesystem.  If the specified file name
     2652was the last link to a file and there are no @code{open} file descriptor
     2653references to that file, then it is deleted and the associated space in
     2654the file system is made available for subsequent use.
     2655
     2656If the filename specified was the last link to a file but there
     2657are open file descriptor references to it, then the file will
     2658remain in existence until the last file descriptor referencing
     2659it is closed.
     2660
     2661@subheading EXIT STATUS:
     2662
     2663This command returns 0 on success and non-zero if an error is encountered.
     2664
     2665@subheading NOTES:
     2666
     2667NONE
     2668
     2669@subheading EXAMPLES:
     2670
     2671The following is an example of how to use @code{rm}:
     2672
     2673@example
     2674SHLL [/] # cp /etc/passwd tmpfile
     2675SHLL [/] # cat tmpfile
     2676root:*:0:0:root::/:/bin/sh
     2677rtems:*:1:1:RTEMS Application::/:/bin/sh
     2678tty:!:2:2:tty owner::/:/bin/false
     2679SHLL [/] # rm tmpfile
     2680SHLL [/] # cat tmpfile
     2681cat: tmpfile: No such file or directory
     2682@end example
     2683
     2684@subheading CONFIGURATION:
     2685
     2686@findex CONFIGURE_SHELL_NO_COMMAND_RM
     2687@findex CONFIGURE_SHELL_COMMAND_RM
     2688
     2689This command is included in the default shell command set.
     2690When building a custom command set, define
     2691@code{CONFIGURE_SHELL_COMMAND_RM} to have this
     2692command included.
     2693
     2694This command can be excluded from the shell command set by
     2695defining @code{CONFIGURE_SHELL_NO_COMMAND_RM} when all
     2696shell commands have been configured.
     2697
     2698@subheading PROGRAMMING INFORMATION:
     2699
     2700@findex rtems_shell_rtems_main_rm
     2701
     2702The @code{rm} is implemented by a C language function
     2703which has the following prototype:
     2704
     2705@example
     2706int rtems_shell_rtems_main_rm(
     2707  int    argc,
     2708  char **argv
     2709);
     2710@end example
     2711
     2712The configuration structure for the @code{rm} has the
     2713following prototype:
     2714
     2715@example
     2716extern rtems_shell_cmd_t rtems_shell_RM_Command;
     2717@end example
     2718
     2719@c
     2720@c
     2721@c
     2722@page
     2723@subsection umask - set file mode creation mask
     2724
     2725@pgindex umask
     2726
     2727@subheading SYNOPSYS:
     2728
     2729@example
     2730umask [new_umask]
     2731@end example
     2732
     2733@subheading DESCRIPTION:
     2734
     2735This command sets the user file creation mask to @code{new_umask}.  The
     2736argument @code{new_umask} may be octal, hexadecimal, or decimal.
     2737
     2738@subheading EXIT STATUS:
     2739
     2740This command returns 0 on success and non-zero if an error is encountered.
     2741
     2742@subheading NOTES:
     2743
     2744This command does not currently support symbolic mode masks.
     2745
     2746@subheading EXAMPLES:
     2747
     2748The following is an example of how to use @code{umask}:
     2749
     2750@example
     2751SHLL [/] $ umask
     2752022
     2753SHLL [/] $ umask 0666
     27540666
     2755SHLL [/] $ umask
     27560666
     2757@end example
     2758
     2759@subheading CONFIGURATION:
     2760
     2761@findex CONFIGURE_SHELL_NO_COMMAND_UMASK
     2762@findex CONFIGURE_SHELL_COMMAND_UMASK
     2763
     2764This command is included in the default shell command set.
     2765When building a custom command set, define
     2766@code{CONFIGURE_SHELL_COMMAND_UMASK} to have this
     2767command included.
     2768
     2769This command can be excluded from the shell command set by
     2770defining @code{CONFIGURE_SHELL_NO_COMMAND_UMASK} when all
     2771shell commands have been configured.
     2772
     2773@subheading PROGRAMMING INFORMATION:
     2774
     2775@findex rtems_shell_rtems_main_umask
     2776
     2777The @code{umask} is implemented by a C language function
     2778which has the following prototype:
     2779
     2780@example
     2781int rtems_shell_rtems_main_umask(
     2782  int    argc,
     2783  char **argv
     2784);
     2785@end example
     2786
     2787The configuration structure for the @code{umask} has the
     2788following prototype:
     2789
     2790@example
     2791extern rtems_shell_cmd_t rtems_shell_UMASK_Command;
     2792@end example
     2793
     2794@c
     2795@c
     2796@c
     2797@page
     2798@subsection unmount - unmount disk
     2799
     2800@pgindex unmount
     2801
     2802@subheading SYNOPSYS:
     2803
     2804@example
     2805unmount path
     2806@end example
     2807
     2808@subheading DESCRIPTION:
     2809
     2810This command unmounts the device at the specified @code{path}.
     2811
     2812@subheading EXIT STATUS:
     2813
     2814This command returns 0 on success and non-zero if an error is encountered.
     2815
     2816@subheading NOTES:
     2817
     2818TBD - Surely there must be some warnings to go here.
     2819
     2820@subheading EXAMPLES:
     2821
     2822The following is an example of how to use @code{unmount}:
     2823
     2824@example
     2825EXAMPLE_TBD
     2826@end example
     2827
     2828@subheading CONFIGURATION:
     2829
     2830@findex CONFIGURE_SHELL_NO_COMMAND_UNMOUNT
     2831@findex CONFIGURE_SHELL_COMMAND_UNMOUNT
     2832
     2833This command is included in the default shell command set.
     2834When building a custom command set, define
     2835@code{CONFIGURE_SHELL_COMMAND_UNMOUNT} to have this
     2836command included.
     2837
     2838This command can be excluded from the shell command set by
     2839defining @code{CONFIGURE_SHELL_NO_COMMAND_UNMOUNT} when all
     2840shell commands have been configured.
     2841
     2842@subheading PROGRAMMING INFORMATION:
     2843
     2844@findex rtems_shell_rtems_main_unmount
     2845
     2846The @code{unmount} is implemented by a C language function
     2847which has the following prototype:
     2848
     2849@example
     2850int rtems_shell_rtems_main_unmount(
     2851  int    argc,
     2852  char **argv
     2853);
     2854@end example
     2855
     2856The configuration structure for the @code{unmount} has the
     2857following prototype:
     2858
     2859@example
     2860extern rtems_shell_cmd_t rtems_shell_UNMOUNT_Command;
     2861@end example
Note: See TracChangeset for help on using the changeset viewer.