SlideShare a Scribd company logo
1 of 23
Windows CLI
(Command Line Interface)
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.
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
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
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
How to go to CLI?
• Start  Click on search
Type “cmd” in the search window
Right
click and
select
“Pin to
taskbar”
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
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…..
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
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
DOS Commands - Basic
• Cd – More options
• Cd - goes to the root drive
• Cd.. - goes back by one level
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
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
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.
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?
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
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.
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?)
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
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
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
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

More Related Content

Similar to PPT4-Windows CLI.pptx

Linux: Everyting-as-a-service
Linux: Everyting-as-a-serviceLinux: Everyting-as-a-service
Linux: Everyting-as-a-serviceRohit Sansiya
 
ITCP PRACTICAL-1.pptx
ITCP PRACTICAL-1.pptxITCP PRACTICAL-1.pptx
ITCP PRACTICAL-1.pptxHemantJadhao3
 
2. UNIX OS System Architecture easy.pptx
2. UNIX OS System Architecture easy.pptx2. UNIX OS System Architecture easy.pptx
2. UNIX OS System Architecture easy.pptxPriyadarshini648418
 
DOS - Disk Operating System
DOS - Disk Operating SystemDOS - Disk Operating System
DOS - Disk Operating SystemMeqdad Darweesh
 
Unix Shell Script - 2 Days Session.pptx
Unix Shell Script - 2 Days Session.pptxUnix Shell Script - 2 Days Session.pptx
Unix Shell Script - 2 Days Session.pptxRajesh Kumar
 
Unix _linux_fundamentals_for_hpc-_b
Unix  _linux_fundamentals_for_hpc-_bUnix  _linux_fundamentals_for_hpc-_b
Unix _linux_fundamentals_for_hpc-_bMohammad Reza Beygi
 
Linux administration training
Linux administration trainingLinux administration training
Linux administration trainingiman darabi
 
Linux operating system by Quontra Solutions
Linux operating system by Quontra SolutionsLinux operating system by Quontra Solutions
Linux operating system by Quontra SolutionsQUONTRASOLUTIONS
 
Tips and Tricks for Increased Development Efficiency
Tips and Tricks for Increased Development EfficiencyTips and Tricks for Increased Development Efficiency
Tips and Tricks for Increased Development EfficiencyOlivier Bourgeois
 
linux commands that might be helpful.pptx
linux commands that might be helpful.pptxlinux commands that might be helpful.pptx
linux commands that might be helpful.pptxMeghrajPatil11
 

Similar to PPT4-Windows CLI.pptx (20)

Linux: Everyting-as-a-service
Linux: Everyting-as-a-serviceLinux: Everyting-as-a-service
Linux: Everyting-as-a-service
 
Group13
Group13Group13
Group13
 
ITCP PRACTICAL-1.pptx
ITCP PRACTICAL-1.pptxITCP PRACTICAL-1.pptx
ITCP PRACTICAL-1.pptx
 
Linuxs1
Linuxs1Linuxs1
Linuxs1
 
2. UNIX OS System Architecture easy.pptx
2. UNIX OS System Architecture easy.pptx2. UNIX OS System Architecture easy.pptx
2. UNIX OS System Architecture easy.pptx
 
DOS - Disk Operating System
DOS - Disk Operating SystemDOS - Disk Operating System
DOS - Disk Operating System
 
Linux commands
Linux commandsLinux commands
Linux commands
 
Unix Shell Script - 2 Days Session.pptx
Unix Shell Script - 2 Days Session.pptxUnix Shell Script - 2 Days Session.pptx
Unix Shell Script - 2 Days Session.pptx
 
UNIX/Linux training
UNIX/Linux trainingUNIX/Linux training
UNIX/Linux training
 
Nithi
NithiNithi
Nithi
 
Unix _linux_fundamentals_for_hpc-_b
Unix  _linux_fundamentals_for_hpc-_bUnix  _linux_fundamentals_for_hpc-_b
Unix _linux_fundamentals_for_hpc-_b
 
Linux administration training
Linux administration trainingLinux administration training
Linux administration training
 
Linux basic
Linux basicLinux basic
Linux basic
 
Linux operating system by Quontra Solutions
Linux operating system by Quontra SolutionsLinux operating system by Quontra Solutions
Linux operating system by Quontra Solutions
 
Linux commands
Linux commandsLinux commands
Linux commands
 
Linux Basics.pptx
Linux Basics.pptxLinux Basics.pptx
Linux Basics.pptx
 
Tips and Tricks for Increased Development Efficiency
Tips and Tricks for Increased Development EfficiencyTips and Tricks for Increased Development Efficiency
Tips and Tricks for Increased Development Efficiency
 
LinuxCommands (1).pdf
LinuxCommands (1).pdfLinuxCommands (1).pdf
LinuxCommands (1).pdf
 
linux commands that might be helpful.pptx
linux commands that might be helpful.pptxlinux commands that might be helpful.pptx
linux commands that might be helpful.pptx
 
CSA-lecture 6.pptx
CSA-lecture 6.pptxCSA-lecture 6.pptx
CSA-lecture 6.pptx
 

Recently uploaded

The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 

Recently uploaded (20)

The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 

PPT4-Windows CLI.pptx

  • 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
  • 6. How to go to CLI? • Start  Click on search
  • 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