Supporto Operativo Linux/Windows — Cheat Sheet

Tags: linux, windows, troubleshooting, bash, powershell, sysadmin, support

Level: intermediate

TL;DR: Quick reference for cross-platform OS administration, focusing on service management, log analysis, permissions, and network troubleshooting.

Key concepts

Process Management: Windows uses Task Manager and tasklist; Linux relies on top, htop, and ps.

Service Control: Windows Services (services.msc / PowerShell) vs. Linux Systemd (systemctl).

File System & Permissions: Linux uses POSIX permissions (chmod, chown, ACLs) and is case-sensitive. Windows uses NTFS permissions (ICACLS) and is generally case-insensitive.

Log Management: Windows uses Event Viewer (Application, Security, System). Linux stores plain text logs primarily in /var/log/ (e.g., syslog, auth.log, messages) or via journalctl.

Package Management: Windows uses MSI, Winget, or Chocolatey. Linux uses APT (Debian/Ubuntu), YUM/DNF (RedHat/CentOS), or Pacman (Arch).

Network Configuration: Windows relies on the Registry and Network and Sharing Center (ipconfig). Linux uses configuration files like /etc/network/interfaces or NetworkManager (ip addr).

Typical questions and ready answers

Q: How do you troubleshoot a server that is suddenly responding slowly?R: I first check CPU and memory usage using top/htop on Linux or Task Manager/Resource Monitor on Windows. Then I check disk I/O and network traffic to isolate the bottleneck before reviewing system logs for hardware or application errors.

Q: How do you find which process is listening on a specific port?R: On Linux, I use ss -tulpn or netstat -tulpn | grep <port>. On Windows, I use netstat -ano | findstr <port> and map the PID to the task list.

Q: How do you handle a forgotten root or administrator password?R: For Linux, I boot into single-user mode or use a live CD to chroot and run passwd. For Windows, I use tools like DaRT or boot from installation media to replace sethc.exe with cmd.exe to reset it via command line.

Pitfalls and common mistakes

Assuming case insensitivity on Linux when copying scripts or file paths from Windows environments.

Messing up line endings (CRLF vs LF) when transferring bash scripts edited in Notepad to a Linux server, causing syntax errors (\r command not found).

Applying recursive chmod 777 on Linux to fix a permission issue instead of properly configuring groups and ACLs.

Ignoring Event Viewer in Windows and assuming a service failed silently; always check the System and Application logs.

Snippets and commands

# LINUX: Find large files consuming disk space
find / -type f -size +500M -exec ls -lh {} \; | awk '{ print $9 ": " $5 }'

# LINUX: Check systemd journal logs for a specific service
journalctl -u nginx.service --since today --no-pager

# LINUX: Check listening ports
ss -tulpn

PowerShell

# WINDOWS: Find stopped services set to automatic
Get-WmiObject Win32_Service | Where-Object { $_.StartMode -eq 'Auto' -and $_.State -ne 'Running' }

# WINDOWS: Search Event Viewer for recent errors
Get-EventLog -LogName System -EntryType Error -Newest 20

# WINDOWS: Check listening ports and associated PIDs
netstat -ano | Select-String "LISTENING"

To review

[ ] Active Directory group policy application troubleshooting (gpresult).

[ ] Linux iptables and firewalld rule syntax.

[ ] Windows PowerShell Remoting (WinRM) configuration.

Jarvis Interviews
Jarvis