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