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