NerdyHearn
Home
Blog

Contact
Mailing List

Software

Active Directory Products
Object Compare
Permission Compare

IPhone Products
Calls To Calendar
SMS To CSV
SMS To Gmail
Voicemail To Gmail

Sites
How Long For Me
SaveMySerials

Blog
Twitter

NerdyHearn - Blog


<< Back To All Blogs

Some Useful Powershell commands for the Linux nerds out there

Tuesday, June 23rd, 2015

I often find myself looking for a few commands I drastically miss from linux in the Windows world. Pretty basic but here they are listed by their equal parts between Linux and Windows Powershell.

Note: Below I reference gc which is an alias for Get-Content. They can be interchanged.

Linux: tail -f:
Powershell: gc C:file.txt -Wait

Linux: tail -n10 file.txt
Powershell: gc file.txt | Select -last 10

Linux: head -n10 file.txt
Powershell: gc file.txt | select -first 10

Linux: grep
Powershell: Select-String -Pattern my.pattern

Linux: wc -l file.txt
Powershell: gc file.txt | Measure-Object -Line

Linux: ps
Powershell: get-process

Linux: kill app.exe
Powershell: get-process app.exe | StopProcess

That's all for now!

Tom

Tags

PowerShell Howto

Related Blogs

Recursively removing SVN bindings with PowerShell
Current file path in custom PowerShell Cmdlet
Uninstalling PowerShell V1.0 from Windows Server 2003
Determine Forest and Domain Functional Levels in Powershell
Programatically Retrieving an Assembly's PublicKeyToken through a PowerShell CmdLet

Comments

Currently no comments.

Add A Comment

Name:


URL:


Email Address: (not public, used to send notifications on further comments)


Comments:



Enter the text above, except for the 1st and last character:


NerdyHearn - Latest tech news relating to C#, ASP.NET, SharePoint, PHP, general development, and more. SaveMySerials - Protect yourself from theft, fire, natural disasters and more by recording your serial numbers