Sunteți pe pagina 1din 2

22/03/2017 AComparisonofCommonDOSandLinuxCommands

RedHatEnterpriseLinux4:RedHatEnterpriseLinuxStepByStepGuide
Prev Next
AppendixD.AComparisonofCommonDOSandLinux
Commands
ManyLinuxcommandstypedatashellpromptaresimilartothecommandsyouwouldtypein
DOS.Infact,somecommandsareidentical.
ThisappendixprovidescommoncommandsusedattheDOSpromptinWindowsandtheir
counterpartsinLinux.BasicexamplesofhowthecommandareusedattheLinuxshellprompt
arealsoprovided.Notethatthesecommandsusuallyhaveanumberofoptions.Tolearnmore
abouteachcommand,readitsassociatedmanpage(forexample,typemanlsattheshell
prompttoreadaboutthelscommand).

Command's MSDOS Linux BasicLinuxExample


Purpose

Copiesfiles copy cp cpthisfile.txt


/home/thisdirectory

Movesfiles move mv mvthisfile.txt


/home/thisdirectory

Listsfiles dir ls ls

Clearsscreen cls clear clear

Closesshell exit exit exit


prompt

Displaysorsets date date date


date

Deletesfiles del rm rmthisfile.txt

"Echoes"output echo echo echothismessage


tothescreen

Editstextfiles edit gedit([a]) geditthisfile.txt

Comparesthe fc diff difffile1file2


contentsoffiles

Findsastringof find grep grepwordorphrasethisfile.txt


textinafile

Formatsa format mke2fs /sbin/mke2fs/dev/fd0(/dev/fd0is


diskette a:(if theLinuxequivalentofA:)
diskette
isinA:)

Displays command manor mancommand


commandhelp /? info

https://access.redhat.com/documentation/enUS/Red_Hat_Enterprise_Linux/4/html/Step_by_Step_Guide/apdoslinux.html 1/2
22/03/2017 AComparisonofCommonDOSandLinuxCommands

Command's MSDOS Linux BasicLinuxExample


Purpose

Createsa mkdir mkdir mkdirdirectory


directory

Viewscontents more less([b]) lessthisfile.txt


ofafile

Renamesafile ren mv([c]) mvthisfile.txtthatfile.txt

Displaysyour chdir pwd pwd


locationinthe
filesystem

Changes cd cd cd/directory/directory
directorieswith pathname pathname
aspecifiedpath
(absolutepath)

Changes cd.. cd.. cd..


directorieswith
arelativepath

Displaysthe time date date


time

Showsamount mem free free


ofRAMinuse

Notes:
a.GeditisagraphicaltexteditorothereditorsyoucanuseinplaceofGeditinclude
nanoandvi.
b.Themorepagercanalsobeusedtopagethroughafileonescreenatatime.
c.Themvcommandcanbothmoveafileand,ifyouwanttorenameafileinthesame
directory,"move"thatfiletothesamedirectorywithanewname.

TableD1.SimilarCommands
Prev Home Next
Applications Up SystemDirectories

https://access.redhat.com/documentation/enUS/Red_Hat_Enterprise_Linux/4/html/Step_by_Step_Guide/apdoslinux.html 2/2