Servers predominantly run on Linux, so your local environment shouldn’t be too far off. Recently, I helped a friend troubleshoot a bug in a Python script he wrote on Windows. It ran perfectly on his local machine, but when deployed to the server, it threw an error. After two hours of investigation, I discovered that Windows uses “\” for file paths while Linux uses “/”. He had hardcoded the path separator in his code, which the server couldn’t recognize. This isn’t an isolated incident. Over 90% of servers and cloud hosts in the market today run on Linux. Default images for servers on Alibaba Cloud and Tencent Cloud are all Linux-based, and if you want to set up a website on a VPS, the preferred distributions are CentOS or Ubuntu. Even the servers behind the apps you use daily, like WeChat and Taobao, are primarily supported by Linux. Programmers don’t just write code; they ultimately need to deploy it on a server. If you’re using Windows locally while the server runs on Linux, the disparity between the two environments can lead to the awkward situation of “working locally but failing online.” Issues like file permissions, environment variables, and process management differ significantly between Windows and Linux, and many have fallen into this trap. For instance, I wrote a Java project using JDK 11 on Windows, but the server was running JDK 8 on Linux, resulting in a “class incompatibility” error after deployment. I ended up working late into the night to realize the JDK versions didn’t match. Eventually, I switched my local system to Linux to maintain consistency with the server environment, which made deployments much smoother and saved me a lot of hassle. You might say, “Can’t I just use a virtual machine or Docker?” Sure, but that still adds a layer of separation. Virtual machines consume memory, and while Docker is lightweight, debugging is still not as convenient as working directly on a Linux system. For example, if you want to view system logs, you can simply run tail -f /var/log/xxx.log on Linux to see real-time updates, whereas on Windows, you might spend a long time searching for the log file and may not even have permission to view it. Let’s talk about efficiency: terminal commands can be ten times faster than graphical interfaces. Many people find Linux daunting, primarily due to the “black box” terminal. However, did you know that experienced programmers write code faster largely because they are proficient with the terminal? For example, if you want to find all log files containing “userId=123” in a folder, on Windows, you would have to open the folder, search for the file name in the top right corner, and then open each file to check its contents, which can take forever if there are many files. But on Linux, a single command grep "userId=123" *.log can list all lines containing that keyword in a second, and you can even save the output to a file. Similarly, if you want to batch rename 100 files from “.txt” to “.md”, on Windows, you would either do it manually or write a batch script, worrying about syntax errors. On Linux, you can simply run rename 's/.txt/.md/' *.txt to accomplish it without writing a script. Nowadays, when I code, I hardly leave the terminal. After editing code, I can run git add ., git commit -m "fix bug", and git push in three commands to complete the submission; to check if a service is running on the server, I can use ssh username@serverIP "ps -ef | grep java" without needing remote desktop access; and if I want to kill a process, kill -9 processID is much more convenient than searching for it in the task manager. Some might argue that Windows has PowerShell, which can also execute commands. However, in terms of command richness and flexibility, PowerShell still lags behind Linux shells (like Bash or Zsh). Moreover, many open-source tools and scripts prioritize Linux support, and when they run on Windows, they either don’t work or require extensive configuration. Another critical point is the open-source ecosystem; Linux is the “home base” for open-source tools. Programmers rely heavily on open-source tools, and the “home base” for these tools is Linux. If you’re writing Python, using the Pip package manager, you can install packages with pip install xxx in one command on Linux; for Java, configuring Maven or Gradle is simpler on Linux; and for front-end development, Node.js and npm run more smoothly on Linux. I once wanted to try a video processing tool called “ffmpeg”; on Windows, I had to download the installer and configure environment variables, which took half an hour. But on Linux, I could simply run sudo apt install ffmpeg (on Ubuntu) and have it installed in under a minute, ready to use for video processing commands. Tools like Docker and Kubernetes, which are popular for containerization and orchestration, also support Windows, but best practices are still on Linux. I previously installed Docker on Windows and frequently encountered errors like “port in use” or “image pull failed”. After switching to Linux, I hardly faced these issues, and starting containers and deploying services became much smoother. The beauty of open source is freedom. You can modify code and customize your tools as you see fit. For instance, if you find the terminal not visually appealing, you can install Zsh on Linux and customize it with an Oh My Zsh theme, making it both attractive and functional, while also allowing you to set custom shortcuts and command aliases. I have set aliases for frequently used long commands, such as changing git status to gs and docker ps to dp, which has significantly boosted my coding efficiency. In contrast, Windows is a closed-source system, and many things cannot be modified; you have to follow Microsoft’s pace. For example, if Microsoft decides to eliminate a feature you like, you have to accept it; and if an open-source tool has compatibility issues with Windows, you either wait for the tool’s author to adapt it or struggle with it yourself, which can severely impact efficiency. Some might say, “I tried installing Linux before, and the desktop crashed frequently, and I couldn’t install drivers; it was too much hassle.” Honestly, I faced similar issues when I first installed Linux ten years ago. Installing a graphics driver took a lot of searching for tutorials, and I ended up crashing the system; connecting to WiFi required manual configuration of network parameters. However, today’s Linux distributions are far from the “deterrent” systems of the past. For instance, the popular Ubuntu now has an installation process similar to Windows, where you can just click “next” to complete the setup. After installation, WiFi and graphics drivers are usually auto-detected, eliminating the need for manual configuration. The desktop environment is also user-friendly, with icons and a taskbar, allowing you to perform most operations with a mouse if you prefer not to use the terminal. If you find dual-booting cumbersome, you can try WSL (Windows Subsystem for Linux), which is a built-in Linux subsystem in Windows. You can search for Ubuntu or Debian in the Microsoft Store and install these distributions without partitioning or rebooting, allowing you to use Linux’s terminal and tools directly within Windows, which is particularly friendly for beginners. Many of my colleagues started with WSL before transitioning to a standalone Linux system. Initially, you don’t need to learn many commands; just start with simple ones like ls (to list files), cd (to change directories), and pwd (to print the current path). With frequent use, you’ll naturally become proficient. This isn’t to say Windows is bad; it is indeed more convenient for everyday office tasks and gaming. However, for programmers, the advantages of Linux are too significant to ignore. Consistency with server environments, efficient terminal command usage, and a rich open-source ecosystem all help us save time and improve productivity. As for me, whether I’m writing code, deploying services, or processing data, I have become accustomed to using Linux. It’s not about being pretentious; once you use it, you can’t go back. The seamlessness of “one command to accomplish everything” and the peace of mind from having a consistent local and server environment are truly invaluable.