Linux各种解压命令
1、*.tar 用 tar -xvf 解压
2、*.gz 用 gzip -d或者gunzip 解压
3、*.tar.gz和*.tgz 用 tar -xzf 解压
4、*.bz2 用 bzip2 -d或者用bunzip2 解压
5、*.tar.bz2用tar -xjf 解压
6、*.Z 用 uncompress 解压
7、*.tar.Z 用tar -xZf 解压
8、*.rar 用 unrar e解压
9、*.zip 用 unzip 解压
运行脚本时’./’命令和’sh’命令的区别
sh xxx.sh:用 sh 这个shell 来解释和运行 xxx 这个脚本。xxx 文件不必具有可执行属性。
./ xxx.sh :xxx.sh这个脚本必须具备可执行属性。
Linux文件权限
在某个目录下输入命令’ll’,会出现如上图所示的图片,开头的-rwxrw-r–这一字符串标识文件权限。
这个字符串有10位,可以分为4段来解读。注:r–可读,w–可写,x–可执行。
第一段(第1位)表示是目录还是文件,-表示是文件,d表示是目录;
第二段(第2-4位,共3个字符串)表示文件所属用户对它的权限;
第三段(第5-7位,共3个字符串)表示文件所属用户组用户对它的权限;
第四段(第8-10位,共3个字符串)表示其他用户对它的权限;
Tomcat相关
将war包放在webapps目录下,会随着tomcat启动自动解压。
启动和关闭tomcat: 在bin目录下:
./ startup.sh #启动
./ shutdown.sh #关闭
tail -f ../logs/catalina.out #查看实时日志
./startup.sh & tail -f ../logs/catalina.out #启动的同时查看实时日志
查看端口情况
netstat -nultp
效果:
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:6379 0.0.0.0:* LISTEN 858/redis-server *:
tcp 0 0 0.0.0.0:4396 0.0.0.0:* LISTEN 885/nginx -g daemon
tcp 0 0 106.14.254.109:8877 0.0.0.0:* LISTEN 1236/node
tcp 0 0 0.0.0.0:6000 0.0.0.0:* LISTEN 885/nginx -g daemon
tcp 0 0 127.0.0.1:8080 0.0.0.0:* LISTEN 1255/config.ru
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 885/nginx -g daemon
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 685/sshd
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 1241/master
tcp 0 0 127.0.0.1:6010 0.0.0.0:* LISTEN 7743/1
tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN 885/nginx -g daemon
tcp 0 0 127.0.0.1:32000 0.0.0.0:* LISTEN 895/java
tcp6 0 0 :::3306 :::* LISTEN 818/mysqld
快捷方式
软连接
ln -s 源文件 目标文件(快捷方式)