Linux commands for Windows

by admin on February 13, 2012

It’s very common scenario in IT field that people who are familiar with one OS have to learn/work with another OS. I do see many people, who are familiar with Linux commands, looking for their equivalent commands in Windows OS.  Below I have attempted to list down the Windows commands for most widely used Linux commands. If I have missed any, please write in the comments section and let me know.

Ls :       The Windows equivalent one is dir.  ‘Dir‘ has many  switches to list files based on different attributes, sort the list on size or date modified etc.

Grep : Findstr is the closet matching one for grep. find is also for searching strings in files, but it does not have many options.

Adduser:  We can use net user  to manage user accounts.

Useradd: net localgroup can be used to manage user groups. Net group can be used to manage active directory (domain) groups.

Uname  : ver command shows Windows OS version.  Systeminfo shows lot of hardware and software information.
Ps  : The closest matching command is tasklist, though it’s not as feature rich as ps.

Echo : echo. Very much similar to Linux’s echo.
Md :   mkdir

rm:     Del deletes files whereas  rmdir can be used to delete directories.
Du :    du can be used to monitor the disk usage.  However, this tool is not part of Windows OS. We need to install it separately. See the link for more information.
Df   :  Net use. We can list the network shares mapped on the computer.
Mount :    Net use . Map network share to local drive
Cat    :  Type  print the contents of a text file in the console/command prompt.
Head :   there’s no equivalent command I am aware of.
Tail   :   Tail resource kit tool.
touch: Fsutil can be used to create files of require size.

I will add few more commands to the list soon…If you are searching for some specific command and do not find it here, please let me know.

{ 1 comment… read it below or add one }

Pat July 3, 2012 at 4:43 pm

http://getgnuwin32.sourceforge.net/ has a bunch of *nix commands compiled for windows and they work quite well

Reply

Leave a Comment

HTML tags are not allowed.

Previous post:

Next post: