Zum Hauptinhalt springen
Echtzeit-Radar & Feeds
Alle RSS Feeds ➔
👥 Community & Social
Windows Tipps & SecurityGrafikkarte vor Überhitzung schützen: So geht’s(25.09.2026 um 08:00 Uhr)
••••••••••
Windows Tipps & SecurityGrafikkarte vor Überhitzung schützen: So geht’s(25.09.2026 um 08:00 Uhr)
••••••••••
Intelligence View
⚡ tsecurity.de Intelligence

50 GNU Commands X 50 PowerShell Commands

🐂 🆚 ✴️ Everyday terminal commands used in GNU and their PowerShell equivalents. In the world of task automation, mastering the command line is an essential skill. Whether using traditional GNU commands or navigating the Windows ecosyst…

0
↗ Quelle (dev.to)
Reagiere als Erste:r — dein Feedback zählt!




🐂 🆚 ✴️ Everyday terminal commands used in GNU and their PowerShell equivalents.






In the world of task automation, mastering the command line is an essential skill. Whether using traditional GNU commands or navigating the Windows ecosystem with the powerful PowerShell, knowing the right tools can transform your productivity.



In this post, we’ll compare 50 GNU commands with their PowerShell equivalents.









💻 01. Delete a Directory Recursively






🐂 GNU






rm -rf /home/$USER/folder  









✴️ PowerShell






Remove-Item -Path "C:\folder" -Recurse -Force  












💻 02. Get the Name of a Running Process






🐂 GNU






ps aux | grep apache2 # httpd  







systemd: systemctl status apache2







✴️ PowerShell






Get-Service | Where-Object { $_.DisplayName -like "*Apache*" }  












💻 03. Stop a Service






sudo kill -9 $(pidof apache2) # httpd  







systemd: sudo systemctl stop apache2







✴️ PowerShell






Stop-Service -Name "Apache2.4"  












💻 04. Remove an Environment Variable






🐂 GNU






unset VARIABLE_NAME  









✴️ PowerShell C:\App\bin






# Get the current value of the system Path environment variable  
$envPath = [Environment]::GetEnvironmentVariable("Path", [EnvironmentVariableTarget]::Machine)

# Split paths into an array
$paths = $envPath -split ';'

# Filter to remove the unwanted path
$newPaths = $paths | Where-Object { $_ -ne "C:\App\bin" }

# Rebuild the Path environment variable (without the unwanted path)
$newPathString = ($newPaths -join ';').TrimEnd(';')

# Update the system environment variable
[Environment]::SetEnvironmentVariable("Path", $newPathString, [EnvironmentVariableTarget]::Machine)












💻 05. Check if a Command Exists






🐂 GNU






which mycommand  









✴️ PowerShell






Get-Command mycommand  












💻 06. Create a Folder/Directory






🐂 GNU






mkdir my-project  









✴️ PowerShell






New-Item -ItemType Directory "MyProject"  












💻 07. Create a Folder/Directory Recursively






🐂 GNU






mkdir -p my-project/folder/new  









✴️ PowerShell






New-Item -Path "C:/MyProject/folder/new" -ItemType Directory  












💻 08. Move a Folder/Directory






🐂 GNU






mv folder new/path/  









💻 PowerShell






Move-Item -Path "folder" -Destination "C:\new\path\"  












💻 09. Enter a Folder/Directory






🐂 GNU






cd folder/  









✴️ PowerShell






Set-Location folder  












💻 10. Copy Files and Directories






🐂 GNU






cp file path/to/dest  
cp -r folder/ path/to/dest









✴️ PowerShell






Copy-Item file path\to\dest  
Copy-Item folder\ -Recurse -Destination path\to\dest












💻 11. Get the Home Directory and/or Username






🐂 GNU






$HOME  
# echo $HOME

$USER
# echo $USER









✴️ PowerShell






$env:USERPROFILE  
# Write-Host $env:USERPROFILE

$env:USERNAME
# Write-Host $env:USERNAME












💻 12. List Files and Directories






🐂 GNU






ls -la  









✴️ PowerShell






Get-ChildItem -Force  












💻 13. Display Text File Content






🐂 GNU






cat file.txt  









✴️ PowerShell






Get-Content file.txt  












💻 14. Search for Text Inside Files






🐂 GNU






grep "term" file.txt  









✴️ PowerShell






Select-String -Pattern "term" -Path file.txt  












💻 15. Show Disk Usage






🐂 GNU






df -h  









✴️ PowerShell






Get-PSDrive -PSProvider FileSystem  












💻 16. Check Memory Usage






🐂 GNU






free -h  









✴️ PowerShell






Get-CimInstance Win32_OperatingSystem | Select-Object TotalVisibleMemorySize,FreePhysicalMemory  












💻 17. Display Environment Variables






🐂 GNU






printenv  









✴️ PowerShell






Get-ChildItem Env:  












💻 18. Rename File/Directory






🐂 GNU






mv oldname newname  









✴️ PowerShell






Rename-Item -Path oldname -NewName newname  












💻 19. Run Command as Administrator/Root






🐂 GNU






sudo command  









✴️ PowerShell (run shell as admin)






Start-Process powershell -Verb runAs  












💻 20. Check Network/Interfaces






🐂 GNU






ip addr show  









✴️ PowerShell






Get-NetIPAddress  












💻 21. Create an Environment Variable




Example for Terlang: C:\Program Files\Terlang\bin (Windows) and ${HOME}/.local/terlang/bin/ (GNU)







🐂 GNU






export PATH="${PATH}:${HOME}/.local/terlang/bin/"  









✴️ PowerShell






[System.Environment]::SetEnvironmentVariable("Path", $env:Path + ";C:\Program Files\Terlang\bin", [System.EnvironmentVariableTarget]::Machine)  












💻 22. Display Last Lines of a File (tail)






🐂 GNU






tail -n 20 file.log  









✴️ PowerShell






Get-Content file.log -Tail 20  












💻 23. Monitor Processes in Real-Time (top)






🐂 GNU






top  









✴️ PowerShell






Get-Process | Sort-Object CPU -Descending | Select-Object -First 10  







(not real-time, but shows a snapshot of top CPU-consuming processes)










💻 24. Find and Kill a Process by Name






🐂 GNU






pkill -f process  









✴️ PowerShell






Get-Process -Name process | Stop-Process -Force  












💻 25. Monitor File Changes (tail -f)






🐂 GNU






tail -f file.log  









✴️ PowerShell






Get-Content file.log -Wait  












💻 26. Compress Files (tar gzip)






🐂 GNU






tar -czvf archive.tar.gz folder/  









✴️ PowerShell






Compress-Archive -Path folder\* -DestinationPath archive.zip  












💻 27. Extract Zip File






🐂 GNU






unzip archive.zip  









✴️ PowerShell






Expand-Archive -Path archive.zip -DestinationPath destination\  












💻 28. View Specific Environment Variables






🐂 GNU






echo $VARIABLE  









✴️ PowerShell






$env:VARIABLE  












💻 29. Set Environment Variable for Current Session






🐂 GNU






export VARIABLE=value  









✴️ PowerShell






$env:VARIABLE="value"  












💻 30. Display System Information (kernel, OS)






🐂 GNU






uname -a  









✴️ PowerShell






Get-CimInstance Win32_OperatingSystem | Select-Object Caption, Version, OSArchitecture  












💻 31. Check Current Date and Time






🐂 GNU






date  









✴️ PowerShell






Get-Date  












💻 32. Show Logged-In Users






🐂 GNU






who  









✴️ PowerShell






query user  












💻 33. Check Open TCP Ports and Associated Processes






🐂 GNU






sudo netstat -tulpn  









✴️ PowerShell






Get-NetTCPConnection | Select-Object LocalAddress,LocalPort,OwningProcess  












💻 34. Search for Files by Name






🐂 GNU






find /path -name "file.txt"  









✴️ PowerShell






Get-ChildItem -Path C:\path -Recurse -Filter "file.txt"  












💻 35. Schedule a Task (cron / Task Scheduler)






🐂 GNU






crontab -e  









✴️ PowerShell






# Simple example to create a scheduled task via PowerShell  
$action = New-ScheduledTaskAction -Execute "notepad.exe"
$trigger = New-ScheduledTaskTrigger -At 9am -Daily
Register-ScheduledTask -TaskName "OpenNotepad" -Action $action -Trigger $trigger












💻 36. Clear Screen






🐂 GNU






clear  









✴️ PowerShell






Clear-Host  












💻 37. Show System Variables (with name and value)






🐂 GNU






env  









✴️ PowerShell






Get-ChildItem Env:  












💻 38. Compare Files Line by Line






🐂 GNU






diff file1 file2  









✴️ PowerShell






Compare-Object (Get-Content file1) (Get-Content file2)  












💻 39. Run Local Script (bash / PowerShell)






🐂 GNU






./script.sh  









✴️ PowerShell






.\script.ps1  












💻 40. Stop Command Execution (Ctrl + C)






🐂 GNU






Ctrl + C  









✴️ PowerShell






Ctrl + C  












💻 41. Get Command History for Current Session






🐂 GNU






history  









✴️ PowerShell






Get-History  












💻 42. Get File with Command History






🐂 GNU






cat ~/.bash_history  









✴️ PowerShell






Get-Content (Get-PSReadlineOption).HistorySavePath  












💻 43. Search Text in Command History






🐂 GNU






history | grep term  









✴️ PowerShell






Get-History | Where-Object CommandLine -Match "term"  












💻 44. Display Variables Defined in Current Session






🐂 GNU






set  









✴️ PowerShell






Get-Variable  












💻 45. Define Local Variable (shell/session)






🐂 GNU






VARIABLE=value  









✴️ PowerShell






$VARIABLE = "value"  












💻 46. Limit Command Output (pager)






🐂 GNU






command | less  









✴️ PowerShell






command | Out-Host -Paging  












💻 47. Define Alias (command shortcut)






🐂 GNU






alias ll='ls -la'  









✴️ PowerShell






Set-Alias ll Get-ChildItem  












💻 48. Remove Alias






🐂 GNU






unalias ll  









✴️ PowerShell






Remove-Item Alias:ll  












💻 49. Show CPU Information






🐂 GNU






lscpu  









✴️ PowerShell






Get-CimInstance Win32_Processor | Select-Object Name,NumberOfCores,NumberOfLogicalProcessors  












💻 50. Open Text Editor in Terminal






🐂 GNU






vim file.txt  









✴️ PowerShell






notepad file.txt  












🍖 Bonus:



Download a File:




  • GNU:




wget https://url.com/file.zip  
# Or: wget https://url.com/file.zip -O newname.zip







  • PowerShell:




Invoke-WebRequest -Uri "https://url.com/file.zip" -OutFile "file.zip"  









👓 See Also:






🔗 7 PowerShell Usage Examples






🔗 Discover 7 GNU Tools That Power the Command Line






🔗 10 Tips for GNU GCC Flags and Parameters






🔗 Customize Your PowerShell Like a Pro

1. Sofort-Triage & Abwehrmaßnahmen

SOC Incident Playbook: Remote Code Execution (RCE) Defense
Syntax validiert (0 Fehler)
title: Detect Exploitation - 50 GNU Commands X 50 PowerShell Commands
id: 9e7f7af9-0994-4d7d-89a4-2a8f7219465f
status: experimental
description: Automatisch generierte SIEM-Erkennungsregel basierend auf CTI Intelligence
references:
  - https://tsecurity.de/
author: iShareStuff CTI Automated Detection Engine
date: 2026-09-25
logsource:
  category: network_connection
  product: any
detection:
  selection:
      CommandLine|contains:
        - 'exploit'
  condition: selection
falsepositives:
  - Legitime administrative Zugriffe oder Penetrationstests
level: high
tags:
  - attack.initial_access
  - attack.t1059
Syntax validiert (0 Fehler)
rule CTI_Threat_Indicator {
    meta:
        author = "iShareStuff CTI Automated Detection Engine"
        date = "2026-09-25"
        description = "YARA Signature for "
    strings:
        $str = "50 GNU Commands X 50 PowerShel" ascii wide
    condition:
        any of them
}
Syntax validiert (0 Fehler)
index=security sourcetype IN ("cisco:asa", "pan:traffic", "zeek_conn", "suricata", "WinEventLog:Security")
("50 GNU Commands X 50 PowerShell Commands")
| stats count earliest(_time) as first_seen latest(_time) as last_seen by src_ip, dest_ip, dest_host, signature
| eval first_seen=strftime(first_seen, "%Y-%m-%d %H:%M:%S"), last_seen=strftime(last_seen, "%Y-%m-%d %H:%M:%S")
| sort - count
Syntax validiert (0 Fehler)
message: "*50 GNU Commands X 50 PowerShell Commands*"
Syntax validiert (0 Fehler)
CommonSecurityLog
| where Message has "50 GNU Commands X 50 PowerShell Commands"
| summarize EventCount = count(), FirstSeen = min(TimeGenerated), LastSeen = max(TimeGenerated) by SourceIP, DestinationIP, DestinationPort, Activity
| extend DetectionRule = "iShareStuff-CTI-Compiled"
| sort by EventCount desc

2. Cyber Threat Intelligence & Forensik

CTI Threat Relationship Graph4 Knoten / 3 Relationen
CVE / Incident Software MITRE ATT&CK CWE Weakness IoC
🎯
MITRE ATT&CK Matrix Navigator 14 Taktiken
Identifiziert: T1059Command and Scripting Interpreter
Reconnaissance
-
Resource Development
-
Initial Access
Execution
Persistence
-
Privilege Escalation
Defense Evasion
Credential Access
-
Discovery
-
Lateral Movement
-
Collection
-
Command and Control
Exfiltration
-
Impact
🛡️
Exploit PoC Security Sandbox & Payload Analyzer TEXT
Danger Index:45/100 CAUTION_ACTIVE_PAYLOAD
⚠️ Aktive Netzwerk- oder Speicheroperationen identifiziert.
Exploit-Parameter vor Ausführung verifizieren (Target IP / Port prüfen).
Egress-Firewall auf Ziel-IP beschränken.
Erkannte Gefahrensignaturen (1):
CRITICALDESTRUCTIVE_WIPE:Destruktiver Befehl zum Löschen von Dateisystemen oder Datenträgern.
rm -rf /
tsecurity.de Cognitive Threat RAG
Fokus-Vektor:

Kognitive Analyse für identifizierte Bedrohung: Erhöhte Bedrohungslage im Bereich 50 GNU Commands X 50 PowerShell Commands.... Basierend auf 368k Vektor-Korrelationen werden sofortige Isolationsmaßnahmen für betroffene Endpunkte empfohlen.

🛡️ Angriffsfläche & Exposure

Netzwerk/Remote-Zugriff ohne Vorauthentifizierung möglich.

⚡ Empfohlene Sofortmaßnahmen
  • 1. Perimeter-Inspektion: Relevante Portfreigaben und exponierte Endpunkte unverzüglich scannen.
  • 2. Patch-Applikation: Hersteller-Hotfix einspielen oder betroffene Daemons in isolierte DMZ-Segmente überführen.
  • 3. Telemetrie & EDR-Alerts: Prozessaufrufe und Child-Processes auf anomale Shell-Spawns überwachen.
🔗 Semantisch verwandte Zero-Days MariaDB 11.7 VEC
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten 50 GNU Commands X 50 PowerShell Commands

Thematisch verwandte Begriffe: Commands, PowerShell · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-97818 | phpIPAM through 1.8.3 has incorrect authorization for id=="admins" and i…
Advisory →
tsecurity.de Icon
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag