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
Line 
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
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
20@item @code{cp} - copy files
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
28@item @code{ls} - list files in the directory
29@item @code{md5} - display file system disk space usage
30@item @code{mkdir} - create a directory
31@item @code{mkdos} - DOSFS disk format
32@item @code{mknod} - make device special file
33@item @code{mkrfs} - format RFS file system
34@item @code{mount} - mount disk
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
40@item @code{unmount} - unmount disk
41
42@end itemize
43
44@section Commands
45
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
51@c
52@c
53@c
54@page
55@subsection blksync - sync the block driver
56
57@pgindex blksync
58
59@subheading SYNOPSYS:
60
61@example
62blksync driver
63@end example
64
65@subheading DESCRIPTION:
66
67This command XXX
68
69@subheading EXIT STATUS:
70
71This command returns 0 on success and non-zero if an error is encountered.
72
73@subheading NOTES:
74
75NONE
76
77@subheading EXAMPLES:
78
79The following is an example of how to use @code{blksync}:
80
81@example
82EXAMPLE_TBD
83@end example
84
85@subheading CONFIGURATION:
86
87@findex CONFIGURE_SHELL_NO_COMMAND_BLKSYNC
88@findex CONFIGURE_SHELL_COMMAND_BLKSYNC
89
90This command is included in the default shell command set.
91When building a custom command set, define
92@code{CONFIGURE_SHELL_COMMAND_BLKSYNC} to have this
93command included.
94
95This command can be excluded from the shell command set by
96defining @code{CONFIGURE_SHELL_NO_COMMAND_BLKSYNC} when all
97shell commands have been configured.
98
99@subheading PROGRAMMING INFORMATION:
100
101@findex rtems_shell_rtems_main_blksync
102
103The @code{blksync} is implemented by a C language function
104which has the following prototype:
105
106@example
107int rtems_shell_rtems_main_blksync(
108  int    argc,
109  char **argv
110);
111@end example
112
113The configuration structure for the @code{blksync} has the
114following prototype:
115
116@example
117extern rtems_shell_cmd_t rtems_shell_BLKSYNC_Command;
118@end example
119
120@c
121@c
122@c
123@page
124@subsection cat - display file contents
125
126@pgindex cat
127
128@subheading SYNOPSYS:
129
130@example
131cat file1 [file2 .. fileN]
132@end example
133
134@subheading DESCRIPTION:
135
136This command displays the contents of the specified files.
137
138@subheading EXIT STATUS:
139
140This command returns 0 on success and non-zero if an error is encountered.
141
142@subheading NOTES:
143
144It is possible to read the input from a device file using @code{cat}.
145
146@subheading EXAMPLES:
147
148The following is an example of how to use @code{cat}:
149
150@example
151SHLL [/] # cat /etc/passwd
152root:*:0:0:root::/:/bin/sh
153rtems:*:1:1:RTEMS Application::/:/bin/sh
154tty:!:2:2:tty owner::/:/bin/false
155@end example
156
157@subheading CONFIGURATION:
158
159@findex CONFIGURE_SHELL_NO_COMMAND_CAT
160@findex CONFIGURE_SHELL_COMMAND_CAT
161
162This command is included in the default shell command set.
163When building a custom command set, define
164@code{CONFIGURE_SHELL_COMMAND_CAT} to have this
165command included.
166
167This command can be excluded from the shell command set by
168defining @code{CONFIGURE_SHELL_NO_COMMAND_CAT} when all
169shell commands have been configured.
170
171@subheading PROGRAMMING INFORMATION:
172
173@findex rtems_shell_rtems_main_cat
174
175The @code{cat} is implemented by a C language function
176which has the following prototype:
177
178@example
179int rtems_shell_rtems_main_cat(
180  int    argc,
181  char **argv
182);
183@end example
184
185The configuration structure for the @code{cat} has the
186following prototype:
187
188@example
189extern rtems_shell_cmd_t rtems_shell_CAT_Command;
190@end example
191
192@c
193@c
194@c
195@page
196@subsection cd - alias for chdir
197
198@pgindex cd
199
200@subheading SYNOPSYS:
201
202@example
203cd directory
204@end example
205
206@subheading DESCRIPTION:
207
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.
211
212@subheading EXIT STATUS:
213
214This command returns 0 on success and non-zero if an error is encountered.
215
216@subheading NOTES:
217
218NONE
219
220@subheading EXAMPLES:
221
222The following is an example of how to use @code{cd}:
223
224@example
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/
237@end example
238
239@subheading CONFIGURATION:
240
241@findex CONFIGURE_SHELL_NO_COMMAND_CD
242@findex CONFIGURE_SHELL_COMMAND_CD
243
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.
248
249This command can be excluded from the shell command set by
250defining @code{CONFIGURE_SHELL_NO_COMMAND_CD} when all
251shell commands have been configured.
252
253@subheading PROGRAMMING INFORMATION:
254
255@findex rtems_shell_rtems_main_cd
256
257The @code{cd} is implemented by a C language function
258which has the following prototype:
259
260@example
261int rtems_shell_rtems_main_cd(
262  int    argc,
263  char **argv
264);
265@end example
266
267The configuration structure for the @code{cd} has the
268following prototype:
269
270@example
271extern rtems_shell_cmd_t rtems_shell_CD_Command;
272@end example
273
274@c
275@c
276@c
277@page
278@subsection chdir - change the current directory
279
280@pgindex chdir
281
282@subheading SYNOPSYS:
283
284@example
285chdir [dir]
286@end example
287
288@subheading DESCRIPTION:
289
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{/}.
293
294@subheading EXIT STATUS:
295
296This command returns 0 on success and non-zero if an error is encountered.
297
298@subheading NOTES:
299
300NONE
301
302@subheading EXAMPLES:
303
304The following is an example of how to use @code{chdir}:
305
306@example
307SHLL [/] $ pwd
308/
309SHLL [/] $ chdir etc
310SHLL [/etc] $ pwd
311/etc
312@end example
313
314@subheading CONFIGURATION:
315
316@findex CONFIGURE_SHELL_NO_COMMAND_CHDIR
317@findex CONFIGURE_SHELL_COMMAND_CHDIR
318
319This command is included in the default shell command set.
320When building a custom command set, define
321@code{CONFIGURE_SHELL_COMMAND_CHDIR} to have this
322command included.
323
324This command can be excluded from the shell command set by
325defining @code{CONFIGURE_SHELL_NO_COMMAND_CHDIR} when all
326shell commands have been configured.
327
328@subheading PROGRAMMING INFORMATION:
329
330@findex rtems_shell_rtems_main_chdir
331
332The @code{chdir} is implemented by a C language function
333which has the following prototype:
334
335@example
336int rtems_shell_rtems_main_chdir(
337  int    argc,
338  char **argv
339);
340@end example
341
342The configuration structure for the @code{chdir} has the
343following prototype:
344
345@example
346extern rtems_shell_cmd_t rtems_shell_CHDIR_Command;
347@end example
348
349@c
350@c
351@c
352@page
353@subsection chmod - change permissions of a file
354
355@pgindex chmod
356
357@subheading SYNOPSYS:
358
359@example
360chmod permissions file1 [file2...]
361@end example
362
363@subheading DESCRIPTION:
364
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.
369
370@subheading EXIT STATUS:
371
372This command returns 0 on success and non-zero if an error is encountered.
373
374@subheading NOTES:
375
376The @code{chmod} command only takes numeric representations of
377the permissions.
378
379@subheading EXAMPLES:
380
381The following is an example of how to use @code{chmod}:
382
383@example
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
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
4114 files 202 bytes occupied
412@end example
413
414@subheading CONFIGURATION:
415
416@findex CONFIGURE_SHELL_NO_COMMAND_CHMOD
417@findex CONFIGURE_SHELL_COMMAND_CHMOD
418
419This command is included in the default shell command set.
420When building a custom command set, define
421@code{CONFIGURE_SHELL_COMMAND_CHMOD} to have this
422command included.
423
424This command can be excluded from the shell command set by
425defining @code{CONFIGURE_SHELL_NO_COMMAND_CHMOD} when all
426shell commands have been configured.
427
428@subheading PROGRAMMING INFORMATION:
429
430@findex rtems_shell_rtems_main_chmod
431
432The @code{chmod} is implemented by a C language function
433which has the following prototype:
434
435@example
436int rtems_shell_rtems_main_chmod(
437  int    argc,
438  char **argv
439);
440@end example
441
442The configuration structure for the @code{chmod} has the
443following prototype:
444
445@example
446extern rtems_shell_cmd_t rtems_shell_CHMOD_Command;
447@end example
448
449@c
450@c
451@c
452@page
453@subsection chroot - change the root directory
454
455@pgindex chroot
456
457@subheading SYNOPSYS:
458
459@example
460chroot [dir]
461@end example
462
463@subheading DESCRIPTION:
464
465This command changes the root directory to @code{dir} for subsequent
466commands.
467
468@subheading EXIT STATUS:
469
470This command returns 0 on success and non-zero if an error is encountered.
471
472The destination directory @code{dir} must exist.
473
474@subheading NOTES:
475
476NONE
477
478@subheading EXAMPLES:
479
480The following is an example of how to use @code{chroot}
481and the impact it has on the environment for subsequent
482command invocations:
483
484@example
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
494@end example
495
496@subheading CONFIGURATION:
497
498@findex CONFIGURE_SHELL_NO_COMMAND_CHROOT
499@findex CONFIGURE_SHELL_COMMAND_CHROOT
500
501This command is included in the default shell command set.
502When building a custom command set, define
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.
507
508This command can be excluded from the shell command set by
509defining @code{CONFIGURE_SHELL_NO_COMMAND_CHROOT} when all
510shell commands have been configured.
511
512@subheading PROGRAMMING INFORMATION:
513
514@findex rtems_shell_rtems_main_chroot
515
516The @code{chroot} is implemented by a C language function
517which has the following prototype:
518
519@example
520int rtems_shell_rtems_main_chroot(
521  int    argc,
522  char **argv
523);
524@end example
525
526The configuration structure for the @code{chroot} has the
527following prototype:
528
529@example
530extern rtems_shell_cmd_t rtems_shell_CHROOT_Command;
531@end example
532
533@c
534@c
535@c
536@page
537@subsection cp - copy files
538
539@pgindex cp
540
541@subheading SYNOPSYS:
542
543@example
544cp [-R [-H | -L | -P]] [-f | -i] [-pv] src target
545cp [-R [-H | -L] ] [-f | -i] [-NpPv] source_file ... target_directory
546@end example
547
548@subheading DESCRIPTION:
549
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.
555
556The following options are available:
557
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.)
564
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.)
568
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.
573
574@item -L
575If the -R option is specified, all symbolic links are followed.
576
577@item -N
578When used with -p, do not copy file flags.
579
580@item -P
581No symbolic links are followed.
582
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.
586
587If the user ID and group ID cannot be preserved, no error message is displayed
588and the exit value is not altered.
589
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.
597
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.
604
605@item -v
606Cause cp to be verbose, showing files as they are copied.
607
608@end table
609
610For each destination file that already exists, its contents are overwritten if
611permissions allow, but its mode, user ID, and group ID are unchanged.
612
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.
615
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.
624
625Appropriate permissions are required for file creation or overwriting.
626
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.
633
634@subheading EXIT STATUS:
635
636This command returns 0 on success and non-zero if an error is encountered.
637
638@subheading NOTES:
639
640NONE
641
642@subheading EXAMPLES:
643
644The following is an example of how to use @code{cp} to
645copy a file to a new name in the current directory:
646
647@example
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 [/] #
680@end example
681
682@subheading CONFIGURATION:
683
684@findex CONFIGURE_SHELL_NO_COMMAND_CP
685@findex CONFIGURE_SHELL_COMMAND_CP
686
687This command is included in the default shell command set.
688When building a custom command set, define
689@code{CONFIGURE_SHELL_COMMAND_CP} to have this
690command included.
691
692This command can be excluded from the shell command set by
693defining @code{CONFIGURE_SHELL_NO_COMMAND_CP} when all
694shell commands have been configured.
695
696@subheading PROGRAMMING INFORMATION:
697
698@findex rtems_shell_main_cp
699
700The @code{cp} command is implemented by a C language function which
701has the following prototype:
702
703@example
704int rtems_shell_main_cp(
705  int    argc,
706  char **argv
707);
708@end example
709
710The configuration structure for the @code{cp} has the
711following prototype:
712
713@example
714extern rtems_shell_cmd_t rtems_shell_CP_Command;
715@end example
716
717@subheading ORIGIN:
718
719The implementation and portions of the documentation for this
720command are from NetBSD 4.0.
721
722@c
723@c
724@c
725@page
726@subsection dd - convert and copy a file
727
728@pgindex dd
729
730@subheading SYNOPSYS:
731
732@example
733dd [operands ...]
734@end example
735
736@subheading DESCRIPTION:
737
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:
746
747@table @b
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.
753
754@item cbs=n
755Set the conversion record size to n bytes.  The conversion record size
756is required by the record oriented conversion values.
757
758@item count=n
759Copy only n input blocks.
760
761@item files=n
762Copy n input files before terminating.  This operand is only
763applicable when the input device is a tape.
764
765@item ibs=n
766Set the input block size to n bytes instead of the default 512.
767
768@item if=file
769Read input from file instead of the standard input.
770
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
811systems.
812
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.
823
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.
833
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.
921
922@subheading EXIT STATUS:
923
924This command returns 0 on success and non-zero if an error is encountered.
925
926@subheading NOTES:
927
928NONE
929
930@subheading EXAMPLES:
931
932The following is an example of how to use @code{dd}:
933
934@example
935SHLL [/] $ dd if=/nfs/boot-image of=/dev/hda1
936@end example
937
938@subheading CONFIGURATION:
939
940@findex CONFIGURE_SHELL_NO_COMMAND_DD
941@findex CONFIGURE_SHELL_COMMAND_DD
942
943This command is included in the default shell command set.  When
944building a custom command set, define
945@code{CONFIGURE_SHELL_COMMAND_DD} to have this command included.
946
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.
950
951@subheading PROGRAMMING INFORMATION:
952
953@findex rtems_shell_rtems_main_dd
954
955The @code{dd} command is implemented by a C language function which
956has the following prototype:
957
958@example
959int rtems_shell_rtems_main_dd(
960  int    argc,
961  char **argv
962);
963@end example
964
965The configuration structure for the @code{dd} has the following
966prototype:
967
968@example
969extern rtems_shell_cmd_t rtems_shell_DD_Command;
970@end example
971
972@c
973@c
974@c
975@page
976@subsection debugrfs - debug RFS file system
977
978@pgindex debugrfs
979
980@subheading SYNOPSYS:
981
982@example
983debugrfs [-hl] path command [options]
984@end example
985
986@subheading DESCRIPTION:
987
988The command provides debugging information for the RFS file system.
989
990The options are:
991
992@table @b
993@item -h
994Print a help message.
995
996@item -l
997List the commands.
998
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
1003
1004The commands are:
1005
1006@table @b
1007@item block start [end]
1008Display the contents of the blocks from start to end.
1009
1010@item data
1011Display the file system data and configuration.
1012
1013@item dir bno
1014Process the block as a directory displaying the entries.
1015
1016@item group start [end]
1017Display the group data from the start group to the end group.
1018
1019@item inode [-aef] [start] [end]
1020Display the inodes between start and end. If no start and end is
1021provides all inodes are displayed.
1022
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
1031@end table
1032
1033@subheading EXIT STATUS:
1034
1035This command returns 0 on success and non-zero if an error is encountered.
1036
1037@subheading NOTES:
1038
1039NONE
1040
1041@subheading EXAMPLES:
1042
1043The following is an example of how to use @code{debugrfs}:
1044
1045@example
1046SHLL [/] $ debugrfs /c data
1047@end example
1048
1049@subheading CONFIGURATION:
1050
1051@findex CONFIGURE_SHELL_NO_COMMAND_DEBUGRFS
1052@findex CONFIGURE_SHELL_COMMAND_DEBUGRFS
1053
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.
1058
1059This command can be excluded from the shell command set by
1060defining @code{CONFIGURE_SHELL_NO_COMMAND_DEBUGRFS} when all
1061shell commands have been configured.
1062
1063@subheading PROGRAMMING INFORMATION:
1064
1065@findex rtems_shell_rtems_main_debugrfs
1066
1067The @code{debugrfs} command is implemented by a C language function which
1068has the following prototype:
1069
1070@example
1071int rtems_shell_rtems_main_debugrfs(
1072  int    argc,
1073  char **argv
1074);
1075@end example
1076
1077The configuration structure for @code{debugrfs} has the following
1078prototype:
1079
1080@example
1081extern rtems_shell_cmd_t rtems_shell_DEBUGRFS_Command;
1082@end example
1083
1084@c
1085@c
1086@c
1087@page
1088@subsection df - display file system disk space usage
1089
1090@pgindex df
1091
1092@subheading SYNOPSYS:
1093
1094@example
1095df [-h] [-B block_size]
1096@end example
1097
1098@subheading DESCRIPTION:
1099
1100This command print disk space usage for mounted file systems.
1101
1102@subheading EXIT STATUS:
1103
1104This command returns 0 on success and non-zero if an error is encountered.
1105
1106@subheading NOTES:
1107
1108NONE
1109
1110@subheading EXAMPLES:
1111
1112The following is an example of how to use @code{df}:
1113
1114@example
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
1124@end example
1125
1126@subheading CONFIGURATION:
1127
1128@findex CONFIGURE_SHELL_NO_COMMAND_DF
1129@findex CONFIGURE_SHELL_COMMAND_DF
1130
1131This command is included in the default shell command set.
1132When building a custom command set, define
1133@code{CONFIGURE_SHELL_COMMAND_DF} to have this
1134command included.
1135
1136This command can be excluded from the shell command set by
1137defining @code{CONFIGURE_SHELL_NO_COMMAND_DF} when all
1138shell commands have been configured.
1139
1140@subheading PROGRAMMING INFORMATION:
1141
1142@findex rtems_shell_rtems_main_df
1143
1144The @code{df} is implemented by a C language function
1145which has the following prototype:
1146
1147@example
1148int rtems_shell_main_df(
1149  int argc,
1150  char **argv
1151);
1152@end example
1153
1154The configuration structure for the @code{df} has the
1155following prototype:
1156
1157@example
1158extern rtems_shell_cmd_t rtems_shell_DF_Command;
1159@end example
1160
1161@c
1162@c
1163@c
1164@page
1165@subsection dir - alias for ls
1166
1167@pgindex dir
1168
1169@subheading SYNOPSYS:
1170
1171@example
1172dir [dir]
1173@end example
1174
1175@subheading DESCRIPTION:
1176
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.
1180
1181@subheading EXIT STATUS:
1182
1183This command returns 0 on success and non-zero if an error is encountered.
1184
1185@subheading NOTES:
1186
1187NONE
1188
1189@subheading EXAMPLES:
1190
1191The following is an example of how to use @code{dir}:
1192
1193@example
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
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
12034 files 202 bytes occupied
1204@end example
1205
1206@subheading CONFIGURATION:
1207
1208@findex CONFIGURE_SHELL_NO_COMMAND_DIR
1209@findex CONFIGURE_SHELL_COMMAND_DIR
1210
1211This command is included in the default shell command set.
1212When building a custom command set, define
1213@code{CONFIGURE_SHELL_COMMAND_DIR} to have this
1214command included.
1215
1216This command can be excluded from the shell command set by
1217defining @code{CONFIGURE_SHELL_NO_COMMAND_DIR} when all
1218shell commands have been configured.
1219
1220@subheading PROGRAMMING INFORMATION:
1221
1222@findex rtems_shell_rtems_main_dir
1223
1224The @code{dir} is implemented by a C language function
1225which has the following prototype:
1226
1227@example
1228int rtems_shell_rtems_main_dir(
1229  int    argc,
1230  char **argv
1231);
1232@end example
1233
1234The configuration structure for the @code{dir} has the
1235following prototype:
1236
1237@example
1238extern rtems_shell_cmd_t rtems_shell_DIR_Command;
1239@end example
1240
1241@c
1242@c
1243@c
1244@page
1245@subsection fdisk - format disk
1246
1247@pgindex fdisk
1248
1249@subheading SYNOPSYS:
1250
1251@example
1252fdisk
1253@end example
1254
1255@subheading CONFIGURATION:
1256
1257@findex CONFIGURE_SHELL_NO_COMMAND_FDISK
1258@findex CONFIGURE_SHELL_COMMAND_FDISK
1259
1260This command is included in the default shell command set.
1261When building a custom command set, define
1262@code{CONFIGURE_SHELL_COMMAND_FDISK} to have this
1263command included.
1264
1265This command can be excluded from the shell command set by
1266defining @code{CONFIGURE_SHELL_NO_COMMAND_FDISK} when all
1267shell commands have been configured.
1268
1269@c
1270@c
1271@c
1272@page
1273@subsection hexdump - ascii/dec/hex/octal dump
1274
1275@pgindex hexdump
1276
1277@subheading SYNOPSYS:
1278
1279@example
1280hexdump [-bcCdovx] [-e format_string] [-f format_file] [-n length]
1281        [-s skip] file ...
1282@end example
1283
1284@subheading DESCRIPTION:
1285
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
1748
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.
1775
1776@subheading EXIT STATUS:
1777
1778This command returns 0 on success and non-zero if an error is encountered.
1779
1780@subheading NOTES:
1781
1782NONE
1783
1784@subheading EXAMPLES:
1785
1786The following is an example of how to use @code{md5}:
1787
1788@example
1789SHLL [/] $ md5 shell-init
1790MD5 (shell-init) = 43b4d2e71b47db79eae679a2efeacf31
1791@end example
1792
1793@subheading CONFIGURATION:
1794
1795@findex CONFIGURE_SHELL_NO_COMMAND_MD5
1796@findex CONFIGURE_SHELL_COMMAND_MD5
1797
1798This command is included in the default shell command set.
1799When building a custom command set, define
1800@code{CONFIGURE_SHELL_COMMAND_MD5} to have this
1801command included.
1802
1803This command can be excluded from the shell command set by
1804defining @code{CONFIGURE_SHELL_NO_COMMAND_MD5} when all
1805shell commands have been configured.
1806
1807@subheading PROGRAMMING INFORMATION:
1808
1809@findex rtems_shell_rtems_main_md5
1810
1811The @code{df} is implemented by a C language function
1812which has the following prototype:
1813
1814@example
1815int rtems_shell_main_md5(
1816  int argc,
1817  char **argv
1818);
1819@end example
1820
1821The configuration structure for the @code{md5} has the
1822following prototype:
1823
1824@example
1825extern rtems_shell_cmd_t rtems_shell_MD5_Command;
1826@end example
1827
1828@c
1829@c
1830@c
1831@page
1832@subsection mkdir - create a directory
1833
1834@pgindex mkdir
1835
1836@subheading SYNOPSYS:
1837
1838@example
1839mkdir  dir [dir1 .. dirN]
1840@end example
1841
1842@subheading DESCRIPTION:
1843
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.
1848
1849@subheading EXIT STATUS:
1850
1851This command returns 0 on success and non-zero if an error is encountered.
1852
1853@subheading NOTES:
1854
1855If this command is invoked with no arguments, nothing occurs.
1856
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}.
1860
1861@subheading EXAMPLES:
1862
1863The following is an example of how to use @code{mkdir}:
1864
1865@example
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
1877@end example
1878
1879@subheading CONFIGURATION:
1880
1881@findex CONFIGURE_SHELL_NO_COMMAND_MKDIR
1882@findex CONFIGURE_SHELL_COMMAND_MKDIR
1883
1884This command is included in the default shell command set.
1885When building a custom command set, define
1886@code{CONFIGURE_SHELL_COMMAND_MKDIR} to have this
1887command included.
1888
1889This command can be excluded from the shell command set by
1890defining @code{CONFIGURE_SHELL_NO_COMMAND_MKDIR} when all
1891shell commands have been configured.
1892
1893@subheading PROGRAMMING INFORMATION:
1894
1895@findex rtems_shell_rtems_main_mkdir
1896
1897The @code{mkdir} is implemented by a C language function
1898which has the following prototype:
1899
1900@example
1901int rtems_shell_rtems_main_mkdir(
1902  int    argc,
1903  char **argv
1904);
1905@end example
1906
1907The configuration structure for the @code{mkdir} has the
1908following prototype:
1909
1910@example
1911extern rtems_shell_cmd_t rtems_shell_MKDIR_Command;
1912@end example
1913
1914@c
1915@c
1916@c
1917@page
1918@subsection mldos - DOSFS file system format
1919
1920@pgindex pwd
1921
1922@subheading SYNOPSYS:
1923
1924@example
1925mkdir [-V label] [-s sectors/cluster] [-r size] [-v] path
1926@end example
1927
1928@subheading DESCRIPTION:
1929
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
1940
1941@subheading EXIT STATUS:
1942
1943This command returns 0 on success and non-zero if an error is encountered.
1944
1945@subheading NOTES:
1946
1947NONE
1948
1949@subheading EXAMPLES:
1950
1951The following is an example of how to use @code{mkdos}:
1952
1953@example
1954SHLL [/] $ mkdos /dev/rda1
1955@end example
1956
1957@subheading CONFIGURATION:
1958
1959@findex CONFIGURE_SHELL_NO_COMMAND_MKDOS
1960@findex CONFIGURE_SHELL_COMMAND_MKDOS
1961
1962This command is included in the default shell command set.
1963When building a custom command set, define
1964@code{CONFIGURE_SHELL_COMMAND_MKDOS} to have this
1965command included.
1966
1967This command can be excluded from the shell command set by
1968defining @code{CONFIGURE_SHELL_NO_COMMAND_MKDOS} when all
1969shell commands have been configured.
1970
1971@subheading PROGRAMMING INFORMATION:
1972
1973@findex rtems_shell_rtems_main_mkdos
1974
1975The @code{mkdos} is implemented by a C language function
1976which has the following prototype:
1977
1978@example
1979int rtems_shell_rtems_main_mkdos(
1980  int    argc,
1981  char **argv
1982);
1983@end example
1984
1985The configuration structure for the @code{mkdos} has the
1986following prototype:
1987
1988@example
1989extern rtems_shell_cmd_t rtems_shell_MKDOS_Command;
1990@end example
1991
1992@c
1993@c
1994@c
1995@page
1996@subsection mknod - make device special file
1997
1998@pgindex mknod
1999
2000@subheading SYNOPSYS:
2001
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.
2064
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).
2070
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
2076
2077@subheading EXIT STATUS:
2078
2079The @code{mknod} utility exits 0 on success, and >0 if an error occurs.
2080
2081@subheading NOTES:
2082
2083NONE
2084
2085@subheading EXAMPLES:
2086
2087@example
2088SHLL [/] mknod c 3 0 /dev/ttyS10
2089@end example
2090
2091@subheading CONFIGURATION:
2092
2093@findex CONFIGURE_SHELL_NO_COMMAND_MKNOD
2094@findex CONFIGURE_SHELL_COMMAND_MKNOD
2095
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.
2099
2100This command can be excluded from the shell command set by
2101defining @code{CONFIGURE_SHELL_NO_COMMAND_MKNOD} when all
2102shell commands have been configured.
2103
2104@subheading PROGRAMMING INFORMATION:
2105
2106@findex rtems_shell_rtems_main_mknod
2107
2108The @code{mknod} command is implemented by a C language function which
2109has the following prototype:
2110
2111@example
2112int rtems_shell_rtems_main_mknod(
2113  int    argc,
2114  char **argv
2115);
2116@end example
2117
2118The configuration structure for the @code{mknod} has the following
2119prototype:
2120
2121@example
2122extern rtems_shell_cmd_t rtems_shell_MKNOD_Command;
2123@end example
2124
2125@subheading ORIGIN:
2126
2127The implementation and portions of the documentation for this command
2128are from NetBSD 4.0.
2129
2130@c
2131@c
2132@c
2133@page
2134@subsection mkrfs - format RFS file system
2135
2136@pgindex mkrfs
2137
2138@subheading SYNOPSYS:
2139
2140@example
2141mkrfs [-vsbiIo] device
2142@end example
2143
2144@subheading DESCRIPTION:
2145
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.
2149
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.
2154
2155The following options are provided:
2156
2157@table @b
2158@item -v
2159Display configuration and progress of the format.
2160
2161@item -s
2162Set the block size in bytes.
2163
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.
2167
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.
2171
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.
2176
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
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
2194The following is an example of how to use @code{mkrfs}:
2195
2196@example
2197SHLL [/] $ mkrfs /dev/fdda
2198@end example
2199
2200@subheading CONFIGURATION:
2201
2202@findex CONFIGURE_SHELL_NO_COMMAND_MKRFS
2203@findex CONFIGURE_SHELL_COMMAND_MKRFS
2204
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.
2209
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.
2213
2214@subheading PROGRAMMING INFORMATION:
2215
2216@findex rtems_shell_rtems_main_mkrfs
2217
2218The @code{mkrfs} command is implemented by a C language function which
2219has the following prototype:
2220
2221@example
2222int rtems_shell_rtems_main_mkrfs(
2223  int    argc,
2224  char **argv
2225);
2226@end example
2227
2228The configuration structure for @code{mkrfs} has the following
2229prototype:
2230
2231@example
2232extern rtems_shell_cmd_t rtems_shell_MKRFS_Command;
2233@end example
2234
2235@c
2236@c
2237@c
2238@page
2239@subsection mount - mount disk
2240
2241@pgindex mount
2242
2243@subheading SYNOPSYS:
2244
2245@example
2246mount [-t fstype] [-r] [-L] device path
2247@end example
2248
2249@subheading DESCRIPTION:
2250
2251The @code{mount} command will mount a block device to a mount point
2252using the specified file system. The files systems are:
2253
2254@itemize @bullet
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
2261
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.
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
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.
2280
2281@subheading EXAMPLES:
2282
2283Mount the Flash Disk driver to the '/fd' mount point:
2284
2285@example
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
2305@end example
2306
2307@subheading CONFIGURATION:
2308
2309@findex CONFIGURE_SHELL_NO_COMMAND_MOUNT
2310@findex CONFIGURE_SHELL_COMMAND_MOUNT
2311
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.
2316
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
2344
2345@subheading PROGRAMMING INFORMATION:
2346
2347@findex rtems_shell_rtems_main_mount
2348
2349The @code{mount} is implemented by a C language function
2350which has the following prototype:
2351
2352@example
2353int rtems_shell_rtems_main_mount(
2354  int    argc,
2355  char **argv
2356);
2357@end example
2358
2359The configuration structure for the @code{mount} has the
2360following prototype:
2361
2362@example
2363extern rtems_shell_cmd_t rtems_shell_MOUNT_Command;
2364@end example
2365
2366@c
2367@c
2368@c
2369@page
2370@subsection mv - move files
2371
2372@pgindex mv
2373
2374@subheading SYNOPSYS:
2375
2376@example
2377mv [-fiv] source_file target_file
2378mv [-fiv] source_file... target_file
2379@end example
2380
2381@subheading DESCRIPTION:
2382
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.
2387
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.
2393
2394The following options are available:
2395
2396@table @b
2397@item -f
2398Do not prompt for confirmation before overwriting the destination
2399path.
2400
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.
2405
2406@item -v
2407Cause mv to be verbose, showing files as they are processed.
2408
2409@end table
2410
2411The last of any -f or -i options is the one which affects mv's
2412behavior.
2413
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
2433
2434@subheading EXIT STATUS:
2435
2436The @code{mv} utility exits 0 on success, and >0 if an error occurs.
2437
2438@subheading NOTES:
2439
2440NONE
2441
2442@subheading EXAMPLES:
2443
2444@example
2445SHLL [/] mv /dev/console /dev/con1
2446@end example
2447
2448@subheading CONFIGURATION:
2449
2450@findex CONFIGURE_SHELL_NO_COMMAND_MV
2451@findex CONFIGURE_SHELL_COMMAND_MV
2452
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.
2456
2457This command can be excluded from the shell command set by
2458defining @code{CONFIGURE_SHELL_NO_COMMAND_MV} when all
2459shell commands have been configured.
2460
2461@subheading PROGRAMMING INFORMATION:
2462
2463@findex rtems_shell_main_mv
2464
2465The @code{mv} command is implemented by a C language function which
2466has the following prototype:
2467
2468@example
2469int rtems_shell_main_mv(
2470  int    argc,
2471  char **argv
2472);
2473@end example
2474
2475The configuration structure for the @code{mv} has the
2476following prototype:
2477
2478@example
2479extern rtems_shell_cmd_t rtems_shell_MV_Command;
2480@end example
2481
2482@subheading ORIGIN:
2483
2484The implementation and portions of the documentation for this command
2485are from NetBSD 4.0.
2486
2487@c
2488@c
2489@c
2490@page
2491@subsection pwd - print work directory
2492
2493@pgindex pwd
2494
2495@subheading SYNOPSYS:
2496
2497@example
2498pwd
2499@end example
2500
2501@subheading DESCRIPTION:
2502
2503This command prints the fully qualified filename of the current
2504working directory.
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
2516The following is an example of how to use @code{pwd}:
2517
2518@example
2519SHLL [/] $ pwd
2520/
2521SHLL [/] $ cd dev
2522SHLL [/dev] $ pwd
2523/dev
2524@end example
2525
2526@subheading CONFIGURATION:
2527
2528@findex CONFIGURE_SHELL_NO_COMMAND_PWD
2529@findex CONFIGURE_SHELL_COMMAND_PWD
2530
2531This command is included in the default shell command set.
2532When building a custom command set, define
2533@code{CONFIGURE_SHELL_COMMAND_PWD} to have this
2534command included.
2535
2536This command can be excluded from the shell command set by
2537defining @code{CONFIGURE_SHELL_NO_COMMAND_PWD} when all
2538shell commands have been configured.
2539
2540@subheading PROGRAMMING INFORMATION:
2541
2542@findex rtems_shell_rtems_main_pwd
2543
2544The @code{pwd} is implemented by a C language function
2545which has the following prototype:
2546
2547@example
2548int rtems_shell_rtems_main_pwd(
2549  int    argc,
2550  char **argv
2551);
2552@end example
2553
2554The configuration structure for the @code{pwd} has the
2555following prototype:
2556
2557@example
2558extern rtems_shell_cmd_t rtems_shell_PWD_Command;
2559@end example
2560
2561@c
2562@c
2563@c
2564@page
2565@subsection rmdir - remove empty directories
2566
2567@pgindex rmdir
2568
2569@subheading SYNOPSYS:
2570
2571@example
2572rmdir  [dir1 .. dirN]
2573@end example
2574
2575@subheading DESCRIPTION:
2576
2577This command removes the specified set of directories.  If no
2578directories are provided on the command line, no actions are taken.
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
2586This command is a implemented using the @code{rmdir(2)} system
2587call and all reasons that call may fail apply to this command.
2588
2589@subheading EXAMPLES:
2590
2591The following is an example of how to use @code{rmdir}:
2592
2593@example
2594SHLL [/] # mkdir joeldir
2595SHLL [/] # rmdir joeldir
2596SHLL [/] # ls joeldir
2597joeldir: No such file or directory.
2598@end example
2599
2600@subheading CONFIGURATION:
2601
2602@findex CONFIGURE_SHELL_NO_COMMAND_RMDIR
2603@findex CONFIGURE_SHELL_COMMAND_RMDIR
2604
2605This command is included in the default shell command set.
2606When building a custom command set, define
2607@code{CONFIGURE_SHELL_COMMAND_RMDIR} to have this
2608command included.
2609
2610This command can be excluded from the shell command set by
2611defining @code{CONFIGURE_SHELL_NO_COMMAND_RMDIR} when all
2612shell commands have been configured.
2613
2614@subheading PROGRAMMING INFORMATION:
2615
2616@findex rtems_shell_rtems_main_rmdir
2617
2618The @code{rmdir} is implemented by a C language function
2619which has the following prototype:
2620
2621@example
2622int rtems_shell_rtems_main_rmdir(
2623  int    argc,
2624  char **argv
2625);
2626@end example
2627
2628The configuration structure for the @code{rmdir} has the
2629following prototype:
2630
2631@example
2632extern rtems_shell_cmd_t rtems_shell_RMDIR_Command;
2633@end example
2634
2635@c
2636@c
2637@c
2638@page
2639@subsection rm - remove files
2640
2641@pgindex rm
2642
2643@subheading SYNOPSYS:
2644
2645@example
2646rm file1 [file2 ... fileN]
2647@end example
2648
2649@subheading DESCRIPTION:
2650
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.
2660
2661@subheading EXIT STATUS:
2662
2663This command returns 0 on success and non-zero if an error is encountered.
2664
2665@subheading NOTES:
2666
2667NONE
2668
2669@subheading EXAMPLES:
2670
2671The following is an example of how to use @code{rm}:
2672
2673@example
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
2682@end example
2683
2684@subheading CONFIGURATION:
2685
2686@findex CONFIGURE_SHELL_NO_COMMAND_RM
2687@findex CONFIGURE_SHELL_COMMAND_RM
2688
2689This command is included in the default shell command set.
2690When building a custom command set, define
2691@code{CONFIGURE_SHELL_COMMAND_RM} to have this
2692command included.
2693
2694This command can be excluded from the shell command set by
2695defining @code{CONFIGURE_SHELL_NO_COMMAND_RM} when all
2696shell commands have been configured.
2697
2698@subheading PROGRAMMING INFORMATION:
2699
2700@findex rtems_shell_main_rm
2701
2702The @code{rm} is implemented by a C language function
2703which has the following prototype:
2704
2705@example
2706int rtems_shell_main_rm(
2707  int    argc,
2708  char **argv
2709);
2710@end example
2711
2712The configuration structure for the @code{rm} has the
2713following prototype:
2714
2715@example
2716extern rtems_shell_cmd_t rtems_shell_RM_Command;
2717@end example
2718
2719@c
2720@c
2721@c
2722@page
2723@subsection umask - set file mode creation mask
2724
2725@pgindex umask
2726
2727@subheading SYNOPSYS:
2728
2729@example
2730umask [new_umask]
2731@end example
2732
2733@subheading DESCRIPTION:
2734
2735This command sets the user file creation mask to @code{new_umask}.  The
2736argument @code{new_umask} may be octal, hexadecimal, or decimal.
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
2744This command does not currently support symbolic mode masks.
2745
2746@subheading EXAMPLES:
2747
2748The following is an example of how to use @code{umask}:
2749
2750@example
2751SHLL [/] $ umask
2752022
2753SHLL [/] $ umask 0666
27540666
2755SHLL [/] $ umask
27560666
2757@end example
2758
2759@subheading CONFIGURATION:
2760
2761@findex CONFIGURE_SHELL_NO_COMMAND_UMASK
2762@findex CONFIGURE_SHELL_COMMAND_UMASK
2763
2764This command is included in the default shell command set.
2765When building a custom command set, define
2766@code{CONFIGURE_SHELL_COMMAND_UMASK} to have this
2767command included.
2768
2769This command can be excluded from the shell command set by
2770defining @code{CONFIGURE_SHELL_NO_COMMAND_UMASK} when all
2771shell commands have been configured.
2772
2773@subheading PROGRAMMING INFORMATION:
2774
2775@findex rtems_shell_rtems_main_umask
2776
2777The @code{umask} is implemented by a C language function
2778which has the following prototype:
2779
2780@example
2781int rtems_shell_rtems_main_umask(
2782  int    argc,
2783  char **argv
2784);
2785@end example
2786
2787The configuration structure for the @code{umask} has the
2788following prototype:
2789
2790@example
2791extern rtems_shell_cmd_t rtems_shell_UMASK_Command;
2792@end example
2793
2794@c
2795@c
2796@c
2797@page
2798@subsection unmount - unmount disk
2799
2800@pgindex unmount
2801
2802@subheading SYNOPSYS:
2803
2804@example
2805unmount path
2806@end example
2807
2808@subheading DESCRIPTION:
2809
2810This command unmounts the device at the specified @code{path}.
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
2818TBD - Surely there must be some warnings to go here.
2819
2820@subheading EXAMPLES:
2821
2822The following is an example of how to use @code{unmount}:
2823
2824@example
2825EXAMPLE_TBD
2826@end example
2827
2828@subheading CONFIGURATION:
2829
2830@findex CONFIGURE_SHELL_NO_COMMAND_UNMOUNT
2831@findex CONFIGURE_SHELL_COMMAND_UNMOUNT
2832
2833This command is included in the default shell command set.
2834When building a custom command set, define
2835@code{CONFIGURE_SHELL_COMMAND_UNMOUNT} to have this
2836command included.
2837
2838This command can be excluded from the shell command set by
2839defining @code{CONFIGURE_SHELL_NO_COMMAND_UNMOUNT} when all
2840shell commands have been configured.
2841
2842@subheading PROGRAMMING INFORMATION:
2843
2844@findex rtems_shell_rtems_main_unmount
2845
2846The @code{unmount} is implemented by a C language function
2847which has the following prototype:
2848
2849@example
2850int rtems_shell_rtems_main_unmount(
2851  int    argc,
2852  char **argv
2853);
2854@end example
2855
2856The configuration structure for the @code{unmount} has the
2857following prototype:
2858
2859@example
2860extern rtems_shell_cmd_t rtems_shell_UNMOUNT_Command;
2861@end example
Note: See TracBrowser for help on using the repository browser.