常用命令
# 添加新用户
useradd username
# 修改某个用户的密码
passwd username
# 查看内核版本
cat /proc/version
# 查看系统版本
cat /etc/issue
# 当前登录用户
who 或是 finger
# 查看端口状态
netstat -anlp 或是ss
# 查看自己的DNS与对方的IP
nslookup somewhere.com
# 网络配置信息
ifconfig
# 经过的路由器信息
traceroute somewhere.com
ubuntu 12.04 安装 mysql
https://help.ubuntu.com/12.04/serverguide/mysql.html
库相关操作
# 查看当前库的列表
yum repolist
# 在库中查询某个模块
yum search xxxName
# 所有库的模块的总数统计
yum list all | wc -l
# 添加新的库. 以EPEL Repository为例
# 32bit
sudo rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
# 64bit
sudo rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
tar命令
# 基本操作
tar [参数..] [文件]...
# 常用参数说明
-z 启用gzip压缩功能.启用此参数时, 必须写在前面, 且文件名后缀应加.gz以便区分
-c 打包
-x 解包
-v 查看过程
-f 指定打包文件名
# 示例
# 打包
tar -zcvf target.tar.gz part1.txt part2.txt part3.txt