source: rtems/doc/shell/file.t @ 43b09a98

4.115
Last change on this file since 43b09a98 was 43b09a98, checked in by Sebastian Huber <sebastian.huber@…>, on 11/27/14 at 12:37:04

shell: Make mv, cp and rm usable for applications

close #2030

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