2. CLI vs GUI
• GUI (Graphical User Interface)
• Menu-driven interface - Extremely user-friendly and hence easy to learn
• Just click mouse buttons - Can even be used by toddlers and illiterates
• Provides a pleasant visual environment – desirable feature for most users
• Easy multitasking – Open multiple windows(applications) and switch from one
to another with a simple click of the mouse
• No need to remember any complex commands
• Useful for Office applications, games, surfing the web, ATM, Household
devices (TV, Microwave, Mobile Phone) etc.
3. CLI vs GUI
• GUI Disadvantages
• Graphical information, by nature, tends to be both larger and more complex
than text-based information
• Uses more system resources
• Requires a larger size OS, Memory, Faster and efficient Graphics card
4. CLI vs GUI
• CLI (Command Line Interface)
• If you can type fast, the command line will always be faster than a keyboard
and mouse – typing speed is the only limiting factor
• For most tasks it can be a lot faster using a command line than it can be using a GUI.
• Certain tasks can be done 10 to 100 times faster (some are impossible from a GUI )
• Very flexible with the use of “switches” (options)
• Good for “expert” users - can quickly access commands
• Uses the fewest system resources
• Need to memorize the commands – learning curve is steep
• Possibility of command chaining – use pipe and other operators
• Md ccis && dir
5. CLI vs GUI
• CLI (Command Line Interface) - Advantages
• Ability to go back and look at the history and replicate it on other machine
• Repeatability of commands
• Create scripts that can be used to automate processes
• DOS scripts are used on Windows machines
• Apple scripts are used in Mac machines etc.
• Used always by experts or specialists
• Command Line Interface Applications
• System administration
• Engineering applications
• Scientific applications
7. Type “cmd” in the search window
Right
click and
select
“Pin to
taskbar”
8. Command Prompt Window
• Called “Command prompt”
• Change to D drive – Type D: and press enter
• Type md dummy and press enter. Your cursor is at D:dummy
• Command format : “command” space arguments options
9. DOS Commands - Basic
• View the contents of a directory
• Dir
• The dir command allows you to see the
available files and directories in the current directory. The dir
command also shows the last modification date and time, as well as
the file size.
• Switches - /p (page), /w (wide format), /s (subdirectory list), /a (show
files with specified attributes) ………..remember forward slash
• Multiple switches can be used on the same command…..
10. DOS Commands - Basic
• Version of MSDOS
• Ver
• Time and date commands
• Time, Date – allows you to change. Don’t do!
• Vol – shows serial number including the owner
• Help - help on commands
• Commands are NOT case sensitive
11. DOS Commands - Basic
• Create a directory
• Md or mkdir
• Md ccis
• Md D:cciscengd1
• Changing directories
• CD (Change Directory) is a command used to switch directories in MS-
DOS and the Windows command line.
• Cd
• Cd ccis
• Cd D:ccisceng
12. DOS Commands - Basic
• Cd – More options
• Cd - goes to the root drive
• Cd.. - goes back by one level
13. DOS Commands - Basic
• Echo
• Echo is used to repeat the text typed back to the screen and can be
used to send to a peripheral on the computer, such as a COM port.
• Echo I am fine - whatever is typed after “echo” appears on the console
• Used in general with redirection operators….to create files
• Send messages to peripherals
14. Redirection operators
1. command > filename
• Redirect command output to a file
Ex: dir>t1.txt
2. command >> filename
• APPEND into a file (Add at end of the file)
Ex: dir/w>>t1.txt
3. commandA | commandB
• Pipe the output from commandA into commandB
Ex: dir|more
4. commandA & commandB
• Run commandA and then run commandB
Ex: type t1.txt&dir
5. commandA && commandB
• Run commandA, if it succeeds then run commandB
Ex: type t1.txt&&dir
6. commandA || commandB
• Run commandA, if it fails then run commandB
Ex: type t1.txt||dir
7. commandA && commandB || commandC
• If commandA succeeds run commandB, if it fails commandC
Ex: echo hello&&dir||type t1.txt
15. Echo
• Echo this is my first file > resume.txt
• File resume.txt is created
• Echo I am Person >> resume.txt
• Contents are appended……contents?
• How to see the contents?
• Notepad resume.txt
• Type resume.txt
• More resume.txt
• Would display the contents of a file one page at a time. Pressing space would go to the
next page and pressing enter would go down one line at a time.
16. Deleting a file
• del
• Del a.txt dangerous command…..be careful…..may not recover once deleted
• Del *.txt
• Del ab*.bat
• Del ab?.txt
• Del *.* extremely dangerous……..delete all!!
• Can you delete a directory?
17. Deleting a directory
• Rd or rmdir
• Removes an empty directory in MS-DOS. To delete directories with files or
directories within them the user must use the deltree command
• Rd ccis - if empty ….deleted….if not?
• Rd test /s remove test directory including all subdirectories
18. Copying files
• COPY is usually used to copy one or more files from one location to
another. However, COPY can also be used to create new files. By
copying from the keyboard console (COPY CON:) to the screen, files
can be created and then saved to disk.
The first filename you enter is referred to as the source file. The
second filename you enter is referred to as the target file. If errors are
encountered during the copying process, the COPY program will
display error messages using these names.
19. Copying files
• Copy abc.doc myfile.doc - abc.txt and myfile.doc are same
• Copy a.txt + b.txt c.txt -Concatenate or Append
• Copy *.rtf d:ccisit -use wild cards
• Copy c:windows*.exe d:Bhanuimpfiles - drive to drive
• Switches - /v (verify), /b (binary files), /d(decrypt), /y(overwrite?)
20. Renaming files/directories
• Ren or rename
• Used to rename files and directories from the original name to a new name.
• Ren old_name new_name
• Ren a.txt aa.txt
• Ren *.doc *.rtf
• Ren d:Bhanuccisitaa.txt a2.txt
• Ren ccis ccit - Directories
21. Moving files
• move
• Allows you to move files or directories from one folder to another, or
from one drive to another.
• Moves one or more files to the location you specify. Can also be used
to rename directories.
• Move d:ccisa.txt d:ccisita.txt -just move
• Move d:ccisa.txt d:ccisitfile1.txt -move & rename
22. Tree command
• Allows the user to view a listing of files and folders in an easy to read
listing.
• Tree
• Tree /f - show files also
• Tree /a - graphic characters linked connecting lines
23. Attrib command
• Sets or displays the read-only, archive, system, and hidden attributes
of a file or directory.
• Attrib
• Attrib +r +s a.doc -makes the file read-only and system file
• If you use this command to specify a file as read-only, the file can be
accessed, but not altered or deleted.
• If a file has an attribute of -R, it can be both read from or written to (it
is referred to as read/write). If a file has an attribute of +R, it can be
read from, but not written to