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