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