SSH Command in Windows with examples

Disk and storage commands in Windows

Check free space, find big folders and check disks.

#fsutil / Get-PSDrive

Disk free space

Syntaxfsutil volume diskfree C:
  • fsutil volume diskfree C:CMD

    Free and total bytes (administrator)

  • Get-PSDrive -PSProvider FileSystemPowerShell

    Drives with used and free space

#chkdsk

Check a disk

Syntaxchkdsk [drive] [/f]
  • chkdsk C:CMD

    Check without changing anything

  • chkdsk C: /fCMD

    Fix errors (needs a restart for the system drive)

#diskpart

Partition disks

Syntaxdiskpart
  • diskpartCMD

    Opens the partition tool

  • list diskCMD

    Inside diskpart: show disks

Carefuldiskpart can erase disks. Select the right disk with select disk N and check with list volume before you use clean or format.

#format

Format a drive

Syntaxformat drive: /fs:NTFS
  • format E: /fs:NTFS /qCMD

    Quick-format E: (erases everything on it)

#cleanmgr

Disk cleanup

Syntaxcleanmgr
  • cleanmgr /d C:CMD

    Open Disk Cleanup for C:

#Find big folders

Which folder uses the space?

SyntaxPowerShell
  • Get-ChildItem C:\Users -Directory | ForEach-Object { "{0} {1:N0} MB" -f $_.Name, ((Get-ChildItem $_.FullName -Recurse -File -ErrorAction SilentlyContinue | Measure-Object Length -Sum).Sum/1MB) }PowerShell

    Size of each user folder

#Get-Volume

Volumes

SyntaxGet-Volume
  • Get-VolumePowerShell

    Drive letters, labels, file systems and free space

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