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
DocuTerminal
How Long For Me
My Music To Me
SaveMySerials
TypeCount

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

Current file path in custom PowerShell Cmdlet
Using Remote Powershell
Programatically Retrieving an Assembly's PublicKeyToken through a PowerShell CmdLet
Determine Forest and Domain Functional Levels in Powershell
Customizing PowerShell for faster development with a default profile

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. DocuTerminal - Online Filing Cabinet solution. Scan, search and archive your paper documents. SaveMySerials - Protect yourself from theft, fire, natural disasters and more by recording your serial numbers My Music To Me - Stream your subsonic music collection to your Sonos wireless system TypeCount - Count how often you type across different computers! ServrTrackr - Monitor your SSL certificates, website uptime, and DNS configurations