📋 Command Reference Guide

🖥️ Select Operating System

📁 File & Directory Operations

Create Directory
Introduction: The mkdir command creates new directories (folders) in Windows. It's essential for organizing files and creating project structures.
mkdir backup mkdir "Project Files" md F:\4Born-Server-setup\logs mkdir F:\4Born-Server-setup\temp F:\4Born-Server-setup\cache
Real Example: Creates 'backup' folder, 'Project Files' with spaces, logs directory in our server path, and multiple directories at once. Use quotes when folder names contain spaces.
List Directory Contents
Introduction: The dir command displays all files and folders in the current directory. It's like opening a folder in File Explorer but from command line.
dir dir F:\4Born-Server-setup dir /a F:\4Born-Server-setup\Setup dir *.txt dir /s /b *.log
Real Example: Lists current directory, shows our server setup folder, displays hidden files with /a, finds all .txt files, and searches all .log files recursively with full paths (/s /b).
Navigate Directories
Introduction: The cd (change directory) command moves you between folders. Think of it as clicking through folders, but faster and more precise.
cd F:\4Born-Server-setup cd Setup\nginx-1.25.3 cd .. cd \ cd /d C:\Users
Real Example: Navigate to our server directory, go into nginx folder, go back one level (..), go to root (\), and change drives with /d. Current path shows in prompt.
Copy Files/Folders
Introduction: Copying creates duplicates of files or folders. Use copy for single files, xcopy for folders, and robocopy for advanced copying with progress and resume capabilities.
copy F:\4Born-Server-setup\nginx.conf F:\4Born-Server-setup\backup\ xcopy F:\4Born-Server-setup\Setup F:\backup\Setup /E /I /Y robocopy F:\4Born-Server-setup F:\backup\4Born-Server-setup /E /R:3 /W:10
Real Example: Copy nginx config to backup, copy entire Setup folder with subdirectories (/E), and use robocopy for our server folder with 3 retries (/R:3) and 10-second wait (/W:10) on errors.
Move/Rename Files
Introduction: Move transfers files to new locations (cut & paste), while rename changes file names. Unlike copy, the original file is removed from its old location.
move F:\4Born-Server-setup\temp.log F:\4Born-Server-setup\logs\ ren F:\4Born-Server-setup\nginx.conf nginx.conf.backup move F:\4Born-Server-setup\old_project F:\4Born-Server-setup\archived_projects
Real Example: Move temp.log to logs folder, rename nginx.conf to nginx.conf.backup for safety, and move old_project folder to archived_projects directory.
Delete Files/Folders
Introduction: Deletion permanently removes files and folders. Be careful! Use /q for quiet mode (no confirmation) and /s for recursive deletion of subdirectories.
del F:\4Born-Server-setup\temp\*.tmp rmdir F:\4Born-Server-setup\empty_folder rmdir /s /q F:\4Born-Server-setup\old_logs del /f /q F:\4Born-Server-setup\locked_file.txt
Real Example: Delete all .tmp files from temp folder, remove empty folder, force delete old_logs folder with all contents (/s /q), and force delete a locked file (/f /q).

📝 File Content Operations

Create/Edit Files
Introduction: Creating and editing files is fundamental for configuration, logging, and documentation. Echo creates quick text files, while notepad opens a full editor.
echo "Server started at %date% %time%" > F:\4Born-Server-setup\logs\server.log echo "New entry: User login" >> F:\4Born-Server-setup\logs\server.log notepad F:\4Born-Server-setup\Setup\nginx-1.25.3\conf\nginx.conf echo. > F:\4Born-Server-setup\temp\empty.txt
Real Example: Create server log with timestamp, append new entry to existing log, open nginx config in notepad for editing, and create empty file with echo.
View File Contents
Introduction: Viewing file contents helps debug issues, check configurations, and monitor logs. Type shows everything, more paginates large files, findstr searches for specific text.
type F:\4Born-Server-setup\logs\server.log more F:\4Born-Server-setup\Setup\nginx-1.25.3\conf\nginx.conf findstr "error" F:\4Born-Server-setup\logs\*.log findstr /i "listen" F:\4Born-Server-setup\Setup\nginx-1.25.3\conf\nginx.conf
Real Example: View server log, paginate through nginx config, search for "error" in all log files, and find "listen" directives in nginx config (case-insensitive with /i).
File Properties
Introduction: File attributes control how files behave. Read-only prevents accidental changes, hidden hides files from normal view, and system marks important files.
attrib F:\4Born-Server-setup\Setup\nginx-1.25.3\conf\nginx.conf attrib +r F:\4Born-Server-setup\Setup\nginx-1.25.3\conf\nginx.conf.backup attrib -r -h F:\4Born-Server-setup\temp\hidden_file.txt attrib +h F:\4Born-Server-setup\logs\system.log
Real Example: Check nginx.conf attributes, make backup file read-only for protection, remove read-only and hidden attributes from temp file, and hide system.log file (+h).

💻 System Information

System Info
Introduction: System information helps troubleshoot issues, check hardware specs, and verify system configuration. Essential for server management and support.
systeminfo | findstr "Total Physical Memory" hostname whoami echo %COMPUTERNAME% echo %USERNAME%
Real Example: Check total RAM available for our server, get computer name for network identification, see current user account, and use environment variables for computer and user names.
Disk Usage
Introduction: Monitoring disk space prevents server crashes and helps plan storage needs. Critical for maintaining server health and performance.
dir /s F:\4Born-Server-setup fsutil volume diskfree F: wmic logicaldisk get size,freespace,caption forfiles /p F:\4Born-Server-setup\logs /m *.log /c "cmd /c echo @path @fsize"
Real Example: Check total size of our server directory, see free space on F: drive, list all drives with space info, and check size of all log files in our logs directory.
Running Processes
Introduction: Process monitoring helps identify resource usage, find problematic applications, and manage server performance. Essential for troubleshooting.
tasklist | findstr nginx tasklist /fi "imagename eq nginx.exe" /fo table tasklist /fi "memusage gt 100000" /fo csv wmic process where "name='nginx.exe'" get processid,commandline
Real Example: Find nginx processes, show nginx in table format, list processes using >100MB RAM in CSV format, and get detailed nginx process info including command line parameters.

🌐 Network Commands

Network Configuration
Introduction: Network configuration commands help troubleshoot connectivity issues, check IP addresses, and manage network adapters. Essential for server networking.
ipconfig ipconfig /all | findstr "IPv4" ipconfig /release "Local Area Connection" ipconfig /renew "Local Area Connection" ipconfig /flushdns
Real Example: Show basic IP info, find IPv4 addresses only, release IP from specific adapter, renew IP for that adapter, and flush DNS cache to resolve domain issues.
Network Connectivity
Introduction: Connectivity testing verifies internet access, checks server response times, and diagnoses network path issues. Critical for server monitoring.
ping 127.0.0.1 ping -n 4 google.com ping -t 8.8.8.8 tracert synoventumpartners.com telnet 127.0.0.1 80
Real Example: Test localhost (our server), ping Google 4 times only (-n 4), continuously ping DNS server (-t), trace route to our website, and test if port 80 is open on our server.
Port Information
Introduction: Port monitoring shows what services are running, which ports are open, and what processes are using network connections. Vital for security and troubleshooting.
netstat -an | findstr LISTENING netstat -ano | findstr :80 netstat -ano | findstr :9000 netstat -b -p tcp
Real Example: Show all listening ports, find what's using port 80 (nginx), check port 9000 (PHP-CGI), and show which programs (-b) are using TCP connections.

⚙️ Process Management

Kill Processes
Introduction: Process termination stops hung applications, frees resources, and allows restarting services. Use /f to force kill stubborn processes.
taskkill /f /im nginx.exe taskkill /f /im php-cgi.exe tasklist | findstr nginx taskkill /f /pid 1234 taskkill /im notepad.exe
Real Example: Force kill nginx, force kill PHP-CGI, check if nginx is still running, kill by specific PID, and gracefully close notepad (without /f).
Start Programs
Introduction: Starting programs from command line allows automation, background execution, and precise control over how applications launch.
start "" "F:\4Born-Server-setup\Setup\nginx-1.25.3\nginx.exe" start /b "PHP FastCGI" "F:\4Born-Server-setup\Setup\php-8.3.19\php-cgi.exe" -b 127.0.0.1:9000 start explorer F:\4Born-Server-setup start /min notepad F:\4Born-Server-setup\logs\server.log
Real Example: Start nginx server, start PHP-CGI in background with specific parameters, open our server folder in explorer, and open server log in minimized notepad.

🔧 Services Management

Service Control
net start service_name net stop service_name net restart service_name
Start, stop, or restart Windows services.
Service Information
sc query sc query service_name services.msc
Query service status or open Services management console.

📁 File & Directory Operations

Create Directory
Introduction: The mkdir command creates directories in Linux. It's fundamental for organizing files and creating project structures on your server.
mkdir /home/4Born-Server-Setup/backup mkdir -p /home/4Born-Server-Setup/logs/nginx/error mkdir "Project Files" temp cache mkdir -m 755 /home/4Born-Server-Setup/public
Real Example: Create backup folder, create nested directories with -p (creates parent dirs), create multiple folders at once, and create public folder with specific permissions (755 = rwxr-xr-x).
List Directory Contents
Introduction: The ls command lists directory contents with various formatting options. Essential for navigating and understanding file structures.
ls /home/4Born-Server-Setup ls -la /home/4Born-Server-Setup/logs ls -lh /home/4Born-Server-Setup/*.conf ls -lt /home/4Born-Server-Setup/logs | head -10 find /home/4Born-Server-Setup -name "*.log" -ls
Real Example: List our server directory, show all files including hidden (-la), show config files with human-readable sizes (-lh), show 10 newest files by time (-lt), and find all .log files with details.
Navigate Directories
Introduction: The cd command changes your current working directory. It's like clicking through folders but faster and more precise for server navigation.
cd /home/4Born-Server-Setup cd nginx/conf cd ../logs cd ~ cd - pwd
Real Example: Go to our server directory, enter nginx config folder, go back and into logs (../logs), go to home (~), return to previous directory (-), and show current path (pwd).
Copy Files/Folders
Introduction: The cp command creates copies of files and directories. Use -r for folders, -a to preserve all attributes, and -v for verbose output showing what's being copied.
cp /home/4Born-Server-Setup/nginx.conf /home/4Born-Server-Setup/backup/ cp -r /home/4Born-Server-Setup/logs /home/4Born-Server-Setup/backup/ cp -av /home/4Born-Server-Setup/config/ /home/4Born-Server-Setup/backup/ cp -u /home/4Born-Server-Setup/logs/*.log /home/4Born-Server-Setup/backup/logs/
Real Example: Copy nginx config to backup, copy entire logs folder recursively, copy config folder preserving attributes with verbose output (-av), and copy only newer log files (-u for update).
Move/Rename Files
Introduction: The mv command moves files to new locations or renames them. Unlike cp, the original file is removed from its old location (cut & paste operation).
mv /home/4Born-Server-Setup/temp.log /home/4Born-Server-Setup/logs/ mv /home/4Born-Server-Setup/nginx.conf /home/4Born-Server-Setup/nginx.conf.backup mv /home/4Born-Server-Setup/old_project /home/4Born-Server-Setup/archived/ mv /home/4Born-Server-Setup/logs/*.old /home/4Born-Server-Setup/archive/
Real Example: Move temp.log to logs directory, rename nginx.conf to nginx.conf.backup for safety, move old_project to archived folder, and move all .old files to archive directory.
Delete Files/Folders
Introduction: The rm command permanently deletes files and directories. Be very careful! Use -i for interactive confirmation, -r for directories, and -f to force deletion.
rm /home/4Born-Server-Setup/temp/*.tmp rm -i /home/4Born-Server-Setup/important_file.txt rm -rf /home/4Born-Server-Setup/old_logs find /home/4Born-Server-Setup/logs -name "*.log" -mtime +30 -delete
Real Example: Delete all .tmp files from temp folder, delete important file with confirmation (-i), force delete old_logs folder and contents (-rf), and auto-delete log files older than 30 days.

🔐 File Permissions

Change Permissions
Introduction: File permissions control who can read, write, or execute files. Critical for server security. Numbers: 4=read, 2=write, 1=execute. 755 = owner(7=rwx), group(5=rx), others(5=rx).
chmod 755 /home/4Born-Server-Setup/scripts/start_server.sh chmod +x /home/4Born-Server-Setup/scripts/*.sh chmod 644 /home/4Born-Server-Setup/config/*.conf chmod -R 755 /home/4Born-Server-Setup/public chmod u+w,g-w,o-w /home/4Born-Server-Setup/logs/error.log
Real Example: Make start script executable (755), make all shell scripts executable (+x), set config files to read-only for group/others (644), set public folder permissions recursively (-R), and give owner write permission while removing it from group/others.
Change Ownership
Introduction: File ownership determines which user and group own files. Essential for security and proper access control on multi-user servers.
sudo chown www-data:www-data /home/4Born-Server-Setup/public sudo chown -R nginx:nginx /home/4Born-Server-Setup/logs sudo chown root:root /home/4Born-Server-Setup/config/nginx.conf sudo chown $USER:$USER /home/4Born-Server-Setup/scripts
Real Example: Set web server ownership for public folder, make nginx own all log files recursively, set root ownership for critical config file, and set current user ownership for scripts folder.
View Permissions
Introduction: Viewing permissions helps troubleshoot access issues and verify security settings. Different commands show different levels of detail.
ls -l /home/4Born-Server-Setup/config/nginx.conf stat /home/4Born-Server-Setup/logs/error.log ls -la /home/4Born-Server-Setup/scripts/ namei -l /home/4Born-Server-Setup/public/index.html
Real Example: Check nginx config permissions, get detailed stats of error log including timestamps, list all files in scripts with permissions, and trace permissions through entire path to index.html.

📝 File Content Operations

Create/Edit Files
Introduction: File creation and editing is fundamental for configuration, logging, and scripting. Touch creates empty files, echo adds content, nano provides full editing.
touch /home/4Born-Server-Setup/logs/access.log echo "Server started: $(date)" > /home/4Born-Server-Setup/logs/server.log echo "New entry: User login at $(date)" >> /home/4Born-Server-Setup/logs/server.log nano /home/4Born-Server-Setup/config/nginx.conf vim /home/4Born-Server-Setup/scripts/backup.sh
Real Example: Create empty access log, create server log with timestamp, append new entry with current date, edit nginx config in nano, and edit backup script in vim.
View File Contents
Introduction: Viewing file contents is essential for debugging, monitoring logs, and checking configurations. Different commands serve different purposes.
cat /home/4Born-Server-Setup/config/nginx.conf less /home/4Born-Server-Setup/logs/error.log head -20 /home/4Born-Server-Setup/logs/access.log tail -f /home/4Born-Server-Setup/logs/error.log tail -n 100 /home/4Born-Server-Setup/logs/access.log | less
Real Example: Display entire nginx config, paginate through error log, show first 20 lines of access log, monitor error log in real-time, and show last 100 access log entries with pagination.
Search in Files
Introduction: Searching through files helps find errors, configuration settings, and specific information quickly. Essential for troubleshooting and log analysis.
grep "error" /home/4Born-Server-Setup/logs/error.log grep -i "listen" /home/4Born-Server-Setup/config/nginx.conf grep -r "404" /home/4Born-Server-Setup/logs/ grep -n "server_name" /home/4Born-Server-Setup/config/*.conf zgrep "error" /home/4Born-Server-Setup/logs/error.log.gz
Real Example: Find errors in error log, search for "listen" case-insensitively (-i), search all logs for 404 errors recursively, show line numbers (-n) for server_name in configs, and search in compressed log files (zgrep).

💻 System Information

System Info
Introduction: System information commands help identify server specifications, user context, and system status. Essential for troubleshooting and system administration.
uname -a hostnamectl status whoami id uptime lsb_release -a
Real Example: Show complete system info (kernel, architecture), display hostname and system details, show current username, show user ID and groups, check system uptime and load, and display Ubuntu version information.
Disk Usage
Introduction: Disk usage monitoring prevents server crashes from full disks and helps plan storage needs. Critical for maintaining server health.
df -h du -sh /home/4Born-Server-Setup du -h --max-depth=2 /home/4Born-Server-Setup ncdu /home/4Born-Server-Setup find /home/4Born-Server-Setup -type f -size +100M -ls
Real Example: Show all filesystem usage, check our server directory size, show subdirectory sizes 2 levels deep, use interactive disk usage analyzer (ncdu), and find files larger than 100MB in our server directory.
Memory & CPU
Introduction: Memory and CPU monitoring helps identify performance bottlenecks, resource-hungry processes, and system capacity. Essential for server optimization.
free -h htop top -p $(pgrep nginx | tr '\n' ',') lscpu cat /proc/meminfo | grep MemTotal watch -n 1 'free -h'
Real Example: Show memory usage in human format, open interactive process viewer, monitor only nginx processes in top, show CPU details, check total memory from system info, and watch memory usage update every second.

⚙️ Process Management

View Processes
Introduction: Process monitoring shows what's running on your server, resource usage, and helps identify problematic applications. Critical for system management.
ps aux | grep nginx ps -ef | grep php-fpm pgrep -l nginx ps -eo pid,ppid,cmd,%mem,%cpu --sort=-%cpu | head -10 pstree -p
Real Example: Find nginx processes with details, find PHP-FPM processes, get nginx PIDs with names (-l), show top 10 CPU-consuming processes with memory/CPU usage, and display process tree with PIDs.
Kill Processes
Introduction: Process termination stops hung applications, frees resources, and allows service restarts. Use graceful termination first, force kill (-9) only when necessary.
sudo pkill nginx sudo pkill -9 php-fpm kill $(pgrep nginx) sudo killall -TERM nginx sudo kill -USR2 $(cat /var/run/nginx.pid)
Real Example: Gracefully stop nginx processes, force kill PHP-FPM processes, kill nginx using process substitution, send TERM signal to all nginx processes, and send USR2 signal to nginx master process for graceful restart.
Background Jobs
Introduction: Background jobs allow long-running tasks to continue while you work on other things. Essential for server maintenance and monitoring scripts.
tail -f /home/4Born-Server-Setup/logs/error.log & nohup /home/4Born-Server-Setup/scripts/backup.sh > /home/4Born-Server-Setup/logs/backup.log 2>&1 & jobs fg %1 screen -S server_monitor tmux new-session -d -s backup
Real Example: Monitor error log in background, run backup script with nohup (survives logout) redirecting output to log, list current jobs, bring job 1 to foreground, start screen session for persistent monitoring, and create detached tmux session for backup tasks.

🌐 Network Commands

Network Configuration
ip addr show ifconfig ip route show
Display network interfaces and routing information.
Network Connectivity
ping google.com ping -c 4 8.8.8.8 traceroute google.com
Test network connectivity. -c limits ping count.
Port Information
netstat -tulpn ss -tulpn lsof -i :80
Check open ports and network connections.

🔧 System Services

Service Control
sudo systemctl start nginx sudo systemctl stop nginx sudo systemctl restart nginx sudo systemctl reload nginx
Control systemd services. reload reloads configuration without restart.
Service Status
sudo systemctl status nginx sudo systemctl is-active nginx sudo systemctl is-enabled nginx
Check service status, if running, and if enabled at boot.
Service Management
sudo systemctl enable nginx sudo systemctl disable nginx sudo systemctl list-units --type=service
Enable/disable services at boot and list all services.

📦 Package Management (Ubuntu/Debian)

Install Packages
sudo apt update sudo apt install package_name sudo apt install nginx php8.3
Update package list and install packages.
Remove Packages
sudo apt remove package_name sudo apt purge package_name sudo apt autoremove
Remove packages. purge removes config files, autoremove cleans dependencies.
Search & Info
apt search nginx apt show nginx apt list --installed
Search for packages, show package info, and list installed packages.

📊 Log Management

System Logs
sudo journalctl -u nginx sudo journalctl -f sudo journalctl --since "1 hour ago"
View systemd logs. -f follows in real-time, --since filters by time.
Log Files
sudo tail -f /var/log/nginx/error.log sudo tail -f /var/log/syslog sudo less /var/log/auth.log
Monitor log files in real-time or view them with pagination.