You are on page 1of 17

Chapter Three

Dos Command line


Prepared by mussie.A

December 2016

Long ago, before operating systems with


graphical user interfaces (GUIs), everyone used
command line interfaces (CLIs). For example,
instead of starting a program by clicking the
icon for your program in the Launchpad, you
instead typed the name of your program. And
instead of clicking on menus in your program to
adjust settings, open files, etc, you could
specify these things as command line
arguments.

Some special use of keyboard


For accessing the previous and latest use the up
and down arrow in the keyboard.
Press Home and End to jump to the beginning
and end the cursor.
Use Tab for completing or looking what directory
inside your directory.
After you finish your command hit Enter to
execute the command.

To change directory
C:\Users\Mussie.A\Desktop>cd psedocode
Cd(change directory).
C:\Users\Mussie.A\Desktop\psedocode>
To change Root directory/driver
C:\Users\Mussie.A\Desktop>d:
D:\>
C:\>cd users
C:\Users>cd mussie.a/desktop
C:\Users\Mussie.A\Desktop>
Note that: use dir /? For more help on directory.

To return back
C:\Users\Mussie.A\Desktop\psedocode>cd..
Hit enter
C:\Users\Mussie.A\Desktop>
C:\Users\Mussie.A\Desktop>cd../..
C:\Users>cd mussie.a/desktop
C:\Users>Mussie.A\Desktop>cd../../..
C:\>

How to open and delete files


First go to the directory that contain the file and write the
file name with extension.
C:\Users\Mussie.A\Desktop\psedocode>c++.pdf
C:\Users\Mussie.A\Desktop\psedocode>Chap05timer and
counter.pdf
'Chap05timer' is not recognized as an internal or external
command,
operable program or batch file.
The above program is not correct form because it
considered as multiple file, use by inserting it to double
quotation.

C:\Users\Mussie.A\Desktop\psedocode>"Chap05timer
and counter.pdf"
C:\Users\Mussie.A\Downloads\Video>"Pseudocode
Tutorial - YouTube.mp4"
How to delete file
C:\Users\Mussie.A\Desktop\psedocode\mussie>del
practice1.txt
C:\Users\Mussie.A\Desktop\psedocode>rmdir mussie3

C:\Users\Mussie.A\Desktop\psedocode>rmdir /s mussie
mussie, Are you sure (Y/N)? y
Remove directory
Note that:Use rmdir /? For more help.

Copy and move ,delete and make files sub directory's

Make directory and copy


C:\Users\Mussie.A\Desktop\psedocode>dir muss
Volume in drive C has no label.
Volume Serial Number is B45A-C961
Directory of C:\Users\Mussie.A\Desktop\psedocode\muss
12/19/2016 04:04 PM <DIR>
.
12/19/2016 04:04 PM <DIR>
..
12/06/2016 08:24 AM
10,829,969 C++.pdf
12/19/2016 04:02 PM <DIR>
nemuss
12/19/2016 04:04 PM
28 practice1.txt
2 File(s) 10,829,997 bytes
3 Dir(s) 70,478,823,424 bytes free

C:\Users\Mussie.A\Desktop\psedocode\muss>dir
Volume in drive C has no label.
Volume Serial Number is B45A-C961
Directory of C:\Users\Mussie.A\Desktop\psedocode\muss
12/19/2016 04:04 PM <DIR>
.
12/19/2016 04:04 PM <DIR>
..
12/06/2016 08:24 AM
10,829,969 C++.pdf
12/19/2016 04:02 PM <DIR>
nemuss
12/19/2016 04:04 PM
28 practice1.txt
2 File(s) 10,829,997 bytes
3 Dir(s) 70,479,405,056 bytes free

C:\Users\Mussie.A\Desktop\psedocode\muss>cd..
C:\Users\Mussie.A\Desktop\psedocode>copy muss mussie
muss\C++.pdf
muss\practice1.txt
muss\practice2.txt
3 file(s) copied.
C:\Users\Mussie.A\Desktop\psedocode>mkdir
mussie1
Mk stands for make
directory

C:\Users\Mussie.A\Desktop\psedocode>xcopy muss mussie1 /s


muss\C++.pdf
muss\practice1.txt
muss\practice2.txt
3 File(s) copied

C:\Users\Mussie.A\Desktop\psedocode>xcopy muss mussie1 /s

Overwrite
C:\Users\Mussie.A\Desktop\psedocode\mussie1\C++.pdf
(Yes/No/All)? A
muss\C++.pdf
muss\practice1.txt
muss\practice2.txt
3 File(s) copied
Note that 1.you can type y for yes, n for no and, a for all
2.Type xcopy /? To get more help

C:\Windows\system32>xcopy c:\Users\Mussie.A\desktop\psedocode N:\ /s

How to move? Use the move keyword


C:\Users\Mussie.A\Desktop\psedocode>move muss
mussie1
destination

Source

1 dir(s) moved.
C:\Users\Mussie.A\Desktop\psedocode>
How to rename
C:\Users\Mussie.A\Desktop\psedocode>rename
mussie1 mussiemussie
C:\Users\Mussie.A\Desktop\psedocode>ren mussie2
mussienew

To Hide Folder
C:\Users\Mussie.A\Desktop>Attrib +h +s +r filename
Example
C:\Users\Mussie.A\Desktop>Attrib +h +s +r psedocode
To Unhide Folder
C:\Users\Mussie.A\Desktop>Attrib -h -s -r psedocode
Example
C:\Users\Mussie.A\Desktop>Attrib -h -s -r psedocode

wildcards and the DIR


When you enter DIR you get all files in that
directory listed for you.
There are 2 wildcards that allow you to select
the files to be listed
? Replaces a single character
* replaces a number of characters

The * wildcard

DIR
DIR PA*
DIR *T
DIR A*LS

lists all files in that directory


lists all files starting with PA
lists all files ending with an T
lists all files starting with an A
and ending with an LS
DIR *.PPT lists all files with a .PPT
extension
DIR *T.*
lists all files where the last letter
of the file name (not the ext) is T

The ? wildcard
The ? replaces a single character
DIR PALETTE???.BMP lists all files that
start with PALETTE, then any 3
characters, then BMP
DIR PALETTE ??.BMP lists all files
starting with Palette[space], then any 2
characters, then BMP.
What happens if you try it without the
quotes?

End of chapter three


If u have any question before Ur
final exam UR well come ask me.
You can use my contact number
+251938778582
and my email Id
mussiemussie4@gmail.com
10 Q!!!!!!!!!!!!

You might also like