For beginners, using Linux can feel like starring in a hacker movie—until a misstep deletes the company database, proving that the command line isn’t just a playground but a “book of life and death.” Today, let’s cut to the chase and dive into the essential commands that, when used correctly, can make you a legend! If you like this, show some love with a like, comment, and share!
01
Survival Kit for Linux Beginners
1. cd
– Change Directory
Use cd /home
to jump into the home directory, cd ..
to go up one level. Don’t mistakenly type cd / home
(extra space causes an error). The slickest move? cd -
takes you back to the last directory instantly—faster than recalling a WeChat message.
2. ls
– List Files
Plain ls
shows file names. Use ls -l
for details (permissions, size, modification time), and ls -a
to include hidden files. Avoid ls -R
, which recursively lists files—it can flood your screen with thousands of filenames, potentially freezing your system.
3. cat
– View File Contents
cat 1.txt
prints the full file content—great for small files. Never use it on huge log files, or your screen will scroll endlessly. Even Ctrl+C
might not save you in time.
02
The Four Kings of File Operations (One Mistake = Instant Doom)
4. rm
– Remove Files
rm 1.txt
deletes a single file, rm *.log
wipes out all log files. But if you type rm -rf /*
—congratulations, you’ve just earned the “Delete and Flee” achievement. System files? Gone. Not even a reinstall can save you. Always cp
(backup) before deleting important files!
5. cp
/ mv
– Copy & Move Files
cp 1.txt 2.txt
copies a file. Use -r
for directories. The biggest pitfall? It overwrites without warning. If you hastily replace new code with an old version, you’re doomed. Use cp -i
for a safety prompt. mv
works the same way—one wrong move and it’s game over.
6. chmod
– Change File Permissions
chmod 777 1.txt
grants full permissions—convenient yet disastrous, as hackers can easily exploit it. Instead, use chmod u+x
to grant execution permission only when necessary. Don’t blindly follow online advice to set 777
everywhere!
7. find
– Locate Files
find / -name "*.conf"
searches for config files, but don’t do this at the root level (/
)—it’ll make an HDD smoke. Add -type f
to search only for files, making it three times faster.
03
Permission Management (Touch the Wrong Button = Account Banned)
8. sudo
– Superuser Privileges
sudo apt update
grants temporary admin rights. But never, ever run sudo rm -rf /
—this command bypasses protections and erases your entire system. Even worse? sudo su
switches to root, like leaving a nuclear launch button on your desk.
9. chown
– Change File Ownership
sudo chown user:group 1.txt
changes file ownership. But don’t mess with system files! Someone once changed ownership of /etc/passwd
, locking everyone out. The only fix? Reinstalling the OS.
04
Networking Tricks (One Wrong Move = Disaster)
10. wget
/ curl
– Download Files
wget http://xxx.com/1.zip
downloads files, but never trust unknown sources. Some “cracked tools” contain crypto-mining scripts, making your CPU max out at 100%.
11. ssh
– Remote Login
ssh [email protected]
connects to a server, but typing the wrong IP might land you in a hacker’s honeypot. Always use SSH keys instead of passwords to prevent brute-force attacks.
12. netstat
– Monitor Network Connections
netstat -tulnp
shows open ports. Unexpected connections? Disconnect ASAP—your system might be compromised. Don’t use this to snoop on coworkers, or IT will have a word with you.
05
System Management Pro Tips (Don’t Wing It Unless You Know What You’re Doing)
13. top
/ htop
– Monitor System Resources
top
displays real-time CPU and memory usage. Press P
to sort by CPU, M
by memory. Be careful when using kill
here—one wrong process, and the whole server crashes.
14. df
/ du
– Check Disk Space
df -h
shows total and available space. du -sh *
displays folder sizes. Running du
at root (/
)? You might as well go home—your HDD will take forever to scan.
15. crontab
– Schedule Tasks
crontab -e
sets up scheduled scripts. One typo and your task won’t run. Someone once scheduled reboot
every minute—turning their system into a perpetual reboot machine.
06
Emergency Crash Recovery Guide (Memorize This Like Your Life Depends on It)
- Accidentally deleted files? Immediately unmount the drive and try
extundelete
. - Wrong command? Spam
Ctrl+C
to stop, orCtrl+Z
to pause. - Broken system settings? Boot from a Live USB, mount the disk, and roll back changes.
- Forgot your password? Use GRUB’s single-user mode to reset (physical access required).
Three Golden Rules:
- Before running
rm
, triple-check the path. - When using
sudo
, pretend you’re defusing a bomb. - Before modifying configs, always make a backup with
cp
.
The command line isn’t a toy—one wrong Enter
, and your system could be gone forever. Don’t ask how I know this… let’s just say someone recently used dd
incorrectly and turned their USB drive into a brick. They’re still crying in the hallway. 😭
Disclaimer:
- This channel does not make any representations or warranties regarding the availability, accuracy, timeliness, effectiveness, or completeness of any information posted. It hereby disclaims any liability or consequences arising from the use of the information.
- This channel is non-commercial and non-profit. The re-posted content does not signify endorsement of its views or responsibility for its authenticity. It does not intend to constitute any other guidance. This channel is not liable for any inaccuracies or errors in the re-posted or published information, directly or indirectly.
- Some data, materials, text, images, etc., used in this channel are sourced from the internet, and all reposts are duly credited to their sources. If you discover any work that infringes on your intellectual property rights or personal legal interests, please contact us, and we will promptly modify or remove it.