前言
Linux 操作系统可以说是网络安全学习、从业人员必不可少的操作系统基础,因此 X1ong 在这里记录一下 Linux 的常用命令和常用操作。
Linux 常用命令
目录/文件操作
cd
更改当前工作目录
1 2 3 4 5 6 7 8 9 10 11 12 13 14
| cd /var/
cd
cd ..
cd -
cd var
|
ls
显示目录内容列表
补充说明:
ls命令 用来显示目标列表,在Linux中是使用率较高的命令。ls命令的输出信息可以进行彩色加亮显示,以分区不同类型的文件。
语法:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| ls -l
ls -a
ls -r
ls -t
ls -R
ls -lh
|
tree
树状图列出目录的内容。
该命令在Linux系统下一般不默认安装,需要使用apt或者yum安装。
语法:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| root@ls-rK8rbuXz:~ test ├── 1 │ └── 1.txt ├── 2 │ └── 2.txt ├── 3 │ └── 3.txt └── 4 └── 4.txt
root@ls-rK8rbuXz:~ test/ ├── 1 ├── 2 ├── 3 └── 4 4 directories
|
cp
将源文件或目录复制到目标文件或目录中
补充说明:
cp命令 用来将一个或多个源文件或者目录复制到指定的目的文件或目录。它可以将单个源文件复制成一个指定文件名的具体的文件或一个已经存在的目录下。cp命令还支持同时复制多个文件,当一次复制多个文件时,目标文件参数必须是一个已经存在的目录,否则将出现错误。
语法:
1
| cp [选项] [源文件路径] [目标文件路径]
|
1 2 3 4 5 6 7 8 9 10 11
| cp 1.txt /var/www/html/
cp -r code /var/www/html/
cp 1.txt /var/www/html/
cp -l 1.txt /var/2.txt
|
mv
用来对文件或目录重新命名或移动
语法:
1
| mv [选项] [源文件路径] [目标文件路径]
|
1 2 3 4 5
| mv 1.txt /var/
mv -b 1.txt /var/1.txt
|
pwd
查看当前工作目录
touch
创建新的空文件
补充说明:
touch命令 有两个功能:一是用于把已存在文件的时间标签更新为系统当前的时间(默认方式),它们的数据将原封不动地保留下来;二是用来创建新的空文件。
语法:
1 2 3 4 5 6 7
| touch 1.txt
touch -c 2.txt
touch 1.txt test/2.txt demo/3.txt
|
mkdir
用来创建目录
补充说明:
mkdir命令 用来创建目录。该命令创建由dirname命名的目录。如果在目录名的前面没有加任何路径名,则在当前目录下创建由dirname指定的目录;如果给出了一个已经存在的路径,将会在该目录下创建一个指定的目录。在创建目录时,应保证新建的目录与它所在目录下的文件没有重名。
语法:
1 2 3 4 5
| mkdir -m 700 /var/www/www.qwesec.com/
mkdir -p /var/www/html/x1ong
|
rmdir
用来删除空目录,一般不常用,一般在删除文件或目录的时候,使用 rm 命令删除。
rm
用于删除给定的文件和目录
补充说明:
rm 命令 可以删除一个目录中的一个或多个文件或目录,也可以将某个目录及其下属的所有文件及其子目录均删除掉。对于链接文件,只是删除整个链接文件,而原有文件保持不变。
语法:
1 2 3 4 5 6 7
| rm -f 1.txt
rm -r test/
|
unlink
系统调用函数unlink去删除指定的文件,unlink命令 用于系统调用函数unlink去删除指定的文件。和rm命令作用一样,都是删除文件。
dirname
去除文件名中的非目录部分
stat
用于显示文件的状态信息
1 2 3 4 5 6 7 8 9
| root@ls-rK8rbuXz:~ File: main.c Size: 70 Blocks: 8 IO Block: 4096 regular file Device: fc01h/64513d Inode: 427255 Links: 1 Access: (0644/-rw-r--r--) Uid: ( 0/ root) Gid: ( 0/ root) Access: 2023-12-10 15:36:18.459528580 +0800 Modify: 2023-12-10 15:36:16.895526338 +0800 Change: 2023-12-10 15:36:16.895526338 +0800 Birth: -
|
其中 Access
为文件的访问时间,Modify
为文件的修改时间,Change
为文件的元数据更改时间。
file
file命令几乎可以查看任意文件类型,它是根据文件的头部信息进行识别的。
1 2
| root@ls-rK8rbuXz:~ main.c: C source, ASCII text
|
md5sum
计算 MD5 加密校验和.
1 2
| root@ls-rK8rbuXz:~ 25308e361199a6516b134999238f6a76 main.c
|
base64
将文件或标准输入编码到Base64或从Base64解码为标准输出。
1 2 3 4 5 6 7 8
| root@ls-rK8rbuXz:~ aGVsbG8=
root@ls-rK8rbuXz:~ hello
root@ls-rK8rbuXz:~
|
显示/查看文本文件内容
cat
打印和拼接文件的工具.
1 2 3 4 5 6 7 8 9 10 11
| cat /etc/passwd
cat /etc/passwd /etc/shadow > passwd_shadow.txt
cat /etc/passwd /etc/shadow >> passwd_shadow.txt
cat -n /etc/passwd
|
tac
连接多个文件并以行为单位反向打印到标准输出。
nl
为每行内容添加行号
head
显示文件的开头部分。
语法:
1 2 3 4
| head -n 10 /etc/passwd
head -n 10 /etc/passwd /etc/shadow
|
tail
显示文件的末尾部分
语法:
1 2 3 4 5 6
| tail -n 10 /etc/passwd
tail -n 10 /etc/passwd /etc/shadow
tail -f /var/log/apache2/access.log
|
more
显示文件内容,每次显示一屏
- 按
Space
键:显示文本的下一屏内容。
- 按
Enter
键:只显示文本的下一行内容。
- 按斜线符
|
:接着输入一个模式,可以在文本中寻找下一个相匹配的模式。
- 按H键:显示帮助屏,该屏上有相关的帮助信息。
- 按B键:显示上一屏内容。
- 按Q键:退出more命令。
1
| more /var/log/apache2/access.log
|
less
分屏上下翻页浏览文件内容
补充说明:
less命令 的作用与more十分相似,都可以用来浏览文字档案的内容,不同的是less命令允许用户向前或向后浏览文件,而more命令只能向前浏览。用less命令显示文件时,用PageUp键向上翻页,用PageDown键向下翻页。要退出less程序,应按Q键。
1
| less /var/log/apache2/access.log
|
echo
输出给定参数
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| echo "hello world"
echo "${PATH}"
echo -n "hello world"
echo "hello world" >> file.txt
echo "hello world" > file.txt
echo -e "hello\tworld"
|
strings
在对象文件或二进制文件中查找可打印的字符串
hexdump
显示文件十六进制格式
语法格式:
1 2 3 4 5 6 7 8
| hexdump avatar.jpg
hexdump avatar.jpg | head -5
hexdump -C avatar.jpg
|
rev
将文件内容以字符为单位反序输出
1 2 3 4 5 6
| root@ls-rK8rbuXz:~ hsab/nib/:toor/:toor:0:0:x:toor nigolon/nibs/rsu/:nibs/rsu/:nomead:1:1:x:nomead nigolon/nibs/rsu/:nib/:nib:2:2:x:nib nigolon/nibs/rsu/:ved/:sys:3:3:x:sys cnys/nib/:nib/:cnys:43556:4:x:cnys
|
更换源
Ubuntu
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
| mv /etc/apt/sources.list /etc/apt/sources.list.bak
echo "deb https://mirrors.ustc.edu.cn/ubuntu/ jammy main restricted universe multiverse" >> /etc/apt/sources.list echo "deb-src https://mirrors.ustc.edu.cn/ubuntu/ jammy main restricted universe multiverse" >> /etc/apt/sources.list echo "deb https://mirrors.ustc.edu.cn/ubuntu/ jammy-security main restricted universe multiverse" >> /etc/apt/sources.list echo "deb-src https://mirrors.ustc.edu.cn/ubuntu/ jammy-security main restricted universe multiverse" >> /etc/apt/sources.list echo "deb https://mirrors.ustc.edu.cn/ubuntu/ jammy-updates main restricted universe multiverse" >> /etc/apt/sources.list echo "deb-src https://mirrors.ustc.edu.cn/ubuntu/ jammy-updates main restricted universe multiverse" >> /etc/apt/sources.list echo "deb https://mirrors.ustc.edu.cn/ubuntu/ jammy-backports main restricted universe multiverse" >> /etc/apt/sources.list echo "deb-src https://mirrors.ustc.edu.cn/ubuntu/ jammy-backports main restricted universe multiverse" >> /etc/apt/sources.list
echo "deb https://mirrors.ustc.edu.cn/ubuntu/ focal main restricted universe multiverse" >> /etc/apt/sources.list echo "deb-src https://mirrors.ustc.edu.cn/ubuntu/ focal main restricted universe multiverse" >> /etc/apt/sources.list echo "deb https://mirrors.ustc.edu.cn/ubuntu/ focal-security main restricted universe multiverse" >> /etc/apt/sources.list echo "deb-src https://mirrors.ustc.edu.cn/ubuntu/ focal-security main restricted universe multiverse" >> /etc/apt/sources.list echo "deb https://mirrors.ustc.edu.cn/ubuntu/ focal-updates main restricted universe multiverse" >> /etc/apt/sources.list echo "deb-src https://mirrors.ustc.edu.cn/ubuntu/ focal-updates main restricted universe multiverse" >> /etc/apt/sources.list echo "deb https://mirrors.ustc.edu.cn/ubuntu/ focal-backports main restricted universe multiverse" >> /etc/apt/sources.list echo "deb-src https://mirrors.ustc.edu.cn/ubuntu/ focal-backports main restricted universe multiverse" >> /etc/apt/sources.list
echo "deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse" >> /etc/apt/sources.list echo "deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse" >> /etc/apt/sources.list echo "deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse" >> /etc/apt/sources.list echo "deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse" >> /etc/apt/sources.list
echo "deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ disco main restricted universe multiverse" >> /etc/apt/sources.list echo "deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ disco main restricted universe multiverse" >> /etc/apt/sources.list echo "deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ disco-updates main restricted universe multiverse" >> /etc/apt/sources.list echo "deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ disco-updates main restricted universe multiverse" >> /etc/apt/sources.list echo "deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ disco-backports main restricted universe multiverse" >> /etc/apt/sources.list echo "deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ disco-backports main restricted universe multiverse" >> /etc/apt/sources.list echo "deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ disco-security main restricted universe multiverse" >> /etc/apt/sources.list echo "deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ disco-security main restricted universe multiverse" >> /etc/apt/sources.list echo "deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ disco-proposed main restricted universe multiverse" >> /etc/apt/sources.list echo "deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ disco-proposed main restricted universe multiverse" >> /etc/apt/sources.list
echo "deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse" >> /etc/apt/sources.list echo "deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse" >> /etc/apt/sources.list echo "deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse" >> /etc/apt/sources.list echo "deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse" >> /etc/apt/sources.list echo "deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse" >> /etc/apt/sources.list echo "deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse" >> /etc/apt/sources.list echo "deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse" >> /etc/apt/sources.list echo "deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse" >> /etc/apt/sources.list echo "deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse" >> /etc/apt/sources.list echo "deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse" >> /etc/apt/sources.list
echo "deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse" >> /etc/apt/sources.list echo "deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse" >> /etc/apt/sources.list echo "deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse" >> /etc/apt/sources.list echo "deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse" >> /etc/apt/sources.list echo "deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse" >> /etc/apt/sources.list echo "deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse" >> /etc/apt/sources.list echo "deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse" >> /etc/apt/sources.list echo "deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse" >> /etc/apt/sources.list echo "deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse" >> /etc/apt/sources.list echo "deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse" >> /etc/apt/sources.list
echo "deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted universe multiverse" >> /etc/apt/sources.list echo "deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse" >> /etc/apt/sources.list echo "deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse" >> /etc/apt/sources.list echo "deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted universe multiverse" >> /etc/apt/sources.list
echo "deb http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse" >> /etc/apt/sources.list echo "deb http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse" >> /etc/apt/sources.list echo "deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse" >> /etc/apt/sources.list echo "deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse" >> /etc/apt/sources.list echo "deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse" >> /etc/apt/sources.list echo "deb-src http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse" >> /etc/apt/sources.list echo "deb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse" >> /etc/apt/sources.list echo "deb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse" >> /etc/apt/sources.list echo "deb-src http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse" >> /etc/apt/sources.list echo "deb-src http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse" >> /etc/apt/sources.list
|
Kali
1 2 3 4 5 6 7 8 9 10 11 12 13 14
| mv /etc/apt/sources.list /etc/apt/sources.list.bak
echo "deb http://mirrors.ustc.edu.cn/kali kali-rolling main non-free contrib" >> /etc/apt/sources.list echo "deb-src http://mirrors.ustc.edu.cn/kali kali-rolling main non-free contrib" >> /etc/apt/sources.list
echo "deb http://mirrors.zju.edu.cn/kali kali-rolling main contrib non-free" >> /etc/apt/sources.list echo "deb-src http://mirrors.zju.edu.cn/kali kali-rolling main contrib non-free" >> /etc/apt/sources.list
echo "deb http://mirrors.neusoft.edu.cn/kali kali-rolling/main non-free contrib" >> /etc/apt/sources.list echo "deb-src http://mirrors.neusoft.edu.cn/kali kali-rolling/main non-free contrib" >> /etc/apt/sources.list
|
Debian
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
| mv /etc/apt/sources.list /etc/apt/sources.list.bak
echo "deb https://mirrors.ustc.edu.cn/debian/ bullseye main contrib non-free " >> /etc/apt/sources.list echo "deb-src https://mirrors.ustc.edu.cn/debian/ bullseye main contrib non-free " >> /etc/apt/sources.list echo "deb https://mirrors.ustc.edu.cn/debian/ bullseye-updates main contrib non-free " >> /etc/apt/sources.list echo "deb-src https://mirrors.ustc.edu.cn/debian/ bullseye-updates main contrib non-free " >> /etc/apt/sources.list echo "deb https://mirrors.ustc.edu.cn/debian/ bullseye-backports main contrib non-free " >> /etc/apt/sources.list echo "deb-src https://mirrors.ustc.edu.cn/debian/ bullseye-backports main contrib non-free " >> /etc/apt/sources.list echo "deb https://mirrors.ustc.edu.cn/debian-security/ bullseye-security main contrib non-free " >> /etc/apt/sources.list echo "deb-src https://mirrors.ustc.edu.cn/debian-security/ bullseye-security main contrib non-free " >> /etc/apt/sources.list
echo "deb http://mirrors.163.com/debian/ buster main contrib non-free" >> /etc/apt/sources.list echo "deb http://mirrors.163.com/debian/ buster-updates main contrib non-free" >> /etc/apt/sources.list echo "deb http://mirrors.163.com/debian/ buster-backports main contrib non-free" >> /etc/apt/sources.list echo "deb http://mirrors.163.com/debian-security buster/updates main contrib non-free" >> /etc/apt/sources.list
echo "deb http://mirrors.163.com/debian/ stretch main contrib non-free" >> /etc/apt/sources.list echo "deb http://mirrors.163.com/debian/ stretch-updates main contrib non-free" >> /etc/apt/sources.list echo "deb http://mirrors.163.com/debian/ stretch-backports main contrib non-free" >> /etc/apt/sources.list echo "deb http://mirrors.163.com/debian-security stretch/updates main contrib non-free" >> /etc/apt/sources.list
echo "deb http://mirrors.163.com/debian/ jessie main contrib non-free" >> /etc/apt/sources.list echo "deb http://mirrors.163.com/debian/ jessie-updates main contrib non-free" >> /etc/apt/sources.list echo "deb http://mirrors.163.com/debian/ jessie-backports main contrib non-free" >> /etc/apt/sources.list echo "deb http://mirrors.163.com/debian-security jessie/updates main contrib non-free" >> /etc/apt/sources.list
|
Centos
Centos7
1 2 3 4 5 6 7 8 9 10 11
| mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
yum update
yum makecache
|
Centos6
1 2 3 4 5 6 7 8 9 10 11
| mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
curl -o /etc/yum.repos.d/CentOS-Base.repo https://www.xmpan.com/Centos-6-Vault-Aliyun.repo
yum update
yum makecache
|
SSH
安装SSH服务
ubuntu
1 2
| apt install openssh-server
|
Centos
1 2
| yum install openssh-server
|
Kali/Debian
1 2
| apt install openssh-server
|
SSH设置开机自启
ubuntu/kali/Debian
1 2 3 4 5
| sudo systemctl enable ssh
sudo systemctl disable ssh
|
Centos
1 2 3 4 5
| sudo systemctl enable sshd
sudo systemctl disable sshd
|
允许root用户远程登录
Ubuntu/Kali/Debian
1 2
| sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
|
Centos
1 2 3 4
| sed -i 's/#PermitRootLogin no/PermitRootLogin yes/' /etc/ssh/sshd_config
systemctl restart sshd
|
说明:将 /etc/ssh/sshd_config 文件中的 PermitRootLogin 选项设置为 yes 重启服务即可。
修改SSH端口号
1 2 3
| sed -i 's/#Port 22/Port 2222' /etc/ssh/sshd_config
|
说明:将 /etc/ssh/sshd_config 文件中的 Port 选项设置为 2222 重启服务即可。
SSH连接非22端口
SSH使用公私钥登录
SSH客户端配置
1 2 3 4 5 6
| ssh-keygen
cd /root/.ssh
ssh-copy-id -i id_rsa.pub root@x.x.x.x
|
SSH服务端配置
执行如下命令:
1 2 3 4 5 6
| sed -i 's/#PasswordAuthentication yes/PasswordAuthentication no/' /etc/ssh/sshd_config
sed -i 's/#PubkeyAuthentication yes/PubkeyAuthentication yes/' /etc/ssh/sshd_config
/etc/init.d/ssh restart
|
SSH客户端连接
1
| ssh -i ~/.ssh/id_rsa root@10.211.55.3
|
SCP拷贝文件
将本地文件拷贝到SSH服务器
1
| scp 本地文件 用户名@服务器地址:要拷贝的路径
|
从SSH服务器下载文件到本地
1
| scp 用户名@服务器地址:要下载的路径 保存本地的路径
|
如果SSH服务器使用的不是默认端口22,则需要使用 -P 参数进行指定端口。
FTP
安装FTP
Ubuntu/Kali/Debian
Centos
FTP设置开机自启
1 2 3 4
| systemctl enable vsftpd
systemctl disable vsftpd
|
连接FTP
最基本的连接方式:(Windows Linux 通用):
连接FTP的非默认端口:
或者:
1 2
| ➜ ~ ftp ftp> open 10.211.55.3 21
|
基本操作
目录相关
1 2 3 4 5 6 7 8 9 10 11
| pwd ls/dir cd cdup/cd .. lcd
mkdir rename rmdir delete mdelete
|
文件上传和下载
1 2 3 4
| binary ascii get/mget put/mput
|
退出
Linux部署LAMP
Ubuntu
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| apt update apt upgrade
apt install apache2 -y
apt install mysql-server mysql-client
mysql_secure_installation
add-apt-repository ppa:ondrej/php apt-get install php5.6 php5.6-mysql php5.6-gd
|
Centos
1 2 3 4 5 6 7 8 9 10 11 12 13 14
| yum update
yum install httpd -y
yum install mariadb-server mariadb
mysql_secure_installation
yum install php php-mysql
|
压缩与解压
压缩
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| tar zcvf FileName.tar DirName
tar jcvf x.tar xxxx
gzip FileName
compress FileName
tar Zcvf FileName.tar.Z DirName
zip -r FileName.zip DirName
jar cvf shell.war shell.jsp
|
解压
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| tar zxvf FileName.tar
bzip2 -d FileName.bz2 bunzip2 FileName.bz2
gzip -d FileName.gz gunzip FileName.gz
uncompress FileName.Z
tar Zxvf FileName.tar.Z
unzip FileName.zip
|