Linux 基础入门指南(优化版)
2026-03-25 14:06:41
by 山阴客

打印???
山阴客(http://www.shanyinke.com)
技术文章(http://www.shanyinke.comhref=category.php?cid=1)
LINUX文章(http://www.shanyinke.comhref=category.php?cid=3)

Linux 入门必看

什么是 Linux?

Linux 是一种自由和开放源码的操作系统内核,由 Linus Torvalds 于 1991 年首次发布。它是服务器领域最流行的操作系统,也是 Android 手机的基础。

Linux 发行版

Linux 内核加上各种软件包,就构成了完整的 Linux 发行版:

基本命令

文件操作

# 查看当前目录
pwd

# 列出文件
ls -la

# 切换目录
cd /home/user

# 创建目录
mkdir mydir

# 创建文件
touch file.txt

# 删除文件
rm file.txt

# 复制文件
cp source.txt dest.txt

# 移动/重命名文件
mv old.txt new.txt

文本查看

# 查看文件内容
cat file.txt

# 分页查看
more file.txt

# 翻页查看(可上下翻)
less file.txt

# 查看文件头部
head -n 10 file.txt

# 查看文件尾部
tail -n 10 file.txt

系统信息

# 查看系统版本
cat /etc/os-release

# 查看内存使用
free -h

# 查看磁盘使用
df -h

# 查看进程
ps aux

# 查看实时资源
top

网络命令

# 测试网络连通
ping google.com

# 查看 IP 地址
ip addr

# 下载文件
wget http://example.com/file.tar.gz

# 远程登录
ssh user@server

软件包管理

Ubuntu/Debian (apt)

# 更新软件源
sudo apt update

# 安装软件
sudo apt install nginx

# 卸载软件
sudo apt remove nginx

# 升级软件
sudo apt upgrade

CentOS/Rocky Linux (yum/dnf)

# 安装软件
sudo yum install nginx

# 卸载软件
sudo yum remove nginx

# 升级软件
sudo yum update

总结

Linux 的学习需要大量实践。建议安装一个虚拟机或使用 WSL 来练习常用命令。掌握这些基础命令后,你就能在 Linux 系统中自如工作了。



Copyright © 2002-2022 http://www.shanyinke.com
All rights reserved.

备案号:浙ICP备17002154号-3 Powered by: myarticle.com.cn Version 1.0dev
Processed Time: 0.0013 s Querys: 4 [ Gzip Level 0 ]