Monad cheat sheet for cmd.exe users


 Many people in windows environment are cmd.exe users. This cheat sheet will help these users to move to Monad shell easily by showing cmd.exe equivalents in Monad.


 


I will keep this blog uptodate as I discover commands for which users are struggling.


 


 


 












































CMD.EXE


Monad Equivalent


cd


set-location


cd


cd c:\temp


set-location c:\temp


cls


clear-host


cls


copy con


function copycon {


    [system.console]::in.readtoend()


}


 


 


copy con foo.txt


copycon | set-content foo.txt


dir


get-childitem


dir


dir /ad


get-childitem | where { $_.MshIsContainer }


dir | where { $_.MshIsContainer }


dir /od


get-childitem | sort-object LastWriteTime


dir | sort LastWriteTime


dir /o-d


get-childitem | sort-object LastWriteTime -desc


dir | sort LastWriteTime -desc


pushd


push-location


popd


pop-location


start .


invoke-item  .


ii .


 


Comments (5)

  1. lawty says:

    Just a little quibble… In CMD if you type "cd" all by itself (the example in the first line of your table) it shows your current directory. So, the monad equivalent would be "get-location".

  2. KeithH says:

    A shortcut for "dir /w" is:

    get-childitem | format-wide -auto

    You can also do multikey sorts so my default "dir" function in Monad is:

    function dir {

       get-childitem $args -force |

       sort @{e={$.MshIsContainer}; asc=$false},

            @{e={$
    .Name}; asc=$true}

    }

    This puts directories first, followed by files and then sorts by name which is equivalent to setting DIRCMD to /OGn.