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