1 | @c |
---|
2 | @c COPYRIGHT (c) 1988-2008. |
---|
3 | @c On-Line Applications Research Corporation (OAR). |
---|
4 | @c All rights reserved. |
---|
5 | @c |
---|
6 | @c $Id$ |
---|
7 | @c |
---|
8 | |
---|
9 | @chapter File and Directory Commands |
---|
10 | |
---|
11 | @section Introduction |
---|
12 | |
---|
13 | The RTEMS shell has the following file and directory commands: |
---|
14 | |
---|
15 | @itemize @bullet |
---|
16 | |
---|
17 | @item @code{umask} - Set file mode creation mask |
---|
18 | @item @code{cp} - copy files |
---|
19 | @item @code{pwd} - print work directory |
---|
20 | @item @code{ls} - list files in the directory |
---|
21 | @item @code{chdir} - change the current directory |
---|
22 | @item @code{mkdir} - create a directory |
---|
23 | @item @code{rmdir} - remove empty directories |
---|
24 | @item @code{chroot} - change the root directory |
---|
25 | @item @code{chmod} - change permissions of a file |
---|
26 | @item @code{cat} - display file contents |
---|
27 | @item @code{msdosfmt} - format disk |
---|
28 | @item @code{rm} - remove files |
---|
29 | @item @code{mount} - mount disk |
---|
30 | @item @code{unmount} - unmount disk |
---|
31 | @item @code{blksync} - sync the block driver |
---|
32 | @item @code{fdisk} - format disks |
---|
33 | @item @code{dir} - alias for ls |
---|
34 | @item @code{cd} - alias for chdir |
---|
35 | |
---|
36 | @end itemize |
---|
37 | |
---|
38 | @section Commands |
---|
39 | |
---|
40 | This section details the File and Directory Commands available. A |
---|
41 | subsection is dedicated to each of the commands and |
---|
42 | describes the behavior and configuration of that |
---|
43 | command as well as providing an example usage. |
---|
44 | |
---|
45 | @c |
---|
46 | @c |
---|
47 | @c |
---|
48 | @page |
---|
49 | @subsection umask - set file mode creation mask |
---|
50 | |
---|
51 | @pgindex umask |
---|
52 | |
---|
53 | @subheading SYNOPSYS: |
---|
54 | |
---|
55 | @example |
---|
56 | umask [new_umask] |
---|
57 | @end example |
---|
58 | |
---|
59 | @subheading DESCRIPTION: |
---|
60 | |
---|
61 | This command sets the user file creation mask to @code{new_umask}. The |
---|
62 | argument @code{new_umask} may be octal, hexadecimal, or decimal. |
---|
63 | |
---|
64 | @subheading EXIT STATUS: |
---|
65 | |
---|
66 | This command returns 0 on success and non-zero if an error is encountered. |
---|
67 | |
---|
68 | @subheading NOTES: |
---|
69 | |
---|
70 | This command does not currently support symbolic mode masks. |
---|
71 | |
---|
72 | @subheading EXAMPLES: |
---|
73 | |
---|
74 | The following is an example of how to use @code{umask}: |
---|
75 | |
---|
76 | @example |
---|
77 | SHLL [/] $ umask |
---|
78 | 022 |
---|
79 | SHLL [/] $ umask 0666 |
---|
80 | 0666 |
---|
81 | SHLL [/] $ umask |
---|
82 | 0666 |
---|
83 | @end example |
---|
84 | |
---|
85 | @subheading CONFIGURATION: |
---|
86 | |
---|
87 | @findex CONFIGURE_SHELL_NO_COMMAND_UMASK |
---|
88 | @findex CONFIGURE_SHELL_COMMAND_UMASK |
---|
89 | |
---|
90 | This command is included in the default shell command set. |
---|
91 | When building a custom command set, define |
---|
92 | @code{CONFIGURE_SHELL_COMMAND_UMASK} to have this |
---|
93 | command included. |
---|
94 | |
---|
95 | This command can be excluded from the shell command set by |
---|
96 | defining @code{CONFIGURE_SHELL_NO_COMMAND_UMASK} when all |
---|
97 | shell commands have been configured. |
---|
98 | |
---|
99 | @subheading PROGRAMMING INFORMATION: |
---|
100 | |
---|
101 | @findex rtems_shell_rtems_main_umask |
---|
102 | |
---|
103 | The @code{umask} is implemented by a C language function |
---|
104 | which has the following prototype: |
---|
105 | |
---|
106 | @example |
---|
107 | int rtems_shell_rtems_main_umask( |
---|
108 | int argc, |
---|
109 | char **argv |
---|
110 | ); |
---|
111 | @end example |
---|
112 | |
---|
113 | The configuration structure for the @code{umask} has the |
---|
114 | following prototype: |
---|
115 | |
---|
116 | @example |
---|
117 | extern rtems_shell_cmd_t rtems_shell_UMASK_Command; |
---|
118 | @end example |
---|
119 | |
---|
120 | @c |
---|
121 | @c |
---|
122 | @c |
---|
123 | @page |
---|
124 | @subsection cp - copy files |
---|
125 | |
---|
126 | @pgindex cp |
---|
127 | |
---|
128 | @subheading SYNOPSYS: |
---|
129 | |
---|
130 | @example |
---|
131 | cp [-R [-H | -L | -P]] [-f | -i] [-pv] src target |
---|
132 | |
---|
133 | cp [-R [-H | -L] ] [-f | -i] [-NpPv] source_file ... target_directory |
---|
134 | @end example |
---|
135 | |
---|
136 | @subheading DESCRIPTION: |
---|
137 | |
---|
138 | In the first synopsis form, the cp utility copies the contents of the |
---|
139 | source_file to the target_file. In the second synopsis form, the contents of |
---|
140 | each named source_file is copied to the destination target_directory. The names |
---|
141 | of the files themselves are not changed. If cp detects an attempt to copy a |
---|
142 | file to itself, the copy will fail. |
---|
143 | |
---|
144 | The following options are available: |
---|
145 | |
---|
146 | @table @b |
---|
147 | @item -f |
---|
148 | |
---|
149 | For each existing destination pathname, attempt to overwrite it. If permissions |
---|
150 | do not allow copy to succeed, remove it and create a new file, without |
---|
151 | prompting for confirmation. (The -i option is ignored if the -f option is |
---|
152 | specified.) |
---|
153 | |
---|
154 | @item -H |
---|
155 | |
---|
156 | If the -R option is specified, symbolic links on the command line are followed. |
---|
157 | (Symbolic links encountered in the tree traversal are not followed.) |
---|
158 | |
---|
159 | @item -i |
---|
160 | |
---|
161 | Causes cp to write a prompt to the standard error output before copying a file |
---|
162 | that would overwrite an existing file. If the response from the standard input |
---|
163 | begins with the character 'y', the file copy is attempted. |
---|
164 | |
---|
165 | @item -L |
---|
166 | |
---|
167 | If the -R option is specified, all symbolic links are followed. |
---|
168 | |
---|
169 | @item -N |
---|
170 | |
---|
171 | When used with -p, do not copy file flags. |
---|
172 | |
---|
173 | @item -P |
---|
174 | |
---|
175 | No symbolic links are followed. |
---|
176 | |
---|
177 | @item -p |
---|
178 | |
---|
179 | Causes cp to preserve in the copy as many of the modification time, access |
---|
180 | time, file flags, file mode, user ID, and group ID as allowed by permissions. |
---|
181 | |
---|
182 | If the user ID and group ID cannot be preserved, no error message is displayed |
---|
183 | and the exit value is not altered. |
---|
184 | |
---|
185 | If the source file has its set user ID bit on and the user ID cannot be |
---|
186 | preserved, the set user ID bit is not preserved in the copy's permissions. If |
---|
187 | the source file has its set group ID bit on and the group ID cannot be |
---|
188 | preserved, the set group ID bit is not preserved in the copy's permissions. If |
---|
189 | the source file has both its set user ID and set group ID bits on, and either |
---|
190 | the user ID or group ID cannot be preserved, neither the set user ID or set |
---|
191 | group ID bits are preserved in the copy's permissions. |
---|
192 | |
---|
193 | @item -R |
---|
194 | |
---|
195 | If source_file designates a directory, cp copies the directory and the entire |
---|
196 | subtree connected at that point. This option also causes symbolic links to be |
---|
197 | copied, rather than indirected through, and for cp to create special files |
---|
198 | rather than copying them as normal files. Created directories have the same |
---|
199 | mode as the corresponding source directory, unmodified by the process's umask. |
---|
200 | |
---|
201 | @item -v |
---|
202 | |
---|
203 | Cause cp to be verbose, showing files as they are copied. |
---|
204 | |
---|
205 | @end table |
---|
206 | |
---|
207 | For each destination file that already exists, its contents are overwritten if |
---|
208 | permissions allow, but its mode, user ID, and group ID are unchanged. |
---|
209 | |
---|
210 | In the second synopsis form, target_directory must exist unless there is only |
---|
211 | one named source_file which is a directory and the -R flag is specified. |
---|
212 | |
---|
213 | If the destination file does not exist, the mode of the source file is used as |
---|
214 | modified by the file mode creation mask (umask, see csh(1)). If the source file |
---|
215 | has its set user ID bit on, that bit is removed unless both the source file and |
---|
216 | the destination file are owned by the same user. If the source file has its set |
---|
217 | group ID bit on, that bit is removed unless both the source file and the |
---|
218 | destination file are in the same group and the user is a member of that group. |
---|
219 | If both the set user ID and set group ID bits are set, all of the above |
---|
220 | conditions must be fulfilled or both bits are removed. |
---|
221 | |
---|
222 | Appropriate permissions are required for file creation or overwriting. |
---|
223 | |
---|
224 | Symbolic links are always followed unless the -R flag is set, in which case |
---|
225 | symbolic links are not followed, by default. The -H or -L flags (in conjunction |
---|
226 | with the -R flag), as well as the -P flag cause symbolic links to be followed |
---|
227 | as described above. The -H and -L options are ignored unless the -R option is |
---|
228 | specified. In addition, these options override eachsubhedading other and the |
---|
229 | command's actions are determined by the last one specified. |
---|
230 | |
---|
231 | @subheading EXIT STATUS: |
---|
232 | |
---|
233 | This command returns 0 on success and non-zero if an error is encountered. |
---|
234 | |
---|
235 | @subheading NOTES: |
---|
236 | |
---|
237 | NONE |
---|
238 | |
---|
239 | @subheading EXAMPLES: |
---|
240 | |
---|
241 | The following is an example of how to use @code{cp} to |
---|
242 | copy a file to a new name in the current directory: |
---|
243 | |
---|
244 | @example |
---|
245 | SHLL [/] # cat joel |
---|
246 | cat: joel: No such file or directory |
---|
247 | SHLL [/] # cp etc/passwd joel |
---|
248 | SHLL [/] # cat joel |
---|
249 | root:*:0:0:root::/:/bin/sh |
---|
250 | rtems:*:1:1:RTEMS Application::/:/bin/sh |
---|
251 | tty:!:2:2:tty owner::/:/bin/false |
---|
252 | SHLL [/] # ls |
---|
253 | drwxr-xr-x 1 root root 536 Jan 01 00:00 dev/ |
---|
254 | drwxr-xr-x 1 root root 1072 Jan 01 00:00 etc/ |
---|
255 | -rw-r--r-- 1 root root 102 Jan 01 00:00 joel |
---|
256 | 3 files 1710 bytes occupied |
---|
257 | @end example |
---|
258 | |
---|
259 | The following is an example of how to use @code{cp} to |
---|
260 | copy one or more files to a destination directory and |
---|
261 | use the same @code{basename} in the destination directory: |
---|
262 | |
---|
263 | @example |
---|
264 | SHLL [/] # mkdir tmp |
---|
265 | SHLL [/] # ls tmp |
---|
266 | 0 files 0 bytes occupied |
---|
267 | SHLL [/] # cp /etc/passwd tmp |
---|
268 | SHLL [/] # ls /tmp |
---|
269 | -rw-r--r-- 1 root root 102 Jan 01 00:01 passwd |
---|
270 | 1 files 102 bytes occupied |
---|
271 | SHLL [/] # cp /etc/passwd /etc/group /tmp |
---|
272 | SHLL [/] # ls /tmp |
---|
273 | -rw-r--r-- 1 root root 102 Jan 01 00:01 passwd |
---|
274 | -rw-r--r-- 1 root root 42 Jan 01 00:01 group |
---|
275 | 2 files 144 bytes occupied |
---|
276 | SHLL [/] # |
---|
277 | @end example |
---|
278 | |
---|
279 | @subheading CONFIGURATION: |
---|
280 | |
---|
281 | @findex CONFIGURE_SHELL_NO_COMMAND_CP |
---|
282 | @findex CONFIGURE_SHELL_COMMAND_CP |
---|
283 | |
---|
284 | This command is included in the default shell command set. |
---|
285 | When building a custom command set, define |
---|
286 | @code{CONFIGURE_SHELL_COMMAND_CP} to have this |
---|
287 | command included. |
---|
288 | |
---|
289 | This command can be excluded from the shell command set by |
---|
290 | defining @code{CONFIGURE_SHELL_NO_COMMAND_CP} when all |
---|
291 | shell commands have been configured. |
---|
292 | |
---|
293 | @subheading PROGRAMMING INFORMATION: |
---|
294 | |
---|
295 | @findex rtems_shell_rtems_main_cp |
---|
296 | |
---|
297 | The @code{cp} is implemented by a C language function |
---|
298 | which has the following prototype: |
---|
299 | |
---|
300 | @example |
---|
301 | int rtems_shell_rtems_main_cp( |
---|
302 | int argc, |
---|
303 | char **argv |
---|
304 | ); |
---|
305 | @end example |
---|
306 | |
---|
307 | The configuration structure for the @code{cp} has the |
---|
308 | following prototype: |
---|
309 | |
---|
310 | @example |
---|
311 | extern rtems_shell_cmd_t rtems_shell_CP_Command; |
---|
312 | @end example |
---|
313 | |
---|
314 | @subheading ORIGIN: |
---|
315 | |
---|
316 | The implementation and portions of the documentation for this |
---|
317 | command are from NetBSD 4.0. |
---|
318 | |
---|
319 | @c |
---|
320 | @c |
---|
321 | @c |
---|
322 | @page |
---|
323 | @subsection pwd - print work directory |
---|
324 | |
---|
325 | @pgindex pwd |
---|
326 | |
---|
327 | @subheading SYNOPSYS: |
---|
328 | |
---|
329 | @example |
---|
330 | pwd |
---|
331 | @end example |
---|
332 | |
---|
333 | @subheading DESCRIPTION: |
---|
334 | |
---|
335 | This command prints the fully qualified filename of the current |
---|
336 | working directory. |
---|
337 | |
---|
338 | @subheading EXIT STATUS: |
---|
339 | |
---|
340 | This command returns 0 on success and non-zero if an error is encountered. |
---|
341 | |
---|
342 | @subheading NOTES: |
---|
343 | |
---|
344 | NONE |
---|
345 | |
---|
346 | @subheading EXAMPLES: |
---|
347 | |
---|
348 | The following is an example of how to use @code{pwd}: |
---|
349 | |
---|
350 | @example |
---|
351 | SHLL [/] $ pwd |
---|
352 | / |
---|
353 | SHLL [/] $ cd dev |
---|
354 | SHLL [/dev] $ pwd |
---|
355 | /dev |
---|
356 | @end example |
---|
357 | |
---|
358 | @subheading CONFIGURATION: |
---|
359 | |
---|
360 | @findex CONFIGURE_SHELL_NO_COMMAND_PWD |
---|
361 | @findex CONFIGURE_SHELL_COMMAND_PWD |
---|
362 | |
---|
363 | This command is included in the default shell command set. |
---|
364 | When building a custom command set, define |
---|
365 | @code{CONFIGURE_SHELL_COMMAND_PWD} to have this |
---|
366 | command included. |
---|
367 | |
---|
368 | This command can be excluded from the shell command set by |
---|
369 | defining @code{CONFIGURE_SHELL_NO_COMMAND_PWD} when all |
---|
370 | shell commands have been configured. |
---|
371 | |
---|
372 | @subheading PROGRAMMING INFORMATION: |
---|
373 | |
---|
374 | @findex rtems_shell_rtems_main_pwd |
---|
375 | |
---|
376 | The @code{pwd} is implemented by a C language function |
---|
377 | which has the following prototype: |
---|
378 | |
---|
379 | @example |
---|
380 | int rtems_shell_rtems_main_pwd( |
---|
381 | int argc, |
---|
382 | char **argv |
---|
383 | ); |
---|
384 | @end example |
---|
385 | |
---|
386 | The configuration structure for the @code{pwd} has the |
---|
387 | following prototype: |
---|
388 | |
---|
389 | @example |
---|
390 | extern rtems_shell_cmd_t rtems_shell_PWD_Command; |
---|
391 | @end example |
---|
392 | |
---|
393 | @c |
---|
394 | @c |
---|
395 | @c |
---|
396 | @page |
---|
397 | @subsection ls - list files in the directory |
---|
398 | |
---|
399 | @pgindex ls |
---|
400 | |
---|
401 | @subheading SYNOPSYS: |
---|
402 | |
---|
403 | @example |
---|
404 | ls [dir] |
---|
405 | @end example |
---|
406 | |
---|
407 | @subheading DESCRIPTION: |
---|
408 | |
---|
409 | This command displays the contents of the specified directory. If |
---|
410 | no arguments are given, then it displays the contents of the current |
---|
411 | working directory. |
---|
412 | |
---|
413 | @subheading EXIT STATUS: |
---|
414 | |
---|
415 | This command returns 0 on success and non-zero if an error is encountered. |
---|
416 | |
---|
417 | @subheading NOTES: |
---|
418 | |
---|
419 | This command currently does not display information on a set of |
---|
420 | files like the POSIX ls(1). It only displays the contents of |
---|
421 | entire directories. |
---|
422 | |
---|
423 | @subheading EXAMPLES: |
---|
424 | |
---|
425 | The following is an example of how to use @code{ls}: |
---|
426 | |
---|
427 | @example |
---|
428 | SHLL [/] $ ls |
---|
429 | drwxr-xr-x 1 root root 536 Jan 01 00:00 dev/ |
---|
430 | drwxr-xr-x 1 root root 1072 Jan 01 00:00 etc/ |
---|
431 | 2 files 1608 bytes occupied |
---|
432 | SHLL [/] $ ls etc |
---|
433 | -rw-r--r-- 1 root root 102 Jan 01 00:00 passwd |
---|
434 | -rw-r--r-- 1 root root 42 Jan 01 00:00 group |
---|
435 | -rw-r--r-- 1 root root 30 Jan 01 00:00 issue |
---|
436 | -rw-r--r-- 1 root root 28 Jan 01 00:00 issue.net |
---|
437 | 4 files 202 bytes occupied |
---|
438 | SHLL [/] $ ls dev etc |
---|
439 | -rwxr-xr-x 1 rtems root 0 Jan 01 00:00 console |
---|
440 | -rwxr-xr-x 1 root root 0 Jan 01 00:00 console_b |
---|
441 | @end example |
---|
442 | |
---|
443 | @subheading CONFIGURATION: |
---|
444 | |
---|
445 | @findex CONFIGURE_SHELL_NO_COMMAND_LS |
---|
446 | @findex CONFIGURE_SHELL_COMMAND_LS |
---|
447 | |
---|
448 | This command is included in the default shell command set. |
---|
449 | When building a custom command set, define |
---|
450 | @code{CONFIGURE_SHELL_COMMAND_LS} to have this |
---|
451 | command included. |
---|
452 | |
---|
453 | This command can be excluded from the shell command set by |
---|
454 | defining @code{CONFIGURE_SHELL_NO_COMMAND_LS} when all |
---|
455 | shell commands have been configured. |
---|
456 | |
---|
457 | @subheading PROGRAMMING INFORMATION: |
---|
458 | |
---|
459 | @findex rtems_shell_rtems_main_ls |
---|
460 | |
---|
461 | The @code{ls} is implemented by a C language function |
---|
462 | which has the following prototype: |
---|
463 | |
---|
464 | @example |
---|
465 | int rtems_shell_rtems_main_ls( |
---|
466 | int argc, |
---|
467 | char **argv |
---|
468 | ); |
---|
469 | @end example |
---|
470 | |
---|
471 | The configuration structure for the @code{ls} has the |
---|
472 | following prototype: |
---|
473 | |
---|
474 | @example |
---|
475 | extern rtems_shell_cmd_t rtems_shell_LS_Command; |
---|
476 | @end example |
---|
477 | |
---|
478 | @c |
---|
479 | @c |
---|
480 | @c |
---|
481 | @page |
---|
482 | @subsection chdir - change the current directory |
---|
483 | |
---|
484 | @pgindex chdir |
---|
485 | |
---|
486 | @subheading SYNOPSYS: |
---|
487 | |
---|
488 | @example |
---|
489 | chdir [dir] |
---|
490 | @end example |
---|
491 | |
---|
492 | @subheading DESCRIPTION: |
---|
493 | |
---|
494 | This command is used to change the current working directory to |
---|
495 | the specified directory. If no arguments are given, the current |
---|
496 | working directory will be changed to @code{/}. |
---|
497 | |
---|
498 | @subheading EXIT STATUS: |
---|
499 | |
---|
500 | This command returns 0 on success and non-zero if an error is encountered. |
---|
501 | |
---|
502 | @subheading NOTES: |
---|
503 | |
---|
504 | NONE |
---|
505 | |
---|
506 | @subheading EXAMPLES: |
---|
507 | |
---|
508 | The following is an example of how to use @code{chdir}: |
---|
509 | |
---|
510 | @example |
---|
511 | SHLL [/] $ pwd |
---|
512 | / |
---|
513 | SHLL [/] $ chdir etc |
---|
514 | SHLL [/etc] $ pwd |
---|
515 | /etc |
---|
516 | @end example |
---|
517 | |
---|
518 | @subheading CONFIGURATION: |
---|
519 | |
---|
520 | @findex CONFIGURE_SHELL_NO_COMMAND_CHDIR |
---|
521 | @findex CONFIGURE_SHELL_COMMAND_CHDIR |
---|
522 | |
---|
523 | This command is included in the default shell command set. |
---|
524 | When building a custom command set, define |
---|
525 | @code{CONFIGURE_SHELL_COMMAND_CHDIR} to have this |
---|
526 | command included. |
---|
527 | |
---|
528 | This command can be excluded from the shell command set by |
---|
529 | defining @code{CONFIGURE_SHELL_NO_COMMAND_CHDIR} when all |
---|
530 | shell commands have been configured. |
---|
531 | |
---|
532 | @subheading PROGRAMMING INFORMATION: |
---|
533 | |
---|
534 | @findex rtems_shell_rtems_main_chdir |
---|
535 | |
---|
536 | The @code{chdir} is implemented by a C language function |
---|
537 | which has the following prototype: |
---|
538 | |
---|
539 | @example |
---|
540 | int rtems_shell_rtems_main_chdir( |
---|
541 | int argc, |
---|
542 | char **argv |
---|
543 | ); |
---|
544 | @end example |
---|
545 | |
---|
546 | The configuration structure for the @code{chdir} has the |
---|
547 | following prototype: |
---|
548 | |
---|
549 | @example |
---|
550 | extern rtems_shell_cmd_t rtems_shell_CHDIR_Command; |
---|
551 | @end example |
---|
552 | |
---|
553 | @c |
---|
554 | @c |
---|
555 | @c |
---|
556 | @page |
---|
557 | @subsection mkdir - create a directory |
---|
558 | |
---|
559 | @pgindex mkdir |
---|
560 | |
---|
561 | @subheading SYNOPSYS: |
---|
562 | |
---|
563 | @example |
---|
564 | mkdir dir [dir1 .. dirN] |
---|
565 | @end example |
---|
566 | |
---|
567 | @subheading DESCRIPTION: |
---|
568 | |
---|
569 | This command creates the set of directories in the order they |
---|
570 | are specified on the command line. If an error is encountered |
---|
571 | making one of the directories, the command will continue to |
---|
572 | attempt to create the remaining directories on the command line. |
---|
573 | |
---|
574 | @subheading EXIT STATUS: |
---|
575 | |
---|
576 | This command returns 0 on success and non-zero if an error is encountered. |
---|
577 | |
---|
578 | @subheading NOTES: |
---|
579 | |
---|
580 | If this command is invoked with no arguments, nothing occurs. |
---|
581 | |
---|
582 | The user must have sufficient permissions to create the directory. |
---|
583 | For the @code{fileio} test provided with RTEMS, this means the user |
---|
584 | must login as @code{root} not @code{rtems}. |
---|
585 | |
---|
586 | @subheading EXAMPLES: |
---|
587 | |
---|
588 | The following is an example of how to use @code{mkdir}: |
---|
589 | |
---|
590 | @example |
---|
591 | SHLL [/] # ls |
---|
592 | drwxr-xr-x 1 root root 536 Jan 01 00:00 dev/ |
---|
593 | drwxr-xr-x 1 root root 1072 Jan 01 00:00 etc/ |
---|
594 | 2 files 1608 bytes occupied |
---|
595 | SHLL [/] # mkdir joel |
---|
596 | SHLL [/] # ls joel |
---|
597 | 0 files 0 bytes occupied |
---|
598 | SHLL [/] # cp etc/passwd joel |
---|
599 | SHLL [/] # ls joel |
---|
600 | -rw-r--r-- 1 root root 102 Jan 01 00:02 passwd |
---|
601 | 1 files 102 bytes occupied |
---|
602 | @end example |
---|
603 | |
---|
604 | @subheading CONFIGURATION: |
---|
605 | |
---|
606 | @findex CONFIGURE_SHELL_NO_COMMAND_MKDIR |
---|
607 | @findex CONFIGURE_SHELL_COMMAND_MKDIR |
---|
608 | |
---|
609 | This command is included in the default shell command set. |
---|
610 | When building a custom command set, define |
---|
611 | @code{CONFIGURE_SHELL_COMMAND_MKDIR} to have this |
---|
612 | command included. |
---|
613 | |
---|
614 | This command can be excluded from the shell command set by |
---|
615 | defining @code{CONFIGURE_SHELL_NO_COMMAND_MKDIR} when all |
---|
616 | shell commands have been configured. |
---|
617 | |
---|
618 | @subheading PROGRAMMING INFORMATION: |
---|
619 | |
---|
620 | @findex rtems_shell_rtems_main_mkdir |
---|
621 | |
---|
622 | The @code{mkdir} is implemented by a C language function |
---|
623 | which has the following prototype: |
---|
624 | |
---|
625 | @example |
---|
626 | int rtems_shell_rtems_main_mkdir( |
---|
627 | int argc, |
---|
628 | char **argv |
---|
629 | ); |
---|
630 | @end example |
---|
631 | |
---|
632 | The configuration structure for the @code{mkdir} has the |
---|
633 | following prototype: |
---|
634 | |
---|
635 | @example |
---|
636 | extern rtems_shell_cmd_t rtems_shell_MKDIR_Command; |
---|
637 | @end example |
---|
638 | |
---|
639 | @c |
---|
640 | @c |
---|
641 | @c |
---|
642 | @page |
---|
643 | @subsection rmdir - remove empty directories |
---|
644 | |
---|
645 | @pgindex rmdir |
---|
646 | |
---|
647 | @subheading SYNOPSYS: |
---|
648 | |
---|
649 | @example |
---|
650 | rmdir [dir1 .. dirN] |
---|
651 | @end example |
---|
652 | |
---|
653 | @subheading DESCRIPTION: |
---|
654 | |
---|
655 | This command removes the specified set of directories. If no |
---|
656 | directories are provided on the command line, no actions are taken. |
---|
657 | |
---|
658 | @subheading EXIT STATUS: |
---|
659 | |
---|
660 | This command returns 0 on success and non-zero if an error is encountered. |
---|
661 | |
---|
662 | @subheading NOTES: |
---|
663 | |
---|
664 | This command is a implemented using the @code{rmdir(2)} system |
---|
665 | call and all reasons that call may fail apply to this command. |
---|
666 | |
---|
667 | @subheading EXAMPLES: |
---|
668 | |
---|
669 | The following is an example of how to use @code{rmdir}: |
---|
670 | |
---|
671 | @example |
---|
672 | SHLL [/] # mkdir joeldir |
---|
673 | SHLL [/] # rmdir joeldir |
---|
674 | SHLL [/] # ls joeldir |
---|
675 | joeldir: No such file or directory. |
---|
676 | @end example |
---|
677 | |
---|
678 | @subheading CONFIGURATION: |
---|
679 | |
---|
680 | @findex CONFIGURE_SHELL_NO_COMMAND_RMDIR |
---|
681 | @findex CONFIGURE_SHELL_COMMAND_RMDIR |
---|
682 | |
---|
683 | This command is included in the default shell command set. |
---|
684 | When building a custom command set, define |
---|
685 | @code{CONFIGURE_SHELL_COMMAND_RMDIR} to have this |
---|
686 | command included. |
---|
687 | |
---|
688 | This command can be excluded from the shell command set by |
---|
689 | defining @code{CONFIGURE_SHELL_NO_COMMAND_RMDIR} when all |
---|
690 | shell commands have been configured. |
---|
691 | |
---|
692 | @subheading PROGRAMMING INFORMATION: |
---|
693 | |
---|
694 | @findex rtems_shell_rtems_main_rmdir |
---|
695 | |
---|
696 | The @code{rmdir} is implemented by a C language function |
---|
697 | which has the following prototype: |
---|
698 | |
---|
699 | @example |
---|
700 | int rtems_shell_rtems_main_rmdir( |
---|
701 | int argc, |
---|
702 | char **argv |
---|
703 | ); |
---|
704 | @end example |
---|
705 | |
---|
706 | The configuration structure for the @code{rmdir} has the |
---|
707 | following prototype: |
---|
708 | |
---|
709 | @example |
---|
710 | extern rtems_shell_cmd_t rtems_shell_RMDIR_Command; |
---|
711 | @end example |
---|
712 | |
---|
713 | @c |
---|
714 | @c |
---|
715 | @c |
---|
716 | @page |
---|
717 | @subsection chroot - change the root directory |
---|
718 | |
---|
719 | @pgindex chroot |
---|
720 | |
---|
721 | @subheading SYNOPSYS: |
---|
722 | |
---|
723 | @example |
---|
724 | chroot [dir] |
---|
725 | @end example |
---|
726 | |
---|
727 | @subheading DESCRIPTION: |
---|
728 | |
---|
729 | This command changes the root directory to @code{dir} for subsequent |
---|
730 | commands. |
---|
731 | |
---|
732 | @subheading EXIT STATUS: |
---|
733 | |
---|
734 | This command returns 0 on success and non-zero if an error is encountered. |
---|
735 | |
---|
736 | The destination directory @code{dir} must exist. |
---|
737 | |
---|
738 | @subheading NOTES: |
---|
739 | |
---|
740 | NONE |
---|
741 | |
---|
742 | @subheading EXAMPLES: |
---|
743 | |
---|
744 | The following is an example of how to use @code{chroot} |
---|
745 | and the impact it has on the environment for subsequent |
---|
746 | command invocations: |
---|
747 | |
---|
748 | @example |
---|
749 | SHLL [/] $ cat passwd |
---|
750 | cat: passwd: No such file or directory |
---|
751 | SHLL [/] $ chroot etc |
---|
752 | SHLL [/] $ cat passwd |
---|
753 | root:*:0:0:root::/:/bin/sh |
---|
754 | rtems:*:1:1:RTEMS Application::/:/bin/sh |
---|
755 | tty:!:2:2:tty owner::/:/bin/false |
---|
756 | SHLL [/] $ cat /etc/passwd |
---|
757 | cat: /etc/passwd: No such file or directory |
---|
758 | @end example |
---|
759 | |
---|
760 | @subheading CONFIGURATION: |
---|
761 | |
---|
762 | @findex CONFIGURE_SHELL_NO_COMMAND_CHROOT |
---|
763 | @findex CONFIGURE_SHELL_COMMAND_CHROOT |
---|
764 | |
---|
765 | This command is included in the default shell command set. |
---|
766 | When building a custom command set, define |
---|
767 | @code{CONFIGURE_SHELL_COMMAND_CHROOT} to have this |
---|
768 | command included. |
---|
769 | |
---|
770 | This command can be excluded from the shell command set by |
---|
771 | defining @code{CONFIGURE_SHELL_NO_COMMAND_CHROOT} when all |
---|
772 | shell commands have been configured. |
---|
773 | |
---|
774 | @subheading PROGRAMMING INFORMATION: |
---|
775 | |
---|
776 | @findex rtems_shell_rtems_main_chroot |
---|
777 | |
---|
778 | The @code{chroot} is implemented by a C language function |
---|
779 | which has the following prototype: |
---|
780 | |
---|
781 | @example |
---|
782 | int rtems_shell_rtems_main_chroot( |
---|
783 | int argc, |
---|
784 | char **argv |
---|
785 | ); |
---|
786 | @end example |
---|
787 | |
---|
788 | The configuration structure for the @code{chroot} has the |
---|
789 | following prototype: |
---|
790 | |
---|
791 | @example |
---|
792 | extern rtems_shell_cmd_t rtems_shell_CHROOT_Command; |
---|
793 | @end example |
---|
794 | |
---|
795 | @c |
---|
796 | @c |
---|
797 | @c |
---|
798 | @page |
---|
799 | @subsection chmod - change permissions of a file |
---|
800 | |
---|
801 | @pgindex chmod |
---|
802 | |
---|
803 | @subheading SYNOPSYS: |
---|
804 | |
---|
805 | @example |
---|
806 | chmod permissions file1 [file2...] |
---|
807 | @end example |
---|
808 | |
---|
809 | @subheading DESCRIPTION: |
---|
810 | |
---|
811 | This command changes the permissions on the files specified to the |
---|
812 | indicated @code{permissions}. The permission values are POSIX based |
---|
813 | with owner, group, and world having individual read, write, and |
---|
814 | executive permission bits. |
---|
815 | |
---|
816 | @subheading EXIT STATUS: |
---|
817 | |
---|
818 | This command returns 0 on success and non-zero if an error is encountered. |
---|
819 | |
---|
820 | @subheading NOTES: |
---|
821 | |
---|
822 | The @code{chmod} command only takes numeric representations of |
---|
823 | the permissions. |
---|
824 | |
---|
825 | @subheading EXAMPLES: |
---|
826 | |
---|
827 | The following is an example of how to use @code{chmod}: |
---|
828 | |
---|
829 | @example |
---|
830 | SHLL [/] # cd etc |
---|
831 | SHLL [/etc] # ls |
---|
832 | -rw-r--r-- 1 root root 102 Jan 01 00:00 passwd |
---|
833 | -rw-r--r-- 1 root root 42 Jan 01 00:00 group |
---|
834 | -rw-r--r-- 1 root root 30 Jan 01 00:00 issue |
---|
835 | -rw-r--r-- 1 root root 28 Jan 01 00:00 issue.net |
---|
836 | 4 files 202 bytes occupied |
---|
837 | SHLL [/etc] # chmod 0777 passwd |
---|
838 | SHLL [/etc] # ls |
---|
839 | -rwxrwxrwx 1 root root 102 Jan 01 00:00 passwd |
---|
840 | -rw-r--r-- 1 root root 42 Jan 01 00:00 group |
---|
841 | -rw-r--r-- 1 root root 30 Jan 01 00:00 issue |
---|
842 | -rw-r--r-- 1 root root 28 Jan 01 00:00 issue.net |
---|
843 | 4 files 202 bytes occupied |
---|
844 | SHLL [/etc] # chmod 0322 passwd |
---|
845 | SHLL [/etc] # ls |
---|
846 | --wx-w--w- 1 nouser root 102 Jan 01 00:00 passwd |
---|
847 | -rw-r--r-- 1 nouser root 42 Jan 01 00:00 group |
---|
848 | -rw-r--r-- 1 nouser root 30 Jan 01 00:00 issue |
---|
849 | -rw-r--r-- 1 nouser root 28 Jan 01 00:00 issue.net |
---|
850 | 4 files 202 bytes occupied |
---|
851 | SHLL [/etc] # chmod 0644 passwd |
---|
852 | SHLL [/etc] # ls |
---|
853 | -rw-r--r-- 1 root root 102 Jan 01 00:00 passwd |
---|
854 | -rw-r--r-- 1 root root 42 Jan 01 00:00 group |
---|
855 | -rw-r--r-- 1 root root 30 Jan 01 00:00 issue |
---|
856 | -rw-r--r-- 1 root root 28 Jan 01 00:00 issue.net |
---|
857 | 4 files 202 bytes occupied |
---|
858 | @end example |
---|
859 | |
---|
860 | @subheading CONFIGURATION: |
---|
861 | |
---|
862 | @findex CONFIGURE_SHELL_NO_COMMAND_CHMOD |
---|
863 | @findex CONFIGURE_SHELL_COMMAND_CHMOD |
---|
864 | |
---|
865 | This command is included in the default shell command set. |
---|
866 | When building a custom command set, define |
---|
867 | @code{CONFIGURE_SHELL_COMMAND_CHMOD} to have this |
---|
868 | command included. |
---|
869 | |
---|
870 | This command can be excluded from the shell command set by |
---|
871 | defining @code{CONFIGURE_SHELL_NO_COMMAND_CHMOD} when all |
---|
872 | shell commands have been configured. |
---|
873 | |
---|
874 | @subheading PROGRAMMING INFORMATION: |
---|
875 | |
---|
876 | @findex rtems_shell_rtems_main_chmod |
---|
877 | |
---|
878 | The @code{chmod} is implemented by a C language function |
---|
879 | which has the following prototype: |
---|
880 | |
---|
881 | @example |
---|
882 | int rtems_shell_rtems_main_chmod( |
---|
883 | int argc, |
---|
884 | char **argv |
---|
885 | ); |
---|
886 | @end example |
---|
887 | |
---|
888 | The configuration structure for the @code{chmod} has the |
---|
889 | following prototype: |
---|
890 | |
---|
891 | @example |
---|
892 | extern rtems_shell_cmd_t rtems_shell_CHMOD_Command; |
---|
893 | @end example |
---|
894 | |
---|
895 | @c |
---|
896 | @c |
---|
897 | @c |
---|
898 | @page |
---|
899 | @subsection cat - display file contents |
---|
900 | |
---|
901 | @pgindex cat |
---|
902 | |
---|
903 | @subheading SYNOPSYS: |
---|
904 | |
---|
905 | @example |
---|
906 | cat file1 [file2 .. fileN] |
---|
907 | @end example |
---|
908 | |
---|
909 | @subheading DESCRIPTION: |
---|
910 | |
---|
911 | This command displays the contents of the specified files. |
---|
912 | |
---|
913 | @subheading EXIT STATUS: |
---|
914 | |
---|
915 | This command returns 0 on success and non-zero if an error is encountered. |
---|
916 | |
---|
917 | @subheading NOTES: |
---|
918 | |
---|
919 | It is possible to read the input from a device file using @code{cat}. |
---|
920 | |
---|
921 | @subheading EXAMPLES: |
---|
922 | |
---|
923 | The following is an example of how to use @code{cat}: |
---|
924 | |
---|
925 | @example |
---|
926 | SHLL [/] # cat /etc/passwd |
---|
927 | root:*:0:0:root::/:/bin/sh |
---|
928 | rtems:*:1:1:RTEMS Application::/:/bin/sh |
---|
929 | tty:!:2:2:tty owner::/:/bin/false |
---|
930 | @end example |
---|
931 | |
---|
932 | @subheading CONFIGURATION: |
---|
933 | |
---|
934 | @findex CONFIGURE_SHELL_NO_COMMAND_CAT |
---|
935 | @findex CONFIGURE_SHELL_COMMAND_CAT |
---|
936 | |
---|
937 | This command is included in the default shell command set. |
---|
938 | When building a custom command set, define |
---|
939 | @code{CONFIGURE_SHELL_COMMAND_CAT} to have this |
---|
940 | command included. |
---|
941 | |
---|
942 | This command can be excluded from the shell command set by |
---|
943 | defining @code{CONFIGURE_SHELL_NO_COMMAND_CAT} when all |
---|
944 | shell commands have been configured. |
---|
945 | |
---|
946 | @subheading PROGRAMMING INFORMATION: |
---|
947 | |
---|
948 | @findex rtems_shell_rtems_main_cat |
---|
949 | |
---|
950 | The @code{cat} is implemented by a C language function |
---|
951 | which has the following prototype: |
---|
952 | |
---|
953 | @example |
---|
954 | int rtems_shell_rtems_main_cat( |
---|
955 | int argc, |
---|
956 | char **argv |
---|
957 | ); |
---|
958 | @end example |
---|
959 | |
---|
960 | The configuration structure for the @code{cat} has the |
---|
961 | following prototype: |
---|
962 | |
---|
963 | @example |
---|
964 | extern rtems_shell_cmd_t rtems_shell_CAT_Command; |
---|
965 | @end example |
---|
966 | |
---|
967 | @c |
---|
968 | @c |
---|
969 | @c |
---|
970 | @page |
---|
971 | @subsection rm - remove files |
---|
972 | |
---|
973 | @pgindex rm |
---|
974 | |
---|
975 | @subheading SYNOPSYS: |
---|
976 | |
---|
977 | @example |
---|
978 | rm file1 [file2 ... fileN] |
---|
979 | @end example |
---|
980 | |
---|
981 | @subheading DESCRIPTION: |
---|
982 | |
---|
983 | This command deletes a name from the filesystem. If the specified file name |
---|
984 | was the last link to a file and there are no @code{open} file descriptor |
---|
985 | references to that file, then it is deleted and the associated space in |
---|
986 | the file system is made available for subsequent use. |
---|
987 | |
---|
988 | If the filename specified was the last link to a file but there |
---|
989 | are open file descriptor references to it, then the file will |
---|
990 | remain in existence until the last file descriptor referencing |
---|
991 | it is closed. |
---|
992 | |
---|
993 | @subheading EXIT STATUS: |
---|
994 | |
---|
995 | This command returns 0 on success and non-zero if an error is encountered. |
---|
996 | |
---|
997 | @subheading NOTES: |
---|
998 | |
---|
999 | NONE |
---|
1000 | |
---|
1001 | @subheading EXAMPLES: |
---|
1002 | |
---|
1003 | The following is an example of how to use @code{rm}: |
---|
1004 | |
---|
1005 | @example |
---|
1006 | SHLL [/] # cp /etc/passwd tmpfile |
---|
1007 | SHLL [/] # cat tmpfile |
---|
1008 | root:*:0:0:root::/:/bin/sh |
---|
1009 | rtems:*:1:1:RTEMS Application::/:/bin/sh |
---|
1010 | tty:!:2:2:tty owner::/:/bin/false |
---|
1011 | SHLL [/] # rm tmpfile |
---|
1012 | SHLL [/] # cat tmpfile |
---|
1013 | cat: tmpfile: No such file or directory |
---|
1014 | @end example |
---|
1015 | |
---|
1016 | @subheading CONFIGURATION: |
---|
1017 | |
---|
1018 | @findex CONFIGURE_SHELL_NO_COMMAND_RM |
---|
1019 | @findex CONFIGURE_SHELL_COMMAND_RM |
---|
1020 | |
---|
1021 | This command is included in the default shell command set. |
---|
1022 | When building a custom command set, define |
---|
1023 | @code{CONFIGURE_SHELL_COMMAND_RM} to have this |
---|
1024 | command included. |
---|
1025 | |
---|
1026 | This command can be excluded from the shell command set by |
---|
1027 | defining @code{CONFIGURE_SHELL_NO_COMMAND_RM} when all |
---|
1028 | shell commands have been configured. |
---|
1029 | |
---|
1030 | @subheading PROGRAMMING INFORMATION: |
---|
1031 | |
---|
1032 | @findex rtems_shell_rtems_main_rm |
---|
1033 | |
---|
1034 | The @code{rm} is implemented by a C language function |
---|
1035 | which has the following prototype: |
---|
1036 | |
---|
1037 | @example |
---|
1038 | int rtems_shell_rtems_main_rm( |
---|
1039 | int argc, |
---|
1040 | char **argv |
---|
1041 | ); |
---|
1042 | @end example |
---|
1043 | |
---|
1044 | The configuration structure for the @code{rm} has the |
---|
1045 | following prototype: |
---|
1046 | |
---|
1047 | @example |
---|
1048 | extern rtems_shell_cmd_t rtems_shell_RM_Command; |
---|
1049 | @end example |
---|
1050 | |
---|
1051 | @c |
---|
1052 | @c |
---|
1053 | @c |
---|
1054 | @page |
---|
1055 | @subsection mount - mount disk |
---|
1056 | |
---|
1057 | @pgindex mount |
---|
1058 | |
---|
1059 | @subheading SYNOPSYS: |
---|
1060 | |
---|
1061 | @example |
---|
1062 | mount [-t fstype] [-r] [-L] device path |
---|
1063 | @end example |
---|
1064 | |
---|
1065 | @subheading DESCRIPTION: |
---|
1066 | |
---|
1067 | The @code{mount} command will mount a block device to a mount point |
---|
1068 | using the specified file system. The files systems are: |
---|
1069 | |
---|
1070 | @itemize @bullet |
---|
1071 | @item msdos - MSDOS File System |
---|
1072 | @item tftp - TFTP Network File System |
---|
1073 | @item ftp - FTP Network File System |
---|
1074 | @item nfs - Network File System |
---|
1075 | @end itemize |
---|
1076 | |
---|
1077 | When the file system type is 'msdos' the driver is a "block device driver" |
---|
1078 | node present in the file system. The driver is ignored with the 'tftp' and |
---|
1079 | 'ftp' file systems. For the 'nfs' file system the driver is the 'host:/path' |
---|
1080 | string that described NFS host and the exported file system path. |
---|
1081 | |
---|
1082 | @subheading EXIT STATUS: |
---|
1083 | |
---|
1084 | This command returns 0 on success and non-zero if an error is encountered. |
---|
1085 | |
---|
1086 | @subheading NOTES: |
---|
1087 | |
---|
1088 | The mount point must exist. |
---|
1089 | |
---|
1090 | The services offered by each file-system vary. For example you cannot list the |
---|
1091 | directory of a TFTP file-system as this server is not provided in the TFTP |
---|
1092 | protocol. You need to check each file-system's documentation for the services |
---|
1093 | provided. |
---|
1094 | |
---|
1095 | @subheading EXAMPLES: |
---|
1096 | |
---|
1097 | Mount the Flash Disk driver to the '/fd' mount point: |
---|
1098 | |
---|
1099 | @example |
---|
1100 | $ mount -t msdos /dev/flashdisk0 /fd |
---|
1101 | @end example |
---|
1102 | |
---|
1103 | Mount the NFS file system exported path 'bar' by host 'foo': |
---|
1104 | |
---|
1105 | @example |
---|
1106 | $ mount -t nfs foo:/bar /nfs |
---|
1107 | @end example |
---|
1108 | |
---|
1109 | Mount the TFTP file system on '/tftp': |
---|
1110 | |
---|
1111 | @example |
---|
1112 | $ mount -t tftp /tftp |
---|
1113 | @end example |
---|
1114 | |
---|
1115 | To access the TFTP files on server '10.10.10.10': |
---|
1116 | |
---|
1117 | @example |
---|
1118 | $ cat /tftp/10.10.10.10/test.txt |
---|
1119 | @end example |
---|
1120 | |
---|
1121 | |
---|
1122 | @subheading CONFIGURATION: |
---|
1123 | |
---|
1124 | @findex CONFIGURE_SHELL_NO_COMMAND_MOUNT |
---|
1125 | @findex CONFIGURE_SHELL_COMMAND_MOUNT |
---|
1126 | |
---|
1127 | This command is included in the default shell command set. |
---|
1128 | When building a custom command set, define |
---|
1129 | @code{CONFIGURE_SHELL_COMMAND_MOUNT} to have this |
---|
1130 | command included. |
---|
1131 | |
---|
1132 | This command can be excluded from the shell command set by |
---|
1133 | defining @code{CONFIGURE_SHELL_NO_COMMAND_MOUNT} when all |
---|
1134 | shell commands have been configured. |
---|
1135 | |
---|
1136 | The mount command includes references to file-system code. If you do not wish |
---|
1137 | to include file-system that you do not use do not define the mount command |
---|
1138 | support for that file-system. The file-system mount command defines are: |
---|
1139 | |
---|
1140 | @itemize @bullet |
---|
1141 | @item msdos - CONFIGURE_SHELL_MOUNT_MSDOS |
---|
1142 | @item tftp - CONFIGURE_SHELL_MOUNT_TFTP |
---|
1143 | @item ftp - CONFIGURE_SHELL_MOUNT_FTP |
---|
1144 | @item nfs - CONFIGURE_SHELL_MOUNT_NFS |
---|
1145 | @end itemize |
---|
1146 | |
---|
1147 | An example configuration is: |
---|
1148 | |
---|
1149 | @example |
---|
1150 | #define CONFIGURE_SHELL_MOUNT_MSDOS |
---|
1151 | #ifdef RTEMS_NETWORKING |
---|
1152 | #define CONFIGURE_SHELL_MOUNT_TFTP |
---|
1153 | #define CONFIGURE_SHELL_MOUNT_FTP |
---|
1154 | #define CONFIGURE_SHELL_MOUNT_NFS |
---|
1155 | #endif |
---|
1156 | @end example |
---|
1157 | |
---|
1158 | @subheading PROGRAMMING INFORMATION: |
---|
1159 | |
---|
1160 | @findex rtems_shell_rtems_main_mount |
---|
1161 | |
---|
1162 | The @code{mount} is implemented by a C language function |
---|
1163 | which has the following prototype: |
---|
1164 | |
---|
1165 | @example |
---|
1166 | int rtems_shell_rtems_main_mount( |
---|
1167 | int argc, |
---|
1168 | char **argv |
---|
1169 | ); |
---|
1170 | @end example |
---|
1171 | |
---|
1172 | The configuration structure for the @code{mount} has the |
---|
1173 | following prototype: |
---|
1174 | |
---|
1175 | @example |
---|
1176 | extern rtems_shell_cmd_t rtems_shell_MOUNT_Command; |
---|
1177 | @end example |
---|
1178 | |
---|
1179 | @c |
---|
1180 | @c |
---|
1181 | @c |
---|
1182 | @page |
---|
1183 | @subsection unmount - unmount disk |
---|
1184 | |
---|
1185 | @pgindex unmount |
---|
1186 | |
---|
1187 | @subheading SYNOPSYS: |
---|
1188 | |
---|
1189 | @example |
---|
1190 | unmount path |
---|
1191 | @end example |
---|
1192 | |
---|
1193 | @subheading DESCRIPTION: |
---|
1194 | |
---|
1195 | This command unmounts the device at the specified @code{path}. |
---|
1196 | |
---|
1197 | @subheading EXIT STATUS: |
---|
1198 | |
---|
1199 | This command returns 0 on success and non-zero if an error is encountered. |
---|
1200 | |
---|
1201 | @subheading NOTES: |
---|
1202 | |
---|
1203 | TBD - Surely there must be some warnings to go here. |
---|
1204 | |
---|
1205 | @subheading EXAMPLES: |
---|
1206 | |
---|
1207 | The following is an example of how to use @code{unmount}: |
---|
1208 | |
---|
1209 | @example |
---|
1210 | EXAMPLE_TBD |
---|
1211 | @end example |
---|
1212 | |
---|
1213 | @subheading CONFIGURATION: |
---|
1214 | |
---|
1215 | @findex CONFIGURE_SHELL_NO_COMMAND_UNMOUNT |
---|
1216 | @findex CONFIGURE_SHELL_COMMAND_UNMOUNT |
---|
1217 | |
---|
1218 | This command is included in the default shell command set. |
---|
1219 | When building a custom command set, define |
---|
1220 | @code{CONFIGURE_SHELL_COMMAND_UNMOUNT} to have this |
---|
1221 | command included. |
---|
1222 | |
---|
1223 | This command can be excluded from the shell command set by |
---|
1224 | defining @code{CONFIGURE_SHELL_NO_COMMAND_UNMOUNT} when all |
---|
1225 | shell commands have been configured. |
---|
1226 | |
---|
1227 | @subheading PROGRAMMING INFORMATION: |
---|
1228 | |
---|
1229 | @findex rtems_shell_rtems_main_unmount |
---|
1230 | |
---|
1231 | The @code{unmount} is implemented by a C language function |
---|
1232 | which has the following prototype: |
---|
1233 | |
---|
1234 | @example |
---|
1235 | int rtems_shell_rtems_main_unmount( |
---|
1236 | int argc, |
---|
1237 | char **argv |
---|
1238 | ); |
---|
1239 | @end example |
---|
1240 | |
---|
1241 | The configuration structure for the @code{unmount} has the |
---|
1242 | following prototype: |
---|
1243 | |
---|
1244 | @example |
---|
1245 | extern rtems_shell_cmd_t rtems_shell_UNMOUNT_Command; |
---|
1246 | @end example |
---|
1247 | |
---|
1248 | @c |
---|
1249 | @c |
---|
1250 | @c |
---|
1251 | @page |
---|
1252 | @subsection blksync - sync the block driver |
---|
1253 | |
---|
1254 | @pgindex blksync |
---|
1255 | |
---|
1256 | @subheading SYNOPSYS: |
---|
1257 | |
---|
1258 | @example |
---|
1259 | blksync driver |
---|
1260 | @end example |
---|
1261 | |
---|
1262 | @subheading DESCRIPTION: |
---|
1263 | |
---|
1264 | This command XXX |
---|
1265 | |
---|
1266 | @subheading EXIT STATUS: |
---|
1267 | |
---|
1268 | This command returns 0 on success and non-zero if an error is encountered. |
---|
1269 | |
---|
1270 | @subheading NOTES: |
---|
1271 | |
---|
1272 | NONE |
---|
1273 | |
---|
1274 | @subheading EXAMPLES: |
---|
1275 | |
---|
1276 | The following is an example of how to use @code{blksync}: |
---|
1277 | |
---|
1278 | @example |
---|
1279 | EXAMPLE_TBD |
---|
1280 | @end example |
---|
1281 | |
---|
1282 | @subheading CONFIGURATION: |
---|
1283 | |
---|
1284 | @findex CONFIGURE_SHELL_NO_COMMAND_BLKSYNC |
---|
1285 | @findex CONFIGURE_SHELL_COMMAND_BLKSYNC |
---|
1286 | |
---|
1287 | This command is included in the default shell command set. |
---|
1288 | When building a custom command set, define |
---|
1289 | @code{CONFIGURE_SHELL_COMMAND_BLKSYNC} to have this |
---|
1290 | command included. |
---|
1291 | |
---|
1292 | This command can be excluded from the shell command set by |
---|
1293 | defining @code{CONFIGURE_SHELL_NO_COMMAND_BLKSYNC} when all |
---|
1294 | shell commands have been configured. |
---|
1295 | |
---|
1296 | @subheading PROGRAMMING INFORMATION: |
---|
1297 | |
---|
1298 | @findex rtems_shell_rtems_main_blksync |
---|
1299 | |
---|
1300 | The @code{blksync} is implemented by a C language function |
---|
1301 | which has the following prototype: |
---|
1302 | |
---|
1303 | @example |
---|
1304 | int rtems_shell_rtems_main_blksync( |
---|
1305 | int argc, |
---|
1306 | char **argv |
---|
1307 | ); |
---|
1308 | @end example |
---|
1309 | |
---|
1310 | The configuration structure for the @code{blksync} has the |
---|
1311 | following prototype: |
---|
1312 | |
---|
1313 | @example |
---|
1314 | extern rtems_shell_cmd_t rtems_shell_BLKSYNC_Command; |
---|
1315 | @end example |
---|
1316 | |
---|
1317 | @c |
---|
1318 | @c |
---|
1319 | @c |
---|
1320 | @page |
---|
1321 | @subsection fdisk - format disk |
---|
1322 | |
---|
1323 | @pgindex fdisk |
---|
1324 | |
---|
1325 | @subheading SYNOPSYS: |
---|
1326 | |
---|
1327 | @example |
---|
1328 | fdisk |
---|
1329 | @end example |
---|
1330 | |
---|
1331 | @subheading CONFIGURATION: |
---|
1332 | |
---|
1333 | @findex CONFIGURE_SHELL_NO_COMMAND_FDISK |
---|
1334 | @findex CONFIGURE_SHELL_COMMAND_FDISK |
---|
1335 | |
---|
1336 | This command is included in the default shell command set. |
---|
1337 | When building a custom command set, define |
---|
1338 | @code{CONFIGURE_SHELL_COMMAND_FDISK} to have this |
---|
1339 | command included. |
---|
1340 | |
---|
1341 | This command can be excluded from the shell command set by |
---|
1342 | defining @code{CONFIGURE_SHELL_NO_COMMAND_FDISK} when all |
---|
1343 | shell commands have been configured. |
---|
1344 | |
---|
1345 | @c |
---|
1346 | @c |
---|
1347 | @c |
---|
1348 | @page |
---|
1349 | @subsection dir - alias for ls |
---|
1350 | |
---|
1351 | @pgindex dir |
---|
1352 | |
---|
1353 | @subheading SYNOPSYS: |
---|
1354 | |
---|
1355 | @example |
---|
1356 | dir [dir] |
---|
1357 | @end example |
---|
1358 | |
---|
1359 | @subheading DESCRIPTION: |
---|
1360 | |
---|
1361 | This command is an alias or alternate name for the @code{ls}. |
---|
1362 | See @ref{File and Directory Commands ls - list files in the directory, ls} |
---|
1363 | for more information. |
---|
1364 | |
---|
1365 | @subheading EXIT STATUS: |
---|
1366 | |
---|
1367 | This command returns 0 on success and non-zero if an error is encountered. |
---|
1368 | |
---|
1369 | @subheading NOTES: |
---|
1370 | |
---|
1371 | NONE |
---|
1372 | |
---|
1373 | @subheading EXAMPLES: |
---|
1374 | |
---|
1375 | The following is an example of how to use @code{dir}: |
---|
1376 | |
---|
1377 | @example |
---|
1378 | SHLL [/] $ dir |
---|
1379 | drwxr-xr-x 1 root root 536 Jan 01 00:00 dev/ |
---|
1380 | drwxr-xr-x 1 root root 1072 Jan 01 00:00 etc/ |
---|
1381 | 2 files 1608 bytes occupied |
---|
1382 | SHLL [/] $ dir etc |
---|
1383 | -rw-r--r-- 1 root root 102 Jan 01 00:00 passwd |
---|
1384 | -rw-r--r-- 1 root root 42 Jan 01 00:00 group |
---|
1385 | -rw-r--r-- 1 root root 30 Jan 01 00:00 issue |
---|
1386 | -rw-r--r-- 1 root root 28 Jan 01 00:00 issue.net |
---|
1387 | 4 files 202 bytes occupied |
---|
1388 | @end example |
---|
1389 | |
---|
1390 | @subheading CONFIGURATION: |
---|
1391 | |
---|
1392 | @findex CONFIGURE_SHELL_NO_COMMAND_DIR |
---|
1393 | @findex CONFIGURE_SHELL_COMMAND_DIR |
---|
1394 | |
---|
1395 | This command is included in the default shell command set. |
---|
1396 | When building a custom command set, define |
---|
1397 | @code{CONFIGURE_SHELL_COMMAND_DIR} to have this |
---|
1398 | command included. |
---|
1399 | |
---|
1400 | This command can be excluded from the shell command set by |
---|
1401 | defining @code{CONFIGURE_SHELL_NO_COMMAND_DIR} when all |
---|
1402 | shell commands have been configured. |
---|
1403 | |
---|
1404 | @subheading PROGRAMMING INFORMATION: |
---|
1405 | |
---|
1406 | @findex rtems_shell_rtems_main_dir |
---|
1407 | |
---|
1408 | The @code{dir} is implemented by a C language function |
---|
1409 | which has the following prototype: |
---|
1410 | |
---|
1411 | @example |
---|
1412 | int rtems_shell_rtems_main_dir( |
---|
1413 | int argc, |
---|
1414 | char **argv |
---|
1415 | ); |
---|
1416 | @end example |
---|
1417 | |
---|
1418 | The configuration structure for the @code{dir} has the |
---|
1419 | following prototype: |
---|
1420 | |
---|
1421 | @example |
---|
1422 | extern rtems_shell_cmd_t rtems_shell_DIR_Command; |
---|
1423 | @end example |
---|
1424 | |
---|
1425 | @c |
---|
1426 | @c |
---|
1427 | @c |
---|
1428 | @page |
---|
1429 | @subsection cd - alias for chdir |
---|
1430 | |
---|
1431 | @pgindex cd |
---|
1432 | |
---|
1433 | @subheading SYNOPSYS: |
---|
1434 | |
---|
1435 | @example |
---|
1436 | cd directory |
---|
1437 | @end example |
---|
1438 | |
---|
1439 | @subheading DESCRIPTION: |
---|
1440 | |
---|
1441 | This command is an alias or alternate name for the @code{chdir}. |
---|
1442 | See @ref{File and Directory Commands chdir - change the current directory, cd} |
---|
1443 | for more information. |
---|
1444 | |
---|
1445 | @subheading EXIT STATUS: |
---|
1446 | |
---|
1447 | This command returns 0 on success and non-zero if an error is encountered. |
---|
1448 | |
---|
1449 | @subheading NOTES: |
---|
1450 | |
---|
1451 | NONE |
---|
1452 | |
---|
1453 | @subheading EXAMPLES: |
---|
1454 | |
---|
1455 | The following is an example of how to use @code{cd}: |
---|
1456 | |
---|
1457 | @example |
---|
1458 | SHLL [/] $ cd etc |
---|
1459 | SHLL [/etc] $ cd / |
---|
1460 | SHLL [/] $ cd /etc |
---|
1461 | SHLL [/etc] $ pwd |
---|
1462 | /etc |
---|
1463 | SHLL [/etc] $ cd / |
---|
1464 | SHLL [/] $ pwd |
---|
1465 | / |
---|
1466 | SHLL [/] $ cd etc |
---|
1467 | SHLL [/etc] $ cd .. |
---|
1468 | SHLL [/] $ pwd |
---|
1469 | / |
---|
1470 | @end example |
---|
1471 | |
---|
1472 | @subheading CONFIGURATION: |
---|
1473 | |
---|
1474 | @findex CONFIGURE_SHELL_NO_COMMAND_CD |
---|
1475 | @findex CONFIGURE_SHELL_COMMAND_CD |
---|
1476 | |
---|
1477 | This command is included in the default shell command set. |
---|
1478 | When building a custom command set, define |
---|
1479 | @code{CONFIGURE_SHELL_COMMAND_CD} to have this |
---|
1480 | command included. |
---|
1481 | |
---|
1482 | This command can be excluded from the shell command set by |
---|
1483 | defining @code{CONFIGURE_SHELL_NO_COMMAND_CD} when all |
---|
1484 | shell commands have been configured. |
---|
1485 | |
---|
1486 | @subheading PROGRAMMING INFORMATION: |
---|
1487 | |
---|
1488 | @findex rtems_shell_rtems_main_cd |
---|
1489 | |
---|
1490 | The @code{cd} is implemented by a C language function |
---|
1491 | which has the following prototype: |
---|
1492 | |
---|
1493 | @example |
---|
1494 | int rtems_shell_rtems_main_cd( |
---|
1495 | int argc, |
---|
1496 | char **argv |
---|
1497 | ); |
---|
1498 | @end example |
---|
1499 | |
---|
1500 | The configuration structure for the @code{cd} has the |
---|
1501 | following prototype: |
---|
1502 | |
---|
1503 | @example |
---|
1504 | extern rtems_shell_cmd_t rtems_shell_CD_Command; |
---|
1505 | @end example |
---|
1506 | |
---|