Is there anything like bash shell in Windows with at least basic set of frequently used commands like ls, pwd, tail, etc?
Cygwin will allow you to run a Bash shell (apart from many other POSIX environment software) under Windows.
There is also SFU (services for UNIX), or nowadays SUA (subsystem for UNIX based applications), which is (at least the latter) a POSIX compatiblity layer including a UNIX VFS and many common UNIX tools, like, to answer your question, a Korn shell.
It's not bash compatible, but if you haven't used it yet, you should really check out Powershell. pwd
and ls
are built in aliases already. They do essentially the same thing as their *NIX counterpart, only instead of returning a string, they return .NET objects.
pwd
, returns a PathInfo object, so if you want the current drive name, just run:
(pwd).Drive
ls
returns an array of DirectoryInfo and FileInfo objects, so listing last access time is simply:
ls | select LastAccessTime
Or append the current time to every .log file in a directory structure:
(ls . -Include *.txt -Recurse).AppendText([DateTime]::Now)
For tail
functionality, try cat -wait
. Or else take a look at this script which gives somewhat closer functionality.
Msys should also be mentioned. It is a rather good set of all the important GNU tools for Windows, including bash. It also makes it possible to run the tools from the normal windows CMD-prompt. So if you use CMD from time to time you still have the usual tools like ls
and grep
available. It also feels more lightweight than Cygwin, at least to me.
As mentioned by almost everyone Cygwin is pretty good, although it's a little on the "heavy" side. If you're looking for something lighter, check out MinGW (and MSYS).
Unxutils is a set of standalone unix utilities that run on windows. You could take a look at it and see if it offers the things you need. This is nice because you don't need a full install of cygwin.
You can download all the packages, or just the commands you want. Add the directory you put them in to your path. Then the usual unix commands work (ls, grep, tail, etc.) work at the DOS prompt.
Perhaps you could try Windows PowerShell. This solution is inspired by bash and has many advantages over it, including .NET support and the sole fact this is a native Microsoft solution.
All basic commands are present and you can easily configure your own aliases.
http://www.microsoft.com/windowsserver2003/technologies/management/powershell/default.mspx