Cài vim trên windows
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
choco install vim
Download file
wget https://github.com/mrnim94/cyclops/raw/master/cyclops.exe -UseBasicParsing -O cyclops.exe
Get Env on windows container:
Get-ChildItem Env:
Open the CMD console on Windows core
You can also press the following keys simultaneously to bring up the Task Manager – Ctrl + Shift + Esc Then, as xstnc said, File -> Run New Task -> cmd/powershell
để switch sang powershell thì gõ powershell
để switch sang command line thì gõ cmd
Check Dung lượng của các folder con:
Get-ChildItem -Path "C:\path\to\folder" -Directory | Select-Object Name, @{Name="Size (MB)";Expression={(Get-ChildItem -Path $_.FullName -Recurse -File | Measure-Object -Property Length -Sum).Sum / 1MB -as [int]}} | Sort-Object NameKiểm tra memory của các process bằng Powershell
Cảm ơn Bạn Herry SRE
# Show all processes sorted by memory usage (Working Set)
Get-Process | Sort-Object WorkingSet -Descending | Format-Table -AutoSize ProcessName, @{Label="Memory(MB)";Expression={[math]::Round($_.WS/1MB,2)}}, Id, StartTime
# More detailed view with all memory metrics
Get-Process | Sort-Object WorkingSet -Descending | Format-Table ProcessName,
@{Label="WorkingSet(MB)";Expression={[math]::Round($_.WS/1MB,2)}},
@{Label="VirtualMemory(MB)";Expression={[math]::Round($_.VM/1MB,2)}},
@{Label="PagedMemory(MB)";Expression={[math]::Round($_.PM/1MB,2)}},
Id, StartTime
# Top 10 processes by memory
Get-Process | Sort-Object WorkingSet -Descending | Select-Object -First 10 | Format-Table -AutoSize
# Count how many svchost processes are running
(Get-Process svchost).Count
# See total memory consumed by all svchost processes
$svchostProcesses = Get-Process svchost
$totalMemory = ($svchostProcesses | Measure-Object WorkingSet -Sum).Sum
$totalMemoryMB = [math]::Round($totalMemory / 1MB, 2)
Write-Host "Total svchost memory: ${totalMemoryMB} MB across $($svchostProcesses.Count) processes"
# Get total memory usage stats
$processes = Get-Process
$totalMemory = ($processes | Measure-Object WorkingSet -Sum).Sum
$totalMemoryMB = [math]::Round($totalMemory / 1MB, 2)
Write-Host "Total Memory Used by All Processes: ${totalMemoryMB} MB"
Create a file on Windows by PowerShell
Create an empty file:
type nul > app.log
Create a file with content (or overwrite):
echo {"status":"active"} > config.json
Append text to a file:
echo Error: Timeout >> text.log