Friday, October 28, 2011

Dir command


Dir command

Used to display the contents of a directory to the screen.
Way of writing:
dir [drive:] [path] [file what will be in-listings] [/ p] [/ w] [/ a]
[Drive:]: Displays a list (listing) the contents of files in the drive.
[Path]: Displays a list (listing) the contents of files in the path.
[File what will be dilisting]:
Determination of what files are in-listing can use wildcard characters (? & *).
: Any one character
*: All characters
Example:
? Oba.txt: All files beginning with any letter, provided followed oba.txt
try .*: All files with the extension named try anything.
[/ P] [/ w]: Appearances dilisting file on the screen.
[/ P]: displayed per page (per screen),
[/ W]: displayed sideways, direct the entire file.
[/ A]: All files, including files with hidden attributes, is shown.
Steps of use:
1. Type the command dir to be used in the command prompt.
2. Press enter.

3. Listing files in directory will be visible on the screen.
Exercise:
Melisting all non-hidden files that are in C.
C: \> dir <enter>
C: \> dir / p <enter>
C: \> dir / w <enter>
C: \> dir *.* <enter>
C: \> dir / p / w <enter>
Melisting all files (including hidden) the long name is 3 and is in C.
C: \> dir ???.* / p / w / a <enter>

6. Command md / mkdir
Used to create a directory.
Way of writing:
md [path] nama_directory
mkdir [path] nama_directory
Steps of use:
1. Type md or mkdir command to be used in the command prompt.
2. Press enter.

Exercise:
md data <enter>
mkdir program <enter>
md other <enter>
mkdir data \ databaru <enter>
md data \ datalama <enter>
md program \ program1 <enter>
md program \ program2 <enter>
md program \ program3 <enter>

7. The command cd / chdir
Used to move from one directory to another directory.
Way of writing:
cd [[path] nama_directory]
chdir [[path] nama_directory]
Nama_directory can be replaced with:
Nama_directory the currently active (the user is) now.
Nama_directory where the current directory is located.
Steps of use:
1. Type cd or chdir command to be used in the command prompt.
2. Press enter.
Exercise:
cd data <enter>
cd databaru <enter>
cd .. \ .. \ other <enter>
cd .. <enter>
cd program <enter>
cd .. \ <enter>
8. Command rd / rmdir
Used to delete the directory.
Way of writing:
rd [path] nama_directory
rmdir [path] nama_directory
Steps of use:
1. Type the rd or rmdir command to be used in the command prompt.
2. Press enter.
Exercise:
rd program \ program1 <enter>
rmdir programs \ program3 <enter>
9. Command copy con
Used to create the file.
Way of writing:
copy con [drive:] [path] filename
Steps of use:
1. Type copy con filename in the command prompt.
2. Press enter.
3. Cursor will appear where the user can type the contents of the file.
4. Type the contents of the file through to completion.
5. When finished, press Ctrl + Z. Will show "1 file (s) copied" on the screen. This means the file has been formed.
Exercise:
copy the data con \ datalama \ coba1.txt <enter>
Hello <enter>
This file doang <Ctrl+Z> <enter> trial
copy the data con \ datalama \ coba2.txt <enter>
Hello again <enter>
This file laen lagimestinya <enter>
<Ctrl+Z> <enter>
                   
10. Command redirection (>, <,>>, <<)
Used to release the results to a file.
Way of writing:
perintah_DOS operator_redirection [drive:] [path] filename
 Redirection operator:
o A> B: A result is inserted into the B.
o A <B: A receives input from B.
o A>> B: A result is added to B.
o A <<B: A receives additional input from B.
Steps of use:
1. Type the command in the command prompt.
2. Press enter.
Exercise:
dir / w> Data \ datalama \ isi_w.txt <enter>
data dir \ datalama \ c *. txt> data \ datalama \ isi_c.txt <enter>
data dir \ *.*> Data \ datalama \ isi_a.txt <enter>
program dir \ *.*>> Data \ datalama \ isi_a.txt <enter>
11. Type the command
Used to display the file contents to the screen.
Way of writing:
type [drive:] [path] filename
Steps of use:
1. Type the command type that you want to use the command prompt.
2. Press enter.
Exercise:
data type \ datalama \ isi_a.txt <enter>
data type \ datalama \ coba2.txt <enter>
12. The copy command
Used to copy the contents of one file into another file.
Way of writing:
copy [drive:] [path] nama_file_asal [drive:] [path] nama_file_tujuan
Steps of use:
1. Type you want to use the copy command at a command prompt.
2. Press enter.
Exercise:
copy data \ datalama \ isi_a.txt data \ datalama \ isi_all.txt <enter>
copy data \ datalama \ isi_a.txt data \ databaru \ isi_a.txt <enter>
copy data \ datalama \ data \ isi_lama <enter>

1 comments:

Post a Comment