Dos Command Prompt Tutorial
Dos Command Prompt Tutorial
Youshouldseesomethinglikethis(withouttheyellowline):
Inwindowsexplorer,ifwewishtogobacktotheAlvinfolderfromthetestfolder,wesimplypressBack.
Thecommandpromptequivalentiscd..(thatscdfollowedbytwoperiods).Ourcurrentfolderwillbe backtotheAlvinfolder(C:\DocumentsandSettings\Alvin)
OtherNoteworthyKeywordsthatyouMayNeedinthisCourse(givetheseatry): cls d: [tab] cd\ Clearsthecommandpromptofthetextyouveinputtedandtheoutputthatscurrentlyon there,makingiteasiertoread Changesthecurrentpathtotheddrive(ifitexistontheharddrive).Likewise,c:changesit tothecdrive.Thesemicolonhasmanyusesinthedoscommandprompt,justsohappensthat thedriveletter(eg.c,d,e)followedbythesemicolonchangestothatdrive/partition. Whenenteringnamesoffoldersorfiles,aftertypinginthefirstfewletters,pressingtabwill allowthedosprompttofinishtypingrestofthefilenameforyouifamatchexist.Sayifyou havea foldernamedMississippi,andyouwishtoenterit.YoumayonlyneedtotypecdMand thenbypressingtab,thecomputerwillfillouttherestofthewordandshowcdMississippifor you.Thenyoujusthavetopressentertoexecuteitandactuallygointothatfolder.This featurematchesthenameoffiles/directorieswiththefirstfewcharactersofwhatyouvejust startedtoenter,but,onlytothebestofitsabilities.Thismeansifyouhavemultiplefolders that startwithMiss,itllmatchtothefirstonethatshigherupbyalphabeticalorder. Pressingtabagainwillcyclethroughtothenextbestmatch.Thismaybearealtimesaver whencompilingprograms. Asopposedtotypingincd..multipletimestogettotheCpartition(C:),thecd\commandwill jumpyoustraightthere.
dir/w Avariationofthedircommand,inwhichthefiles/foldersaredisplayedhorizontally,leavingout mostoftheinformationthatthedircommandwouldoutput.Aneasierwaytoviewfilesofa folderthatcontainsALOToffiles. dir/p exit Note:Innewerversionsofcommandprompt,theslash/andbacklash\canbeusedinterchangeably. ButintheWindowsfilingsystem,thebackslashisthepropercharacterofuse.Also,the[tab]auto completionfeaturewasnewlyaddedinWindowsXP,takingtheideafromLinuxscommandprompt (terminal).WindowsfilingsystemisNONcasesensitive,socdTest=cdTEST=cdtest=cdtestwhen entering.MacsandLinuxfilingsystemsarehowever. CompilingaProgramintheCommandPrompt Thefirststepistonavigatetothefolderthatcontainsthefilethatyouwishtorun.Inthisexample,the pathisC:\exampleanditcontainsthefileHelloConsole.java. Anothervariationofthedircommand.TrythiswithafolderthatcontainsALOToffilesandsee theresultsforyourself(easierthanmeexplainingwhathappensandleavingyouclueless). Thisisprettyselfexplanatory