- Timestamp:
- 09/15/14 00:14:01 (10 years ago)
- 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)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/shell/file.t
rb299960 rfc9f8f5 12 12 @itemize @bullet 13 13 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 15 20 @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 16 35 @item @code{mv} - move files 17 36 @item @code{pwd} - print work directory 18 @item @code{ls} - list files in the directory19 @item @code{chdir} - change the current directory20 @item @code{mkdir} - create a directory21 37 @item @code{rmdir} - remove empty directories 22 @item @code{ln} - make links23 @item @code{mknod} - make device special file24 @item @code{chroot} - change the root directory25 @item @code{chmod} - change permissions of a file26 @item @code{cat} - display file contents27 @item @code{msdosfmt} - format disk28 38 @item @code{rm} - remove files 29 @item @code{ mount} - mount disk39 @item @code{umask} - Set file mode creation mask 30 40 @item @code{unmount} - unmount disk 31 @item @code{blksync} - sync the block driver32 @item @code{dd} - format disks33 @item @code{hexdump} - format disks34 @item @code{fdisk} - format disks35 @item @code{dir} - alias for ls36 @item @code{mkrfs} - format RFS file system37 @item @code{cd} - alias for chdir38 @item @code{df} - display file system disk space usage39 @item @code{md5} - display file system disk space usage40 41 41 42 @end itemize … … 52 53 @c 53 54 @page 54 @subsection umask - set file mode creation mask55 56 @pgindex umask55 @subsection blksync - sync the block driver 56 57 @pgindex blksync 57 58 58 59 @subheading SYNOPSYS: 59 60 60 61 @example 61 umask [new_umask] 62 blksync driver 62 63 @end example 63 64 64 65 @subheading DESCRIPTION: 65 66 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. 67 This command XXX 68 68 69 69 @subheading EXIT STATUS: … … 73 73 @subheading NOTES: 74 74 75 This command does not currently support symbolic mode masks. 75 NONE 76 76 77 77 @subheading EXAMPLES: 78 78 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 79 The following is an example of how to use @code{blksync}: 80 81 @example 82 EXAMPLE_TBD 88 83 @end example 89 84 90 85 @subheading CONFIGURATION: 91 86 92 @findex CONFIGURE_SHELL_NO_COMMAND_ UMASK93 @findex CONFIGURE_SHELL_COMMAND_ UMASK87 @findex CONFIGURE_SHELL_NO_COMMAND_BLKSYNC 88 @findex CONFIGURE_SHELL_COMMAND_BLKSYNC 94 89 95 90 This command is included in the default shell command set. 96 91 When building a custom command set, define 97 @code{CONFIGURE_SHELL_COMMAND_ UMASK} to have this92 @code{CONFIGURE_SHELL_COMMAND_BLKSYNC} to have this 98 93 command included. 99 94 100 95 This command can be excluded from the shell command set by 101 defining @code{CONFIGURE_SHELL_NO_COMMAND_ UMASK} when all96 defining @code{CONFIGURE_SHELL_NO_COMMAND_BLKSYNC} when all 102 97 shell commands have been configured. 103 98 104 99 @subheading PROGRAMMING INFORMATION: 105 100 106 @findex rtems_shell_rtems_main_ umask107 108 The @code{ umask} is implemented by a C language function101 @findex rtems_shell_rtems_main_blksync 102 103 The @code{blksync} is implemented by a C language function 109 104 which has the following prototype: 110 105 111 106 @example 112 int rtems_shell_rtems_main_ umask(107 int rtems_shell_rtems_main_blksync( 113 108 int argc, 114 109 char **argv … … 116 111 @end example 117 112 118 The configuration structure for the @code{ umask} has the113 The configuration structure for the @code{blksync} has the 119 114 following prototype: 120 115 121 116 @example 122 extern rtems_shell_cmd_t rtems_shell_ UMASK_Command;117 extern rtems_shell_cmd_t rtems_shell_BLKSYNC_Command; 123 118 @end example 124 119 … … 127 122 @c 128 123 @page 129 @subsection c p - copy files130 131 @pgindex c p124 @subsection cat - display file contents 125 126 @pgindex cat 132 127 133 128 @subheading SYNOPSYS: 134 129 135 130 @example 136 cp [-R [-H | -L | -P]] [-f | -i] [-pv] src target 137 cp [-R [-H | -L] ] [-f | -i] [-NpPv] source_file ... target_directory 131 cat file1 [file2 .. fileN] 138 132 @end example 139 133 140 134 @subheading DESCRIPTION: 141 135 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. 136 This command displays the contents of the specified files. 225 137 226 138 @subheading EXIT STATUS: … … 230 142 @subheading NOTES: 231 143 232 NONE 144 It is possible to read the input from a device file using @code{cat}. 233 145 234 146 @subheading EXAMPLES: 235 147 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 148 The following is an example of how to use @code{cat}: 149 150 @example 151 SHLL [/] # cat /etc/passwd 244 152 root:*:0:0:root::/:/bin/sh 245 153 rtems:*:1:1:RTEMS Application::/:/bin/sh 246 154 tty:!:2:2:tty owner::/:/bin/false 247 SHLL [/] # ls248 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 joel251 3 files 1710 bytes occupied252 @end example253 254 The following is an example of how to use @code{cp} to255 copy one or more files to a destination directory and256 use the same @code{basename} in the destination directory:257 258 @example259 SHLL [/] # mkdir tmp260 SHLL [/] # ls tmp261 0 files 0 bytes occupied262 SHLL [/] # cp /etc/passwd tmp263 SHLL [/] # ls /tmp264 -rw-r--r-- 1 root root 102 Jan 01 00:01 passwd265 1 files 102 bytes occupied266 SHLL [/] # cp /etc/passwd /etc/group /tmp267 SHLL [/] # ls /tmp268 -rw-r--r-- 1 root root 102 Jan 01 00:01 passwd269 -rw-r--r-- 1 root root 42 Jan 01 00:01 group270 2 files 144 bytes occupied271 SHLL [/] #272 155 @end example 273 156 274 157 @subheading CONFIGURATION: 275 158 276 @findex CONFIGURE_SHELL_NO_COMMAND_C P277 @findex CONFIGURE_SHELL_COMMAND_C P159 @findex CONFIGURE_SHELL_NO_COMMAND_CAT 160 @findex CONFIGURE_SHELL_COMMAND_CAT 278 161 279 162 This command is included in the default shell command set. 280 163 When building a custom command set, define 281 @code{CONFIGURE_SHELL_COMMAND_C P} to have this164 @code{CONFIGURE_SHELL_COMMAND_CAT} to have this 282 165 command included. 283 166 284 167 This command can be excluded from the shell command set by 285 defining @code{CONFIGURE_SHELL_NO_COMMAND_C P} when all168 defining @code{CONFIGURE_SHELL_NO_COMMAND_CAT} when all 286 169 shell commands have been configured. 287 170 288 171 @subheading PROGRAMMING INFORMATION: 289 172 290 @findex rtems_shell_rtems_main_c p291 292 The @code{c p} command is implemented by a C language function which293 has the following prototype:294 295 @example 296 int rtems_shell_rtems_main_c p(173 @findex rtems_shell_rtems_main_cat 174 175 The @code{cat} is implemented by a C language function 176 which has the following prototype: 177 178 @example 179 int rtems_shell_rtems_main_cat( 297 180 int argc, 298 181 char **argv … … 300 183 @end example 301 184 302 The configuration structure for the @code{c p} has the185 The configuration structure for the @code{cat} has the 303 186 following prototype: 304 187 305 188 @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. 189 extern rtems_shell_cmd_t rtems_shell_CAT_Command; 190 @end example 313 191 314 192 @c … … 316 194 @c 317 195 @page 318 @subsection mv - move files319 320 @pgindex mv196 @subsection cd - alias for chdir 197 198 @pgindex cd 321 199 322 200 @subheading SYNOPSYS: 323 201 324 202 @example 325 mv [-fiv] source_file target_file 326 mv [-fiv] source_file... target_file 203 cd directory 327 204 @end example 328 205 329 206 @subheading DESCRIPTION: 330 207 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 208 This command is an alias or alternate name for the @code{chdir}. 209 See @ref{File and Directory Commands chdir - change the current directory, cd} 210 for more information. 381 211 382 212 @subheading EXIT STATUS: 383 213 384 Th e @code{mv} utility exits 0 on success, and >0 if an error occurs.214 This command returns 0 on success and non-zero if an error is encountered. 385 215 386 216 @subheading NOTES: … … 390 220 @subheading EXAMPLES: 391 221 392 @example 393 SHLL [/] mv /dev/console /dev/con1 222 The following is an example of how to use @code{cd}: 223 224 @example 225 SHLL [/] $ cd etc 226 SHLL [/etc] $ cd / 227 SHLL [/] $ cd /etc 228 SHLL [/etc] $ pwd 229 /etc 230 SHLL [/etc] $ cd / 231 SHLL [/] $ pwd 232 / 233 SHLL [/] $ cd etc 234 SHLL [/etc] $ cd .. 235 SHLL [/] $ pwd 236 / 394 237 @end example 395 238 396 239 @subheading CONFIGURATION: 397 240 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 244 This command is included in the default shell command set. 245 When building a custom command set, define 246 @code{CONFIGURE_SHELL_COMMAND_CD} to have this 247 command included. 404 248 405 249 This command can be excluded from the shell command set by 406 defining @code{CONFIGURE_SHELL_NO_COMMAND_ MV} when all250 defining @code{CONFIGURE_SHELL_NO_COMMAND_CD} when all 407 251 shell commands have been configured. 408 252 409 253 @subheading PROGRAMMING INFORMATION: 410 254 411 @findex rtems_shell_rtems_main_ mv412 413 The @code{ mv} command is implemented by a C language function which414 has the following prototype:415 416 @example 417 int rtems_shell_rtems_main_ mv(255 @findex rtems_shell_rtems_main_cd 256 257 The @code{cd} is implemented by a C language function 258 which has the following prototype: 259 260 @example 261 int rtems_shell_rtems_main_cd( 418 262 int argc, 419 263 char **argv … … 421 265 @end example 422 266 423 The configuration structure for the @code{ mv} has the267 The configuration structure for the @code{cd} has the 424 268 following prototype: 425 269 426 270 @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; 271 extern rtems_shell_cmd_t rtems_shell_CD_Command; 592 272 @end example 593 273 … … 665 345 @example 666 346 extern rtems_shell_cmd_t rtems_shell_CHDIR_Command; 667 @end example668 669 @c670 @c671 @c672 @page673 @subsection mkdir - create a directory674 675 @pgindex mkdir676 677 @subheading SYNOPSYS:678 679 @example680 mkdir dir [dir1 .. dirN]681 @end example682 683 @subheading DESCRIPTION:684 685 This command creates the set of directories in the order they686 are specified on the command line. If an error is encountered687 making one of the directories, the command will continue to688 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 user700 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 @example707 SHLL [/] # ls708 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 occupied711 SHLL [/] # mkdir joel712 SHLL [/] # ls joel713 0 files 0 bytes occupied714 SHLL [/] # cp etc/passwd joel715 SHLL [/] # ls joel716 -rw-r--r-- 1 root root 102 Jan 01 00:02 passwd717 1 files 102 bytes occupied718 @end example719 720 @subheading CONFIGURATION:721 722 @findex CONFIGURE_SHELL_NO_COMMAND_MKDIR723 @findex CONFIGURE_SHELL_COMMAND_MKDIR724 725 This command is included in the default shell command set.726 When building a custom command set, define727 @code{CONFIGURE_SHELL_COMMAND_MKDIR} to have this728 command included.729 730 This command can be excluded from the shell command set by731 defining @code{CONFIGURE_SHELL_NO_COMMAND_MKDIR} when all732 shell commands have been configured.733 734 @subheading PROGRAMMING INFORMATION:735 736 @findex rtems_shell_rtems_main_mkdir737 738 The @code{mkdir} is implemented by a C language function739 which has the following prototype:740 741 @example742 int rtems_shell_rtems_main_mkdir(743 int argc,744 char **argv745 );746 @end example747 748 The configuration structure for the @code{mkdir} has the749 following prototype:750 751 @example752 extern rtems_shell_cmd_t rtems_shell_MKDIR_Command;753 @end example754 755 @c756 @c757 @c758 @page759 @subsection rmdir - remove empty directories760 761 @pgindex rmdir762 763 @subheading SYNOPSYS:764 765 @example766 rmdir [dir1 .. dirN]767 @end example768 769 @subheading DESCRIPTION:770 771 This command removes the specified set of directories. If no772 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)} system781 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 @example788 SHLL [/] # mkdir joeldir789 SHLL [/] # rmdir joeldir790 SHLL [/] # ls joeldir791 joeldir: No such file or directory.792 @end example793 794 @subheading CONFIGURATION:795 796 @findex CONFIGURE_SHELL_NO_COMMAND_RMDIR797 @findex CONFIGURE_SHELL_COMMAND_RMDIR798 799 This command is included in the default shell command set.800 When building a custom command set, define801 @code{CONFIGURE_SHELL_COMMAND_RMDIR} to have this802 command included.803 804 This command can be excluded from the shell command set by805 defining @code{CONFIGURE_SHELL_NO_COMMAND_RMDIR} when all806 shell commands have been configured.807 808 @subheading PROGRAMMING INFORMATION:809 810 @findex rtems_shell_rtems_main_rmdir811 812 The @code{rmdir} is implemented by a C language function813 which has the following prototype:814 815 @example816 int rtems_shell_rtems_main_rmdir(817 int argc,818 char **argv819 );820 @end example821 822 The configuration structure for the @code{rmdir} has the823 following prototype:824 825 @example826 extern rtems_shell_cmd_t rtems_shell_RMDIR_Command;827 @end example828 829 @c830 @c831 @c832 @page833 @subsection ln - make links834 835 @pgindex ln836 837 @subheading SYNOPSYS:838 839 @example840 ln [-fhinsv] source_file [target_file]841 ln [-fhinsv] source_file ... target_dir842 @end example843 844 @subheading DESCRIPTION:845 846 The ln utility creates a new directory entry (linked file) which has847 the same modes as the original file. It is useful for maintaining848 multiple copies of a file in many places at once without using up849 storage for the ``copies''; instead, a link ``points'' to the original850 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 a852 hard or symbolic link.853 854 The options are as follows:855 @table @b856 @item -f857 Unlink any already existing file, permitting the link to occur.858 859 @item -h860 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 may862 point to a directory.863 864 @item -i865 Cause ln to write a prompt to standard error if the target file866 exists. If the response from the standard input begins with the867 character `y' or `Y', then unlink the target file so that the link may868 occur. Otherwise, do not attempt the link. (The -i option overrides869 any previous -f options.)870 871 @item -n872 Same as -h, for compatibility with other ln implementations.873 874 @item -s875 Create a symbolic link.876 877 @item -v878 Cause ln to be verbose, showing files as they are processed.879 @end table880 881 By default ln makes hard links. A hard link to a file is882 indistinguishable from the original directory entry; any changes to a883 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 file885 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 on889 the link. A @i{stat} on a symbolic link will return the linked-to890 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 symbolic892 link. Symbolic links may span file systems and may refer to893 directories.894 895 Given one or two arguments, ln creates a link to an existing file896 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 the899 directory is specified, the link will be made to the last component of900 source_file.901 902 Given more than two arguments, ln makes links in target_dir to all the903 named source files. The links made will have the same name as the904 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 NONE913 914 @subheading EXAMPLES:915 916 @example917 SHLL [/] ln -s /dev/console /dev/con1918 @end example919 920 @subheading CONFIGURATION:921 922 @findex CONFIGURE_SHELL_NO_COMMAND_LN923 @findex CONFIGURE_SHELL_COMMAND_LN924 925 This command is included in the default shell command set. When926 building a custom command set, define927 @code{CONFIGURE_SHELL_COMMAND_LN} to have this command included.928 929 This command can be excluded from the shell command set by930 defining @code{CONFIGURE_SHELL_NO_COMMAND_LN} when all931 shell commands have been configured.932 933 @subheading PROGRAMMING INFORMATION:934 935 @findex rtems_shell_rtems_main_ln936 937 The @code{ln} command is implemented by a C language function which938 has the following prototype:939 940 @example941 int rtems_shell_rtems_main_ln(942 int argc,943 char **argv944 );945 @end example946 947 The configuration structure for the @code{ln} has the following948 prototype:949 950 @example951 extern rtems_shell_cmd_t rtems_shell_LN_Command;952 @end example953 954 @subheading ORIGIN:955 956 The implementation and portions of the documentation for this command957 are from NetBSD 4.0.958 959 @c960 @c961 @c962 @page963 @subsection mknod - make device special file964 965 @pgindex mknod966 967 @subheading SYNOPSYS:968 969 @example970 mknod [-rR] [-F fmt] [-g gid] [-m mode] [-u uid] name [c | b]971 [driver | major] minor972 mknod [-rR] [-F fmt] [-g gid] [-m mode] [-u uid] name [c | b]973 major unit subunit974 mknod [-rR] [-g gid] [-m mode] [-u uid] name [c | b] number975 mknod [-rR] [-g gid] [-m mode] [-u uid] name p976 @end example977 978 @subheading DESCRIPTION:979 980 The mknod command creates device special files, or fifos. Normally981 the shell script /dev/MAKEDEV is used to create special files for982 commonly known devices; it executes mknod with the appropriate983 arguments and can make all the files required for the device.984 985 To make nodes manually, the arguments are:986 987 @table @b988 @item -r989 Replace an existing file if its type is incorrect.990 991 @item -R992 Replace an existing file if its type is incorrect. Correct the993 mode, user and group.994 995 @item -g gid996 Specify the group for the device node. The gid operand may be a997 numeric group ID or a group name. If a group name is also a numeric998 group ID, the operand is used as a group name. Precede a numeric999 group ID with a # to stop it being treated as a name.1000 1001 @item -m mode1002 Specify the mode for the device node. The mode may be absolute or1003 symbolic, see @i{chmod}.1004 1005 @item -u uid1006 Specify the user for the device node. The uid operand may be a1007 numeric user ID or a user name. If a user name is also a numeric user1008 ID, the operand is used as a user name. Precede a numeric user ID1009 with a # to stop it being treated as a name.1010 1011 @item name1012 Device name, for example ``tty'' for a termios serial device or ``hd''1013 for a disk.1014 1015 @item b | c | p1016 Type of device. If the device is a block type device such as a tape1017 or disk drive which needs both cooked and raw special files, the type1018 is b. All other devices are character type devices, such as terminal1019 and pseudo devices, and are type c. Specifying p creates fifo files.1020 1021 @item driver | major1022 The major device number is an integer number which tells the kernel1023 which device driver entry point to use. If the device driver is1024 configured into the current kernel it may be specified by driver name1025 or major number.1026 1027 @item minor1028 The minor device number tells the kernel which one of several similar1029 devices the node corresponds to; for example, it may be a specific1030 serial port or pty.1031 1032 @item unit and subunit1033 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 on1035 that disk. (Currently this form of specification is only supported1036 by the bsdos format, for compatibility with the BSD/OS mknod).1037 1038 @item number1039 A single opaque device number. Useful for netbooted computers which1040 require device numbers packed in a format that isn't supported by1041 -F.1042 @end table1043 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 NONE1051 1052 @subheading EXAMPLES:1053 1054 @example1055 SHLL [/] mknod c 3 0 /dev/ttyS101056 @end example1057 1058 @subheading CONFIGURATION:1059 1060 @findex CONFIGURE_SHELL_NO_COMMAND_MKNOD1061 @findex CONFIGURE_SHELL_COMMAND_MKNOD1062 1063 This command is included in the default shell command set. When1064 building a custom command set, define1065 @code{CONFIGURE_SHELL_COMMAND_MKNOD} to have this command included.1066 1067 This command can be excluded from the shell command set by1068 defining @code{CONFIGURE_SHELL_NO_COMMAND_MKNOD} when all1069 shell commands have been configured.1070 1071 @subheading PROGRAMMING INFORMATION:1072 1073 @findex rtems_shell_rtems_main_mknod1074 1075 The @code{mknod} command is implemented by a C language function which1076 has the following prototype:1077 1078 @example1079 int rtems_shell_rtems_main_mknod(1080 int argc,1081 char **argv1082 );1083 @end example1084 1085 The configuration structure for the @code{mknod} has the following1086 prototype:1087 1088 @example1089 extern rtems_shell_cmd_t rtems_shell_MKNOD_Command;1090 @end example1091 1092 @subheading ORIGIN:1093 1094 The implementation and portions of the documentation for this command1095 are from NetBSD 4.0.1096 1097 @c1098 @c1099 @c1100 @page1101 @subsection chroot - change the root directory1102 1103 @pgindex chroot1104 1105 @subheading SYNOPSYS:1106 1107 @example1108 chroot [dir]1109 @end example1110 1111 @subheading DESCRIPTION:1112 1113 This command changes the root directory to @code{dir} for subsequent1114 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 NONE1125 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 subsequent1130 command invocations:1131 1132 @example1133 SHLL [/] $ cat passwd1134 cat: passwd: No such file or directory1135 SHLL [/] $ chroot etc1136 SHLL [/] $ cat passwd1137 root:*:0:0:root::/:/bin/sh1138 rtems:*:1:1:RTEMS Application::/:/bin/sh1139 tty:!:2:2:tty owner::/:/bin/false1140 SHLL [/] $ cat /etc/passwd1141 cat: /etc/passwd: No such file or directory1142 @end example1143 1144 @subheading CONFIGURATION:1145 1146 @findex CONFIGURE_SHELL_NO_COMMAND_CHROOT1147 @findex CONFIGURE_SHELL_COMMAND_CHROOT1148 1149 This command is included in the default shell command set.1150 When building a custom command set, define1151 @code{CONFIGURE_SHELL_COMMAND_CHROOT} to have this1152 command included. Additional to that you have to add one1153 POSIX key value pair for each thread where you want to use1154 the command.1155 1156 This command can be excluded from the shell command set by1157 defining @code{CONFIGURE_SHELL_NO_COMMAND_CHROOT} when all1158 shell commands have been configured.1159 1160 @subheading PROGRAMMING INFORMATION:1161 1162 @findex rtems_shell_rtems_main_chroot1163 1164 The @code{chroot} is implemented by a C language function1165 which has the following prototype:1166 1167 @example1168 int rtems_shell_rtems_main_chroot(1169 int argc,1170 char **argv1171 );1172 @end example1173 1174 The configuration structure for the @code{chroot} has the1175 following prototype:1176 1177 @example1178 extern rtems_shell_cmd_t rtems_shell_CHROOT_Command;1179 347 @end example 1180 348 … … 1283 451 @c 1284 452 @page 1285 @subsection c at - display file contents1286 1287 @pgindex c at453 @subsection chroot - change the root directory 454 455 @pgindex chroot 1288 456 1289 457 @subheading SYNOPSYS: 1290 458 1291 459 @example 1292 c at file1 [file2 .. fileN]460 chroot [dir] 1293 461 @end example 1294 462 1295 463 @subheading DESCRIPTION: 1296 464 1297 This command displays the contents of the specified files. 465 This command changes the root directory to @code{dir} for subsequent 466 commands. 1298 467 1299 468 @subheading EXIT STATUS: … … 1301 470 This command returns 0 on success and non-zero if an error is encountered. 1302 471 472 The destination directory @code{dir} must exist. 473 1303 474 @subheading NOTES: 1304 475 1305 It is possible to read the input from a device file using @code{cat}. 476 NONE 1306 477 1307 478 @subheading EXAMPLES: 1308 479 1309 The following is an example of how to use @code{cat}: 1310 1311 @example 1312 SHLL [/] # cat /etc/passwd 480 The following is an example of how to use @code{chroot} 481 and the impact it has on the environment for subsequent 482 command invocations: 483 484 @example 485 SHLL [/] $ cat passwd 486 cat: passwd: No such file or directory 487 SHLL [/] $ chroot etc 488 SHLL [/] $ cat passwd 1313 489 root:*:0:0:root::/:/bin/sh 1314 490 rtems:*:1:1:RTEMS Application::/:/bin/sh 1315 491 tty:!:2:2:tty owner::/:/bin/false 492 SHLL [/] $ cat /etc/passwd 493 cat: /etc/passwd: No such file or directory 1316 494 @end example 1317 495 1318 496 @subheading CONFIGURATION: 1319 497 1320 @findex CONFIGURE_SHELL_NO_COMMAND_C AT1321 @findex CONFIGURE_SHELL_COMMAND_C AT498 @findex CONFIGURE_SHELL_NO_COMMAND_CHROOT 499 @findex CONFIGURE_SHELL_COMMAND_CHROOT 1322 500 1323 501 This command is included in the default shell command set. 1324 502 When 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 504 command included. Additional to that you have to add one 505 POSIX key value pair for each thread where you want to use 506 the command. 1327 507 1328 508 This command can be excluded from the shell command set by 1329 defining @code{CONFIGURE_SHELL_NO_COMMAND_C AT} when all509 defining @code{CONFIGURE_SHELL_NO_COMMAND_CHROOT} when all 1330 510 shell commands have been configured. 1331 511 1332 512 @subheading PROGRAMMING INFORMATION: 1333 513 1334 @findex rtems_shell_rtems_main_c at1335 1336 The @code{c at} is implemented by a C language function514 @findex rtems_shell_rtems_main_chroot 515 516 The @code{chroot} is implemented by a C language function 1337 517 which has the following prototype: 1338 518 1339 519 @example 1340 int rtems_shell_rtems_main_c at(520 int rtems_shell_rtems_main_chroot( 1341 521 int argc, 1342 522 char **argv … … 1344 524 @end example 1345 525 1346 The configuration structure for the @code{c at} has the526 The configuration structure for the @code{chroot} has the 1347 527 following prototype: 1348 528 1349 529 @example 1350 extern rtems_shell_cmd_t rtems_shell_C AT_Command;530 extern rtems_shell_cmd_t rtems_shell_CHROOT_Command; 1351 531 @end example 1352 532 … … 1355 535 @c 1356 536 @page 1357 @subsection rm - removefiles1358 1359 @pgindex rm537 @subsection cp - copy files 538 539 @pgindex cp 1360 540 1361 541 @subheading SYNOPSYS: 1362 542 1363 543 @example 1364 rm file1 [file2 ... fileN] 544 cp [-R [-H | -L | -P]] [-f | -i] [-pv] src target 545 cp [-R [-H | -L] ] [-f | -i] [-NpPv] source_file ... target_directory 1365 546 @end example 1366 547 1367 548 @subheading DESCRIPTION: 1368 549 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. 550 In the first synopsis form, the cp utility copies the contents of the 551 source_file to the target_file. In the second synopsis form, the contents of 552 each named source_file is copied to the destination target_directory. The names 553 of the files themselves are not changed. If cp detects an attempt to copy a 554 file to itself, the copy will fail. 555 556 The following options are available: 557 558 @table @b 559 @item -f 560 For each existing destination pathname, attempt to overwrite it. If permissions 561 do not allow copy to succeed, remove it and create a new file, without 562 prompting for confirmation. (The -i option is ignored if the -f option is 563 specified.) 564 565 @item -H 566 If 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 570 Causes cp to write a prompt to the standard error output before copying a file 571 that would overwrite an existing file. If the response from the standard input 572 begins with the character 'y', the file copy is attempted. 573 574 @item -L 575 If the -R option is specified, all symbolic links are followed. 576 577 @item -N 578 When used with -p, do not copy file flags. 579 580 @item -P 581 No symbolic links are followed. 582 583 @item -p 584 Causes cp to preserve in the copy as many of the modification time, access 585 time, file flags, file mode, user ID, and group ID as allowed by permissions. 586 587 If the user ID and group ID cannot be preserved, no error message is displayed 588 and the exit value is not altered. 589 590 If the source file has its set user ID bit on and the user ID cannot be 591 preserved, the set user ID bit is not preserved in the copy's permissions. If 592 the source file has its set group ID bit on and the group ID cannot be 593 preserved, the set group ID bit is not preserved in the copy's permissions. If 594 the source file has both its set user ID and set group ID bits on, and either 595 the user ID or group ID cannot be preserved, neither the set user ID or set 596 group ID bits are preserved in the copy's permissions. 597 598 @item -R 599 If source_file designates a directory, cp copies the directory and the entire 600 subtree connected at that point. This option also causes symbolic links to be 601 copied, rather than indirected through, and for cp to create special files 602 rather than copying them as normal files. Created directories have the same 603 mode as the corresponding source directory, unmodified by the process's umask. 604 605 @item -v 606 Cause cp to be verbose, showing files as they are copied. 607 608 @end table 609 610 For each destination file that already exists, its contents are overwritten if 611 permissions allow, but its mode, user ID, and group ID are unchanged. 612 613 In the second synopsis form, target_directory must exist unless there is only 614 one named source_file which is a directory and the -R flag is specified. 615 616 If the destination file does not exist, the mode of the source file is used as 617 modified by the file mode creation mask (umask, see csh(1)). If the source file 618 has its set user ID bit on, that bit is removed unless both the source file and 619 the destination file are owned by the same user. If the source file has its set 620 group ID bit on, that bit is removed unless both the source file and the 621 destination file are in the same group and the user is a member of that group. 622 If both the set user ID and set group ID bits are set, all of the above 623 conditions must be fulfilled or both bits are removed. 624 625 Appropriate permissions are required for file creation or overwriting. 626 627 Symbolic links are always followed unless the -R flag is set, in which case 628 symbolic links are not followed, by default. The -H or -L flags (in conjunction 629 with the -R flag), as well as the -P flag cause symbolic links to be followed 630 as described above. The -H and -L options are ignored unless the -R option is 631 specified. In addition, these options override eachsubhedading other and the 632 command's actions are determined by the last one specified. 1378 633 1379 634 @subheading EXIT STATUS: … … 1387 642 @subheading EXAMPLES: 1388 643 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 644 The following is an example of how to use @code{cp} to 645 copy a file to a new name in the current directory: 646 647 @example 648 SHLL [/] # cat joel 649 cat: joel: No such file or directory 650 SHLL [/] # cp etc/passwd joel 651 SHLL [/] # cat joel 1394 652 root:*:0:0:root::/:/bin/sh 1395 653 rtems:*:1:1:RTEMS Application::/:/bin/sh 1396 654 tty:!:2:2:tty owner::/:/bin/false 1397 SHLL [/] # rm tmpfile 1398 SHLL [/] # cat tmpfile 1399 cat: tmpfile: No such file or directory 655 SHLL [/] # ls 656 drwxr-xr-x 1 root root 536 Jan 01 00:00 dev/ 657 drwxr-xr-x 1 root root 1072 Jan 01 00:00 etc/ 658 -rw-r--r-- 1 root root 102 Jan 01 00:00 joel 659 3 files 1710 bytes occupied 660 @end example 661 662 The following is an example of how to use @code{cp} to 663 copy one or more files to a destination directory and 664 use the same @code{basename} in the destination directory: 665 666 @example 667 SHLL [/] # mkdir tmp 668 SHLL [/] # ls tmp 669 0 files 0 bytes occupied 670 SHLL [/] # cp /etc/passwd tmp 671 SHLL [/] # ls /tmp 672 -rw-r--r-- 1 root root 102 Jan 01 00:01 passwd 673 1 files 102 bytes occupied 674 SHLL [/] # cp /etc/passwd /etc/group /tmp 675 SHLL [/] # 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 678 2 files 144 bytes occupied 679 SHLL [/] # 1400 680 @end example 1401 681 1402 682 @subheading CONFIGURATION: 1403 683 1404 @findex CONFIGURE_SHELL_NO_COMMAND_ RM1405 @findex CONFIGURE_SHELL_COMMAND_ RM684 @findex CONFIGURE_SHELL_NO_COMMAND_CP 685 @findex CONFIGURE_SHELL_COMMAND_CP 1406 686 1407 687 This command is included in the default shell command set. 1408 688 When building a custom command set, define 1409 @code{CONFIGURE_SHELL_COMMAND_ RM} to have this689 @code{CONFIGURE_SHELL_COMMAND_CP} to have this 1410 690 command included. 1411 691 1412 692 This command can be excluded from the shell command set by 1413 defining @code{CONFIGURE_SHELL_NO_COMMAND_ RM} when all693 defining @code{CONFIGURE_SHELL_NO_COMMAND_CP} when all 1414 694 shell commands have been configured. 1415 695 1416 696 @subheading PROGRAMMING INFORMATION: 1417 697 1418 @findex rtems_shell_rtems_main_ rm1419 1420 The @code{ rm} is implemented by a C language function1421 whichhas the following prototype:1422 1423 @example 1424 int rtems_shell_rtems_main_ rm(698 @findex rtems_shell_rtems_main_cp 699 700 The @code{cp} command is implemented by a C language function which 701 has the following prototype: 702 703 @example 704 int rtems_shell_rtems_main_cp( 1425 705 int argc, 1426 706 char **argv … … 1428 708 @end example 1429 709 1430 The configuration structure for the @code{ rm} has the710 The configuration structure for the @code{cp} has the 1431 711 following prototype: 1432 712 1433 713 @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 714 extern rtems_shell_cmd_t rtems_shell_CP_Command; 715 @end example 716 717 @subheading ORIGIN: 718 719 The implementation and portions of the documentation for this 720 command are from NetBSD 4.0. 1705 721 1706 722 @c … … 1953 969 extern rtems_shell_cmd_t rtems_shell_DD_Command; 1954 970 @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 983 debugrfs [-hl] path command [options] 984 @end example 985 986 @subheading DESCRIPTION: 987 988 The command provides debugging information for the RFS file system. 989 990 The options are: 991 992 @table @b 993 @item -h 994 Print a help message. 995 996 @item -l 997 List the commands. 998 999 @item path 1000 Path to the mounted RFS file system. The file system has to be mounted 1001 to view to use this command. 1002 @end table 1003 1004 The commands are: 1005 1006 @table @b 1007 @item block start [end] 1008 Display the contents of the blocks from start to end. 1009 1010 @item data 1011 Display the file system data and configuration. 1012 1013 @item dir bno 1014 Process the block as a directory displaying the entries. 1015 1016 @item group start [end] 1017 Display the group data from the start group to the end group. 1018 1019 @item inode [-aef] [start] [end] 1020 Display the inodes between start and end. If no start and end is 1021 provides all inodes are displayed. 1022 1023 @table @b 1024 @item -a 1025 Display all inodes. That is allocated and unallocated inodes. 1026 @item -e 1027 Search and display on inodes that have an error. 1028 @item -f 1029 Force display of inodes, even when in error. 1030 @end table 1031 @end table 1032 1033 @subheading EXIT STATUS: 1034 1035 This command returns 0 on success and non-zero if an error is encountered. 1036 1037 @subheading NOTES: 1038 1039 NONE 1040 1041 @subheading EXAMPLES: 1042 1043 The following is an example of how to use @code{debugrfs}: 1044 1045 @example 1046 SHLL [/] $ 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 1054 This command is included in the default shell command set. 1055 When building a custom command set, define 1056 @code{CONFIGURE_SHELL_COMMAND_DEBUGRFS} to have this 1057 command included. 1058 1059 This command can be excluded from the shell command set by 1060 defining @code{CONFIGURE_SHELL_NO_COMMAND_DEBUGRFS} when all 1061 shell commands have been configured. 1062 1063 @subheading PROGRAMMING INFORMATION: 1064 1065 @findex rtems_shell_rtems_main_debugrfs 1066 1067 The @code{debugrfs} command is implemented by a C language function which 1068 has the following prototype: 1069 1070 @example 1071 int rtems_shell_rtems_main_debugrfs( 1072 int argc, 1073 char **argv 1074 ); 1075 @end example 1076 1077 The configuration structure for @code{debugrfs} has the following 1078 prototype: 1079 1080 @example 1081 extern 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 1095 df [-h] [-B block_size] 1096 @end example 1097 1098 @subheading DESCRIPTION: 1099 1100 This command print disk space usage for mounted file systems. 1101 1102 @subheading EXIT STATUS: 1103 1104 This command returns 0 on success and non-zero if an error is encountered. 1105 1106 @subheading NOTES: 1107 1108 NONE 1109 1110 @subheading EXAMPLES: 1111 1112 The following is an example of how to use @code{df}: 1113 1114 @example 1115 SHLL [/] $ df -B 4K 1116 Filesystem 4K-blocks Used Available Use% Mounted on 1117 /dev/rda 124 1 124 0% /mnt/ramdisk 1118 SHLL [/] $ df 1119 Filesystem 1K-blocks Used Available Use% Mounted on 1120 /dev/rda 495 1 494 0% /mnt/ramdisk 1121 SHLL [/] $ df -h 1122 Filesystem 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 1131 This command is included in the default shell command set. 1132 When building a custom command set, define 1133 @code{CONFIGURE_SHELL_COMMAND_DF} to have this 1134 command included. 1135 1136 This command can be excluded from the shell command set by 1137 defining @code{CONFIGURE_SHELL_NO_COMMAND_DF} when all 1138 shell commands have been configured. 1139 1140 @subheading PROGRAMMING INFORMATION: 1141 1142 @findex rtems_shell_rtems_main_df 1143 1144 The @code{df} is implemented by a C language function 1145 which has the following prototype: 1146 1147 @example 1148 int rtems_shell_main_df( 1149 int argc, 1150 char **argv 1151 ); 1152 @end example 1153 1154 The configuration structure for the @code{df} has the 1155 following prototype: 1156 1157 @example 1158 extern 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 1172 dir [dir] 1173 @end example 1174 1175 @subheading DESCRIPTION: 1176 1177 This command is an alias or alternate name for the @code{ls}. 1178 See @ref{File and Directory Commands ls - list files in the directory, ls} 1179 for more information. 1180 1181 @subheading EXIT STATUS: 1182 1183 This command returns 0 on success and non-zero if an error is encountered. 1184 1185 @subheading NOTES: 1186 1187 NONE 1188 1189 @subheading EXAMPLES: 1190 1191 The following is an example of how to use @code{dir}: 1192 1193 @example 1194 SHLL [/] $ dir 1195 drwxr-xr-x 1 root root 536 Jan 01 00:00 dev/ 1196 drwxr-xr-x 1 root root 1072 Jan 01 00:00 etc/ 1197 2 files 1608 bytes occupied 1198 SHLL [/] $ 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 1203 4 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 1211 This command is included in the default shell command set. 1212 When building a custom command set, define 1213 @code{CONFIGURE_SHELL_COMMAND_DIR} to have this 1214 command included. 1215 1216 This command can be excluded from the shell command set by 1217 defining @code{CONFIGURE_SHELL_NO_COMMAND_DIR} when all 1218 shell commands have been configured. 1219 1220 @subheading PROGRAMMING INFORMATION: 1221 1222 @findex rtems_shell_rtems_main_dir 1223 1224 The @code{dir} is implemented by a C language function 1225 which has the following prototype: 1226 1227 @example 1228 int rtems_shell_rtems_main_dir( 1229 int argc, 1230 char **argv 1231 ); 1232 @end example 1233 1234 The configuration structure for the @code{dir} has the 1235 following prototype: 1236 1237 @example 1238 extern 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 1252 fdisk 1253 @end example 1254 1255 @subheading CONFIGURATION: 1256 1257 @findex CONFIGURE_SHELL_NO_COMMAND_FDISK 1258 @findex CONFIGURE_SHELL_COMMAND_FDISK 1259 1260 This command is included in the default shell command set. 1261 When building a custom command set, define 1262 @code{CONFIGURE_SHELL_COMMAND_FDISK} to have this 1263 command included. 1264 1265 This command can be excluded from the shell command set by 1266 defining @code{CONFIGURE_SHELL_NO_COMMAND_FDISK} when all 1267 shell commands have been configured. 1955 1268 1956 1269 @c … … 2230 1543 @c 2231 1544 @page 2232 @subsection fdisk - format disk2233 2234 @pgindex fdisk1545 @subsection ln - make links 1546 1547 @pgindex ln 2235 1548 2236 1549 @subheading SYNOPSYS: 2237 1550 2238 1551 @example 2239 fdisk 1552 ln [-fhinsv] source_file [target_file] 1553 ln [-fhinsv] source_file ... target_dir 1554 @end example 1555 1556 @subheading DESCRIPTION: 1557 1558 The ln utility creates a new directory entry (linked file) which has 1559 the same modes as the original file. It is useful for maintaining 1560 multiple copies of a file in many places at once without using up 1561 storage for the ``copies''; instead, a link ``points'' to the original 1562 copy. There are two types of links; hard links and symbolic links. 1563 How a link ``points'' to a file is one of the differences between a 1564 hard or symbolic link. 1565 1566 The options are as follows: 1567 @table @b 1568 @item -f 1569 Unlink any already existing file, permitting the link to occur. 1570 1571 @item -h 1572 If the target_file or target_dir is a symbolic link, do not follow it. 1573 This is most useful with the -f option, to replace a symlink which may 1574 point to a directory. 1575 1576 @item -i 1577 Cause ln to write a prompt to standard error if the target file 1578 exists. If the response from the standard input begins with the 1579 character `y' or `Y', then unlink the target file so that the link may 1580 occur. Otherwise, do not attempt the link. (The -i option overrides 1581 any previous -f options.) 1582 1583 @item -n 1584 Same as -h, for compatibility with other ln implementations. 1585 1586 @item -s 1587 Create a symbolic link. 1588 1589 @item -v 1590 Cause ln to be verbose, showing files as they are processed. 1591 @end table 1592 1593 By default ln makes hard links. A hard link to a file is 1594 indistinguishable from the original directory entry; any changes to a 1595 file are effective independent of the name used to reference the file. 1596 Hard links may not normally refer to directories and may not span file 1597 systems. 1598 1599 A symbolic link contains the name of the file to which it is linked. 1600 The referenced file is used when an @i{open} operation is performed on 1601 the link. A @i{stat} on a symbolic link will return the linked-to 1602 file; an @i{lstat} must be done to obtain information about the link. 1603 The @i{readlink} call may be used to read the contents of a symbolic 1604 link. Symbolic links may span file systems and may refer to 1605 directories. 1606 1607 Given one or two arguments, ln creates a link to an existing file 1608 source_file. If target_file is given, the link has that name; 1609 target_file may also be a directory in which to place the link; 1610 otherwise it is placed in the current directory. If only the 1611 directory is specified, the link will be made to the last component of 1612 source_file. 1613 1614 Given more than two arguments, ln makes links in target_dir to all the 1615 named source files. The links made will have the same name as the 1616 files being linked to. 1617 1618 @subheading EXIT STATUS: 1619 1620 The @code{ln} utility exits 0 on success, and >0 if an error occurs. 1621 1622 @subheading NOTES: 1623 1624 NONE 1625 1626 @subheading EXAMPLES: 1627 1628 @example 1629 SHLL [/] ln -s /dev/console /dev/con1 2240 1630 @end example 2241 1631 2242 1632 @subheading CONFIGURATION: 2243 1633 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 1637 This command is included in the default shell command set. When 1638 building a custom command set, define 1639 @code{CONFIGURE_SHELL_COMMAND_LN} to have this command included. 2251 1640 2252 1641 This command can be excluded from the shell command set by 2253 defining @code{CONFIGURE_SHELL_NO_COMMAND_ FDISK} when all1642 defining @code{CONFIGURE_SHELL_NO_COMMAND_LN} when all 2254 1643 shell commands have been configured. 2255 1644 1645 @subheading PROGRAMMING INFORMATION: 1646 1647 @findex rtems_shell_rtems_main_ln 1648 1649 The @code{ln} command is implemented by a C language function which 1650 has the following prototype: 1651 1652 @example 1653 int rtems_shell_rtems_main_ln( 1654 int argc, 1655 char **argv 1656 ); 1657 @end example 1658 1659 The configuration structure for the @code{ln} has the following 1660 prototype: 1661 1662 @example 1663 extern rtems_shell_cmd_t rtems_shell_LN_Command; 1664 @end example 1665 1666 @subheading ORIGIN: 1667 1668 The implementation and portions of the documentation for this command 1669 are from NetBSD 4.0. 1670 2256 1671 @c 2257 1672 @c 2258 1673 @c 2259 1674 @page 2260 @subsection dir - alias for ls2261 2262 @pgindex dir1675 @subsection ls - list files in the directory 1676 1677 @pgindex ls 2263 1678 2264 1679 @subheading SYNOPSYS: 2265 1680 2266 1681 @example 2267 dir[dir]1682 ls [dir] 2268 1683 @end example 2269 1684 2270 1685 @subheading DESCRIPTION: 2271 1686 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.1687 This command displays the contents of the specified directory. If 1688 no arguments are given, then it displays the contents of the current 1689 working directory. 2275 1690 2276 1691 @subheading EXIT STATUS: … … 2280 1695 @subheading NOTES: 2281 1696 2282 NONE 1697 This command currently does not display information on a set of 1698 files like the POSIX ls(1). It only displays the contents of 1699 entire directories. 2283 1700 2284 1701 @subheading EXAMPLES: 2285 1702 2286 The following is an example of how to use @code{ dir}:2287 2288 @example 2289 SHLL [/] $ dir1703 The following is an example of how to use @code{ls}: 1704 1705 @example 1706 SHLL [/] $ ls 2290 1707 drwxr-xr-x 1 root root 536 Jan 01 00:00 dev/ 2291 1708 drwxr-xr-x 1 root root 1072 Jan 01 00:00 etc/ 2292 1709 2 files 1608 bytes occupied 2293 SHLL [/] $ diretc1710 SHLL [/] $ ls etc 2294 1711 -rw-r--r-- 1 root root 102 Jan 01 00:00 passwd 2295 1712 -rw-r--r-- 1 root root 42 Jan 01 00:00 group … … 2297 1714 -rw-r--r-- 1 root root 28 Jan 01 00:00 issue.net 2298 1715 4 files 202 bytes occupied 1716 SHLL [/] $ 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 2299 1719 @end example 2300 1720 2301 1721 @subheading CONFIGURATION: 2302 1722 2303 @findex CONFIGURE_SHELL_NO_COMMAND_ DIR2304 @findex CONFIGURE_SHELL_COMMAND_ DIR1723 @findex CONFIGURE_SHELL_NO_COMMAND_LS 1724 @findex CONFIGURE_SHELL_COMMAND_LS 2305 1725 2306 1726 This command is included in the default shell command set. 2307 1727 When building a custom command set, define 2308 @code{CONFIGURE_SHELL_COMMAND_ DIR} to have this1728 @code{CONFIGURE_SHELL_COMMAND_LS} to have this 2309 1729 command included. 2310 1730 2311 1731 This command can be excluded from the shell command set by 2312 defining @code{CONFIGURE_SHELL_NO_COMMAND_ DIR} when all1732 defining @code{CONFIGURE_SHELL_NO_COMMAND_LS} when all 2313 1733 shell commands have been configured. 2314 1734 2315 1735 @subheading PROGRAMMING INFORMATION: 2316 1736 2317 @findex rtems_shell_rtems_main_ dir2318 2319 The @code{ dir} is implemented by a C language function1737 @findex rtems_shell_rtems_main_ls 1738 1739 The @code{ls} is implemented by a C language function 2320 1740 which has the following prototype: 2321 1741 2322 1742 @example 2323 int rtems_shell_rtems_main_ dir(1743 int rtems_shell_rtems_main_ls( 2324 1744 int argc, 2325 1745 char **argv … … 2327 1747 @end example 2328 1748 2329 The configuration structure for the @code{ dir} has the1749 The configuration structure for the @code{ls} has the 2330 1750 following prototype: 2331 1751 2332 1752 @example 2333 extern rtems_shell_cmd_t rtems_shell_DIR_Command; 2334 @end example 1753 extern 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 1767 md5 <files> 1768 @end example 1769 1770 @subheading DESCRIPTION: 1771 1772 This command prints the MD5 of a file. You can provide one or more 1773 files on the command line and a hash for each file is printed in a 1774 single line of output. 1775 1776 @subheading EXIT STATUS: 1777 1778 This command returns 0 on success and non-zero if an error is encountered. 1779 1780 @subheading NOTES: 1781 1782 NONE 1783 1784 @subheading EXAMPLES: 1785 1786 The following is an example of how to use @code{md5}: 1787 1788 @example 1789 SHLL [/] $ md5 shell-init 1790 MD5 (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 1798 This command is included in the default shell command set. 1799 When building a custom command set, define 1800 @code{CONFIGURE_SHELL_COMMAND_MD5} to have this 1801 command included. 1802 1803 This command can be excluded from the shell command set by 1804 defining @code{CONFIGURE_SHELL_NO_COMMAND_MD5} when all 1805 shell commands have been configured. 1806 1807 @subheading PROGRAMMING INFORMATION: 1808 1809 @findex rtems_shell_rtems_main_md5 1810 1811 The @code{df} is implemented by a C language function 1812 which has the following prototype: 1813 1814 @example 1815 int rtems_shell_main_md5( 1816 int argc, 1817 char **argv 1818 ); 1819 @end example 1820 1821 The configuration structure for the @code{md5} has the 1822 following prototype: 1823 1824 @example 1825 extern 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 1839 mkdir dir [dir1 .. dirN] 1840 @end example 1841 1842 @subheading DESCRIPTION: 1843 1844 This command creates the set of directories in the order they 1845 are specified on the command line. If an error is encountered 1846 making one of the directories, the command will continue to 1847 attempt to create the remaining directories on the command line. 1848 1849 @subheading EXIT STATUS: 1850 1851 This command returns 0 on success and non-zero if an error is encountered. 1852 1853 @subheading NOTES: 1854 1855 If this command is invoked with no arguments, nothing occurs. 1856 1857 The user must have sufficient permissions to create the directory. 1858 For the @code{fileio} test provided with RTEMS, this means the user 1859 must login as @code{root} not @code{rtems}. 1860 1861 @subheading EXAMPLES: 1862 1863 The following is an example of how to use @code{mkdir}: 1864 1865 @example 1866 SHLL [/] # ls 1867 drwxr-xr-x 1 root root 536 Jan 01 00:00 dev/ 1868 drwxr-xr-x 1 root root 1072 Jan 01 00:00 etc/ 1869 2 files 1608 bytes occupied 1870 SHLL [/] # mkdir joel 1871 SHLL [/] # ls joel 1872 0 files 0 bytes occupied 1873 SHLL [/] # cp etc/passwd joel 1874 SHLL [/] # ls joel 1875 -rw-r--r-- 1 root root 102 Jan 01 00:02 passwd 1876 1 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 1884 This command is included in the default shell command set. 1885 When building a custom command set, define 1886 @code{CONFIGURE_SHELL_COMMAND_MKDIR} to have this 1887 command included. 1888 1889 This command can be excluded from the shell command set by 1890 defining @code{CONFIGURE_SHELL_NO_COMMAND_MKDIR} when all 1891 shell commands have been configured. 1892 1893 @subheading PROGRAMMING INFORMATION: 1894 1895 @findex rtems_shell_rtems_main_mkdir 1896 1897 The @code{mkdir} is implemented by a C language function 1898 which has the following prototype: 1899 1900 @example 1901 int rtems_shell_rtems_main_mkdir( 1902 int argc, 1903 char **argv 1904 ); 1905 @end example 1906 1907 The configuration structure for the @code{mkdir} has the 1908 following prototype: 1909 1910 @example 1911 extern 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 1925 mkdir [-V label] [-s sectors/cluster] [-r size] [-v] path 1926 @end example 1927 1928 @subheading DESCRIPTION: 1929 1930 This 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 1943 This command returns 0 on success and non-zero if an error is encountered. 1944 1945 @subheading NOTES: 1946 1947 NONE 1948 1949 @subheading EXAMPLES: 1950 1951 The following is an example of how to use @code{mkdos}: 1952 1953 @example 1954 SHLL [/] $ 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 1962 This command is included in the default shell command set. 1963 When building a custom command set, define 1964 @code{CONFIGURE_SHELL_COMMAND_MKDOS} to have this 1965 command included. 1966 1967 This command can be excluded from the shell command set by 1968 defining @code{CONFIGURE_SHELL_NO_COMMAND_MKDOS} when all 1969 shell commands have been configured. 1970 1971 @subheading PROGRAMMING INFORMATION: 1972 1973 @findex rtems_shell_rtems_main_mkdos 1974 1975 The @code{mkdos} is implemented by a C language function 1976 which has the following prototype: 1977 1978 @example 1979 int rtems_shell_rtems_main_mkdos( 1980 int argc, 1981 char **argv 1982 ); 1983 @end example 1984 1985 The configuration structure for the @code{mkdos} has the 1986 following prototype: 1987 1988 @example 1989 extern 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 2003 mknod [-rR] [-F fmt] [-g gid] [-m mode] [-u uid] name [c | b] 2004 [driver | major] minor 2005 mknod [-rR] [-F fmt] [-g gid] [-m mode] [-u uid] name [c | b] 2006 major unit subunit 2007 mknod [-rR] [-g gid] [-m mode] [-u uid] name [c | b] number 2008 mknod [-rR] [-g gid] [-m mode] [-u uid] name p 2009 @end example 2010 2011 @subheading DESCRIPTION: 2012 2013 The mknod command creates device special files, or fifos. Normally 2014 the shell script /dev/MAKEDEV is used to create special files for 2015 commonly known devices; it executes mknod with the appropriate 2016 arguments and can make all the files required for the device. 2017 2018 To make nodes manually, the arguments are: 2019 2020 @table @b 2021 @item -r 2022 Replace an existing file if its type is incorrect. 2023 2024 @item -R 2025 Replace an existing file if its type is incorrect. Correct the 2026 mode, user and group. 2027 2028 @item -g gid 2029 Specify the group for the device node. The gid operand may be a 2030 numeric group ID or a group name. If a group name is also a numeric 2031 group ID, the operand is used as a group name. Precede a numeric 2032 group ID with a # to stop it being treated as a name. 2033 2034 @item -m mode 2035 Specify the mode for the device node. The mode may be absolute or 2036 symbolic, see @i{chmod}. 2037 2038 @item -u uid 2039 Specify the user for the device node. The uid operand may be a 2040 numeric user ID or a user name. If a user name is also a numeric user 2041 ID, the operand is used as a user name. Precede a numeric user ID 2042 with a # to stop it being treated as a name. 2043 2044 @item name 2045 Device name, for example ``tty'' for a termios serial device or ``hd'' 2046 for a disk. 2047 2048 @item b | c | p 2049 Type of device. If the device is a block type device such as a tape 2050 or disk drive which needs both cooked and raw special files, the type 2051 is b. All other devices are character type devices, such as terminal 2052 and pseudo devices, and are type c. Specifying p creates fifo files. 2053 2054 @item driver | major 2055 The major device number is an integer number which tells the kernel 2056 which device driver entry point to use. If the device driver is 2057 configured into the current kernel it may be specified by driver name 2058 or major number. 2059 2060 @item minor 2061 The minor device number tells the kernel which one of several similar 2062 devices the node corresponds to; for example, it may be a specific 2063 serial port or pty. 2064 2065 @item unit and subunit 2066 The unit and subunit numbers select a subset of a device; for example, 2067 the unit may specify a particular disk, and the subunit a partition on 2068 that disk. (Currently this form of specification is only supported 2069 by the bsdos format, for compatibility with the BSD/OS mknod). 2070 2071 @item number 2072 A single opaque device number. Useful for netbooted computers which 2073 require device numbers packed in a format that isn't supported by 2074 -F. 2075 @end table 2076 2077 @subheading EXIT STATUS: 2078 2079 The @code{mknod} utility exits 0 on success, and >0 if an error occurs. 2080 2081 @subheading NOTES: 2082 2083 NONE 2084 2085 @subheading EXAMPLES: 2086 2087 @example 2088 SHLL [/] 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 2096 This command is included in the default shell command set. When 2097 building a custom command set, define 2098 @code{CONFIGURE_SHELL_COMMAND_MKNOD} to have this command included. 2099 2100 This command can be excluded from the shell command set by 2101 defining @code{CONFIGURE_SHELL_NO_COMMAND_MKNOD} when all 2102 shell commands have been configured. 2103 2104 @subheading PROGRAMMING INFORMATION: 2105 2106 @findex rtems_shell_rtems_main_mknod 2107 2108 The @code{mknod} command is implemented by a C language function which 2109 has the following prototype: 2110 2111 @example 2112 int rtems_shell_rtems_main_mknod( 2113 int argc, 2114 char **argv 2115 ); 2116 @end example 2117 2118 The configuration structure for the @code{mknod} has the following 2119 prototype: 2120 2121 @example 2122 extern rtems_shell_cmd_t rtems_shell_MKNOD_Command; 2123 @end example 2124 2125 @subheading ORIGIN: 2126 2127 The implementation and portions of the documentation for this command 2128 are from NetBSD 4.0. 2335 2129 2336 2130 @c … … 2443 2237 @c 2444 2238 @page 2445 @subsection debugrfs - debug RFS file system2446 2447 @pgindex debugrfs2239 @subsection mount - mount disk 2240 2241 @pgindex mount 2448 2242 2449 2243 @subheading SYNOPSYS: 2450 2244 2451 2245 @example 2452 debugrfs [-hl] path command [options] 2246 mount [-t fstype] [-r] [-L] device path 2453 2247 @end example 2454 2248 2455 2249 @subheading DESCRIPTION: 2456 2250 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 2251 The @code{mount} command will mount a block device to a mount point 2252 using 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 2262 When the file system type is 'msdos' or 'rfs' the driver is a "block 2263 device driver" node present in the file system. The driver is ignored 2264 with the 'tftp' and 'ftp' file systems. For the 'nfs' file system the 2265 driver is the 'host:/path' string that described NFS host and the 2266 exported file system path. 2501 2267 2502 2268 @subheading EXIT STATUS: … … 2506 2272 @subheading NOTES: 2507 2273 2508 NONE 2274 The mount point must exist. 2275 2276 The services offered by each file-system vary. For example you cannot list the 2277 directory of a TFTP file-system as this server is not provided in the TFTP 2278 protocol. You need to check each file-system's documentation for the services 2279 provided. 2509 2280 2510 2281 @subheading EXAMPLES: 2511 2282 2512 The following is an example of how to use @code{debugrfs}: 2513 2514 @example 2515 SHLL [/] $ debugrfs /c data 2283 Mount the Flash Disk driver to the '/fd' mount point: 2284 2285 @example 2286 SHLL [/] $ mount -t msdos /dev/flashdisk0 /fd 2287 @end example 2288 2289 Mount the NFS file system exported path 'bar' by host 'foo': 2290 2291 @example 2292 $ mount -t nfs foo:/bar /nfs 2293 @end example 2294 2295 Mount the TFTP file system on '/tftp': 2296 2297 @example 2298 $ mount -t tftp /tftp 2299 @end example 2300 2301 To access the TFTP files on server '10.10.10.10': 2302 2303 @example 2304 $ cat /tftp/10.10.10.10/test.txt 2516 2305 @end example 2517 2306 2518 2307 @subheading CONFIGURATION: 2519 2308 2520 @findex CONFIGURE_SHELL_NO_COMMAND_ DEBUGRFS2521 @findex CONFIGURE_SHELL_COMMAND_ DEBUGRFS2309 @findex CONFIGURE_SHELL_NO_COMMAND_MOUNT 2310 @findex CONFIGURE_SHELL_COMMAND_MOUNT 2522 2311 2523 2312 This command is included in the default shell command set. 2524 2313 When building a custom command set, define 2525 @code{CONFIGURE_SHELL_COMMAND_ DEBUGRFS} to have this2314 @code{CONFIGURE_SHELL_COMMAND_MOUNT} to have this 2526 2315 command included. 2527 2316 2528 2317 This command can be excluded from the shell command set by 2529 defining @code{CONFIGURE_SHELL_NO_COMMAND_ DEBUGRFS} when all2318 defining @code{CONFIGURE_SHELL_NO_COMMAND_MOUNT} when all 2530 2319 shell commands have been configured. 2531 2320 2321 The mount command includes references to file-system code. If you do not wish 2322 to include file-system that you do not use do not define the mount command 2323 support 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 2333 An 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 2532 2345 @subheading PROGRAMMING INFORMATION: 2533 2346 2534 @findex rtems_shell_rtems_main_ debugrfs2535 2536 The @code{ debugrfs} command is implemented by a C language function which2537 has the following prototype:2538 2539 @example 2540 int rtems_shell_rtems_main_ debugrfs(2347 @findex rtems_shell_rtems_main_mount 2348 2349 The @code{mount} is implemented by a C language function 2350 which has the following prototype: 2351 2352 @example 2353 int rtems_shell_rtems_main_mount( 2541 2354 int argc, 2542 2355 char **argv … … 2544 2357 @end example 2545 2358 2546 The configuration structure for @code{debugrfs} has the following2547 prototype:2548 2549 @example 2550 extern rtems_shell_cmd_t rtems_shell_ DEBUGRFS_Command;2359 The configuration structure for the @code{mount} has the 2360 following prototype: 2361 2362 @example 2363 extern rtems_shell_cmd_t rtems_shell_MOUNT_Command; 2551 2364 @end example 2552 2365 … … 2555 2368 @c 2556 2369 @page 2557 @subsection cd - alias for chdir2558 2559 @pgindex cd2370 @subsection mv - move files 2371 2372 @pgindex mv 2560 2373 2561 2374 @subheading SYNOPSYS: 2562 2375 2563 2376 @example 2564 cd directory 2377 mv [-fiv] source_file target_file 2378 mv [-fiv] source_file... target_file 2565 2379 @end example 2566 2380 2567 2381 @subheading DESCRIPTION: 2568 2382 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. 2383 In its first form, the mv utility renames the file named by the source 2384 operand to the destination path named by the target operand. This 2385 form is assumed when the last operand does not name an already 2386 existing directory. 2387 2388 In its second form, mv moves each file named by a source operand to a 2389 destination file in the existing directory named by the directory 2390 operand. The destination path for each operand is the pathname 2391 produced by the concatenation of the last operand, a slash, and the 2392 final pathname component of the named file. 2393 2394 The following options are available: 2395 2396 @table @b 2397 @item -f 2398 Do not prompt for confirmation before overwriting the destination 2399 path. 2400 2401 @item -i 2402 Causes mv to write a prompt to standard error before moving a file 2403 that would overwrite an existing file. If the response from the 2404 standard input begins with the character 'y', the move is attempted. 2405 2406 @item -v 2407 Cause mv to be verbose, showing files as they are processed. 2408 2409 @end table 2410 2411 The last of any -f or -i options is the one which affects mv's 2412 behavior. 2413 2414 It is an error for any of the source operands to specify a nonexistent 2415 file or directory. 2416 2417 It is an error for the source operand to specify a directory if the 2418 target exists and is not a directory. 2419 2420 If the destination path does not have a mode which permits writing, mv 2421 prompts the user for confirmation as specified for the -i option. 2422 2423 Should the @b{rename} call fail because source and target are on 2424 different file systems, @code{mv} will remove the destination file, 2425 copy the source file to the destination, and then remove the source. 2426 The effect is roughly equivalent to: 2427 2428 @example 2429 rm -f destination_path && \ 2430 cp -PRp source_file destination_path && \ 2431 rm -rf source_file 2432 @end example 2572 2433 2573 2434 @subheading EXIT STATUS: 2574 2435 2575 Th is command returns 0 on success and non-zero if an error is encountered.2436 The @code{mv} utility exits 0 on success, and >0 if an error occurs. 2576 2437 2577 2438 @subheading NOTES: … … 2581 2442 @subheading EXAMPLES: 2582 2443 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 2445 SHLL [/] mv /dev/console /dev/con1 2598 2446 @end example 2599 2447 2600 2448 @subheading CONFIGURATION: 2601 2449 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 2453 This command is included in the default shell command set. When 2454 building a custom command set, define 2455 @code{CONFIGURE_SHELL_COMMAND_MV} to have this command included. 2609 2456 2610 2457 This command can be excluded from the shell command set by 2611 defining @code{CONFIGURE_SHELL_NO_COMMAND_ CD} when all2458 defining @code{CONFIGURE_SHELL_NO_COMMAND_MV} when all 2612 2459 shell commands have been configured. 2613 2460 2614 2461 @subheading PROGRAMMING INFORMATION: 2615 2462 2616 @findex rtems_shell_rtems_main_ cd2617 2618 The @code{ cd} is implemented by a C language function2619 whichhas the following prototype:2620 2621 @example 2622 int rtems_shell_rtems_main_ cd(2463 @findex rtems_shell_rtems_main_mv 2464 2465 The @code{mv} command is implemented by a C language function which 2466 has the following prototype: 2467 2468 @example 2469 int rtems_shell_rtems_main_mv( 2623 2470 int argc, 2624 2471 char **argv … … 2626 2473 @end example 2627 2474 2628 The configuration structure for the @code{ cd} has the2475 The configuration structure for the @code{mv} has the 2629 2476 following prototype: 2630 2477 2631 2478 @example 2632 extern rtems_shell_cmd_t rtems_shell_CD_Command; 2633 @end example 2479 extern rtems_shell_cmd_t rtems_shell_MV_Command; 2480 @end example 2481 2482 @subheading ORIGIN: 2483 2484 The implementation and portions of the documentation for this command 2485 are from NetBSD 4.0. 2634 2486 2635 2487 @c … … 2637 2489 @c 2638 2490 @page 2639 @subsection df - display file system disk space usage2640 2641 @pgindex df2491 @subsection pwd - print work directory 2492 2493 @pgindex pwd 2642 2494 2643 2495 @subheading SYNOPSYS: 2644 2496 2645 2497 @example 2646 df [-h] [-B block_size] 2498 pwd 2647 2499 @end example 2648 2500 2649 2501 @subheading DESCRIPTION: 2650 2502 2651 This command print disk space usage for mounted file systems. 2503 This command prints the fully qualified filename of the current 2504 working directory. 2652 2505 2653 2506 @subheading EXIT STATUS: … … 2661 2514 @subheading EXAMPLES: 2662 2515 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 2516 The following is an example of how to use @code{pwd}: 2517 2518 @example 2519 SHLL [/] $ pwd 2520 / 2521 SHLL [/] $ cd dev 2522 SHLL [/dev] $ pwd 2523 /dev 2675 2524 @end example 2676 2525 2677 2526 @subheading CONFIGURATION: 2678 2527 2679 @findex CONFIGURE_SHELL_NO_COMMAND_ DF2680 @findex CONFIGURE_SHELL_COMMAND_ DF2528 @findex CONFIGURE_SHELL_NO_COMMAND_PWD 2529 @findex CONFIGURE_SHELL_COMMAND_PWD 2681 2530 2682 2531 This command is included in the default shell command set. 2683 2532 When building a custom command set, define 2684 @code{CONFIGURE_SHELL_COMMAND_ DF} to have this2533 @code{CONFIGURE_SHELL_COMMAND_PWD} to have this 2685 2534 command included. 2686 2535 2687 2536 This command can be excluded from the shell command set by 2688 defining @code{CONFIGURE_SHELL_NO_COMMAND_ DF} when all2537 defining @code{CONFIGURE_SHELL_NO_COMMAND_PWD} when all 2689 2538 shell commands have been configured. 2690 2539 2691 2540 @subheading PROGRAMMING INFORMATION: 2692 2541 2693 @findex rtems_shell_rtems_main_ df2694 2695 The @code{ df} is implemented by a C language function2542 @findex rtems_shell_rtems_main_pwd 2543 2544 The @code{pwd} is implemented by a C language function 2696 2545 which has the following prototype: 2697 2546 2698 2547 @example 2699 int rtems_shell_ main_df(2700 int argc,2548 int rtems_shell_rtems_main_pwd( 2549 int argc, 2701 2550 char **argv 2702 2551 ); 2703 2552 @end example 2704 2553 2705 The configuration structure for the @code{ df} has the2554 The configuration structure for the @code{pwd} has the 2706 2555 following prototype: 2707 2556 2708 2557 @example 2709 extern rtems_shell_cmd_t rtems_shell_ DF_Command;2558 extern rtems_shell_cmd_t rtems_shell_PWD_Command; 2710 2559 @end example 2711 2560 … … 2714 2563 @c 2715 2564 @page 2716 @subsection md5 - compute the Md5 hash of a file or list of files2717 2718 @pgindex md52565 @subsection rmdir - remove empty directories 2566 2567 @pgindex rmdir 2719 2568 2720 2569 @subheading SYNOPSYS: 2721 2570 2722 2571 @example 2723 md5 <files> 2572 rmdir [dir1 .. dirN] 2724 2573 @end example 2725 2574 2726 2575 @subheading DESCRIPTION: 2727 2576 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. 2577 This command removes the specified set of directories. If no 2578 directories are provided on the command line, no actions are taken. 2731 2579 2732 2580 @subheading EXIT STATUS: … … 2736 2584 @subheading NOTES: 2737 2585 2738 NONE 2586 This command is a implemented using the @code{rmdir(2)} system 2587 call and all reasons that call may fail apply to this command. 2739 2588 2740 2589 @subheading EXAMPLES: 2741 2590 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 2591 The following is an example of how to use @code{rmdir}: 2592 2593 @example 2594 SHLL [/] # mkdir joeldir 2595 SHLL [/] # rmdir joeldir 2596 SHLL [/] # ls joeldir 2597 joeldir: No such file or directory. 2747 2598 @end example 2748 2599 2749 2600 @subheading CONFIGURATION: 2750 2601 2751 @findex CONFIGURE_SHELL_NO_COMMAND_ MD52752 @findex CONFIGURE_SHELL_COMMAND_ MD52602 @findex CONFIGURE_SHELL_NO_COMMAND_RMDIR 2603 @findex CONFIGURE_SHELL_COMMAND_RMDIR 2753 2604 2754 2605 This command is included in the default shell command set. 2755 2606 When building a custom command set, define 2756 @code{CONFIGURE_SHELL_COMMAND_ MD5} to have this2607 @code{CONFIGURE_SHELL_COMMAND_RMDIR} to have this 2757 2608 command included. 2758 2609 2759 2610 This command can be excluded from the shell command set by 2760 defining @code{CONFIGURE_SHELL_NO_COMMAND_ MD5} when all2611 defining @code{CONFIGURE_SHELL_NO_COMMAND_RMDIR} when all 2761 2612 shell commands have been configured. 2762 2613 2763 2614 @subheading PROGRAMMING INFORMATION: 2764 2615 2765 @findex rtems_shell_rtems_main_ md52766 2767 The @code{ df} is implemented by a C language function2616 @findex rtems_shell_rtems_main_rmdir 2617 2618 The @code{rmdir} is implemented by a C language function 2768 2619 which has the following prototype: 2769 2620 2770 2621 @example 2771 int rtems_shell_ main_md5(2772 int argc,2622 int rtems_shell_rtems_main_rmdir( 2623 int argc, 2773 2624 char **argv 2774 2625 ); 2775 2626 @end example 2776 2627 2777 The configuration structure for the @code{ md5} has the2628 The configuration structure for the @code{rmdir} has the 2778 2629 following prototype: 2779 2630 2780 2631 @example 2781 extern rtems_shell_cmd_t rtems_shell_MD5_Command; 2782 @end example 2632 extern 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 2646 rm file1 [file2 ... fileN] 2647 @end example 2648 2649 @subheading DESCRIPTION: 2650 2651 This command deletes a name from the filesystem. If the specified file name 2652 was the last link to a file and there are no @code{open} file descriptor 2653 references to that file, then it is deleted and the associated space in 2654 the file system is made available for subsequent use. 2655 2656 If the filename specified was the last link to a file but there 2657 are open file descriptor references to it, then the file will 2658 remain in existence until the last file descriptor referencing 2659 it is closed. 2660 2661 @subheading EXIT STATUS: 2662 2663 This command returns 0 on success and non-zero if an error is encountered. 2664 2665 @subheading NOTES: 2666 2667 NONE 2668 2669 @subheading EXAMPLES: 2670 2671 The following is an example of how to use @code{rm}: 2672 2673 @example 2674 SHLL [/] # cp /etc/passwd tmpfile 2675 SHLL [/] # cat tmpfile 2676 root:*:0:0:root::/:/bin/sh 2677 rtems:*:1:1:RTEMS Application::/:/bin/sh 2678 tty:!:2:2:tty owner::/:/bin/false 2679 SHLL [/] # rm tmpfile 2680 SHLL [/] # cat tmpfile 2681 cat: 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 2689 This command is included in the default shell command set. 2690 When building a custom command set, define 2691 @code{CONFIGURE_SHELL_COMMAND_RM} to have this 2692 command included. 2693 2694 This command can be excluded from the shell command set by 2695 defining @code{CONFIGURE_SHELL_NO_COMMAND_RM} when all 2696 shell commands have been configured. 2697 2698 @subheading PROGRAMMING INFORMATION: 2699 2700 @findex rtems_shell_rtems_main_rm 2701 2702 The @code{rm} is implemented by a C language function 2703 which has the following prototype: 2704 2705 @example 2706 int rtems_shell_rtems_main_rm( 2707 int argc, 2708 char **argv 2709 ); 2710 @end example 2711 2712 The configuration structure for the @code{rm} has the 2713 following prototype: 2714 2715 @example 2716 extern 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 2730 umask [new_umask] 2731 @end example 2732 2733 @subheading DESCRIPTION: 2734 2735 This command sets the user file creation mask to @code{new_umask}. The 2736 argument @code{new_umask} may be octal, hexadecimal, or decimal. 2737 2738 @subheading EXIT STATUS: 2739 2740 This command returns 0 on success and non-zero if an error is encountered. 2741 2742 @subheading NOTES: 2743 2744 This command does not currently support symbolic mode masks. 2745 2746 @subheading EXAMPLES: 2747 2748 The following is an example of how to use @code{umask}: 2749 2750 @example 2751 SHLL [/] $ umask 2752 022 2753 SHLL [/] $ umask 0666 2754 0666 2755 SHLL [/] $ umask 2756 0666 2757 @end example 2758 2759 @subheading CONFIGURATION: 2760 2761 @findex CONFIGURE_SHELL_NO_COMMAND_UMASK 2762 @findex CONFIGURE_SHELL_COMMAND_UMASK 2763 2764 This command is included in the default shell command set. 2765 When building a custom command set, define 2766 @code{CONFIGURE_SHELL_COMMAND_UMASK} to have this 2767 command included. 2768 2769 This command can be excluded from the shell command set by 2770 defining @code{CONFIGURE_SHELL_NO_COMMAND_UMASK} when all 2771 shell commands have been configured. 2772 2773 @subheading PROGRAMMING INFORMATION: 2774 2775 @findex rtems_shell_rtems_main_umask 2776 2777 The @code{umask} is implemented by a C language function 2778 which has the following prototype: 2779 2780 @example 2781 int rtems_shell_rtems_main_umask( 2782 int argc, 2783 char **argv 2784 ); 2785 @end example 2786 2787 The configuration structure for the @code{umask} has the 2788 following prototype: 2789 2790 @example 2791 extern 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 2805 unmount path 2806 @end example 2807 2808 @subheading DESCRIPTION: 2809 2810 This command unmounts the device at the specified @code{path}. 2811 2812 @subheading EXIT STATUS: 2813 2814 This command returns 0 on success and non-zero if an error is encountered. 2815 2816 @subheading NOTES: 2817 2818 TBD - Surely there must be some warnings to go here. 2819 2820 @subheading EXAMPLES: 2821 2822 The following is an example of how to use @code{unmount}: 2823 2824 @example 2825 EXAMPLE_TBD 2826 @end example 2827 2828 @subheading CONFIGURATION: 2829 2830 @findex CONFIGURE_SHELL_NO_COMMAND_UNMOUNT 2831 @findex CONFIGURE_SHELL_COMMAND_UNMOUNT 2832 2833 This command is included in the default shell command set. 2834 When building a custom command set, define 2835 @code{CONFIGURE_SHELL_COMMAND_UNMOUNT} to have this 2836 command included. 2837 2838 This command can be excluded from the shell command set by 2839 defining @code{CONFIGURE_SHELL_NO_COMMAND_UNMOUNT} when all 2840 shell commands have been configured. 2841 2842 @subheading PROGRAMMING INFORMATION: 2843 2844 @findex rtems_shell_rtems_main_unmount 2845 2846 The @code{unmount} is implemented by a C language function 2847 which has the following prototype: 2848 2849 @example 2850 int rtems_shell_rtems_main_unmount( 2851 int argc, 2852 char **argv 2853 ); 2854 @end example 2855 2856 The configuration structure for the @code{unmount} has the 2857 following prototype: 2858 2859 @example 2860 extern rtems_shell_cmd_t rtems_shell_UNMOUNT_Command; 2861 @end example
Note: See TracChangeset
for help on using the changeset viewer.