SSH Command in Windows with examples

Search and filter commands in Windows

Find files and text, and shape output.

#findstr / Select-String

Search for text in files

Syntaxfindstr [options] text files
  • findstr /i "error" app.logCMD

    Case-insensitive search

  • findstr /s /n "TODO" *.csCMD

    Search sub-folders and show line numbers

  • ipconfig | findstr IPv4CMD

    Filter another command's output

  • Select-String -Path *.log -Pattern "error"PowerShell

    PowerShell search

  • Get-Content app.log | Select-String "timeout"PowerShell

    Search a file's lines

#where / Get-Command

Find a program

Syntaxwhere program
  • where pythonCMD

    Prints each place the program is found

  • Get-Command pythonPowerShell

    Same in PowerShell

#find

Filter lines (simple)

Syntaxfind "text" file
  • find /c "error" app.logCMD

    Count lines containing error

#sort

Sort lines

Syntaxsort file
  • sort names.txtCMD

    Sort a file

  • dir /b | sortCMD

    Sort another command's output

  • Get-Content names.txt | Sort-ObjectPowerShell

    Sort in PowerShell

#fc / Compare-Object

Compare files

Syntaxfc file1 file2
  • fc old.txt new.txtCMD

    Show the differences

  • Compare-Object (Get-Content a.txt) (Get-Content b.txt)PowerShell

    PowerShell comparison

#Where-Object / Select-Object

Filter and pick (PowerShell)

Syntaxcommand | Where-Object {...}
  • Get-Process | Where-Object CPU -gt 100PowerShell

    Processes that used over 100 CPU seconds

  • Get-ChildItem | Sort-Object Length -Descending | Select-Object -First 10PowerShell

    The ten biggest files

#Measure-Object

Count and add up

Syntaxcommand | Measure-Object
  • Get-ChildItem | Measure-ObjectPowerShell

    How many items?

  • Get-ChildItem -File | Measure-Object Length -SumPowerShell

    Total size of the files

Run these commands with SSH Command

SSH Command is a desktop app for Mac, Windows and Linux that puts a real terminal, SFTP file panes, a sudo switch and a searchable Linux command finder in one window. Type what you want to do, and send the command to your server with one click.

Download free Linux commands with examples SFTP & FTP client