News for hackers. Stuff that matters.
Re:Microsoft Replaces Command Prompt with PowerShell in Late... by cableshaft on Friday November 18, 2016 @09:19AM (#12986896)
I just wrote batch files that serve as aliases for those. I type ls in my command shell and it does a dir /w behind the scenes, which makes it look more like how it looks in Linux anyway. Here are the ones I have:

* cat.bat: type %1

* clear.bat: cls

* diff.bat: fc /n /w %1 %2

* ls.bat: dir /w %1%

* pwd.bat: cd

* touch.bat: echo . >> %1

* top.bat: tasklist

All have an @echo off at the top too. Touch is a little janky, because I couldn't figure out how to actually create an empty file with nothing in it from the command prompt.

I'm actually not really a Linux person, but on Mac you kinda have to use these, so I got more used to using them than the Windows counterparts.

Re:Microsoft Replaces Command Prompt with PowerShell in Late... by ygra on Friday November 18, 2016 @09:45AM (#12987053)

    copy nul %1 >nul
to get an empty file. It's not a replacement for touch, though, as touch will do something different to existing files. Your attempt will silently overwrite the file in that case.
Re:Microsoft Replaces Command Prompt with PowerShell in Late... by jeeva on Friday November 18, 2016 @11:27AM (#12987874)
Couldn't you just append null to a given filepath to get the same result, or am I misguidedly assuming that >> creates files that don't exist?
Re:Microsoft Replaces Command Prompt with PowerShell in Late... by ygra on Friday November 18, 2016 @12:18PM (#12988301)
Interesting idea, but type nul >> file doesn't change the metadata, perhaps because nothing was written. But yes, it would at least not destroy files.
Re:Microsoft Replaces Command Prompt with PowerShell in Late... by erikbye on Friday November 18, 2016 @10:39AM (#12987455)
Re:Microsoft Replaces Command Prompt with PowerShell in Late... by Senji on Friday November 18, 2016 @11:09AM (#12987708)
You could put the @ in front of the command like so:

1 line file: @type %1