一、
运行项目(网站)HTML5(H5)(植物大战僵尸)
1、准备项目的运行环境(apache/nginx)
[root@VM-8-2-centos ~]# yum -y install httpd
2、运行(apache)
[root@VM-8-2-centos ~]# systemctl start httpd
3、获取项目源码包,并上传到服务器
4、安装解压工具,解压项目源码.zip结尾的压缩包
[root@VM-8-2-centos ~]# yum -y install unzip
[root@VM-8-2-centos ~]# unzip jspvz.zip
5、把源码拷贝到网站发布目录下
[root@VM-8-2-centos ~]# cp -r jspvz/* /var/www/html/
网站发布目录用来存放项目源码,用户访问的就是网站发布目录(/var/www/html)
6、设置源码文件权限为777
[root@VM-8-2-centos ~]# chmod 777 /var/www/html/* -R
7、浏览器访问
复制公网ip并打开
二、三通定向tee(了解)
借助于三通管道可以实现将前一个进程的输出作为后一个进程的输入,也可以将前一个进程的输出结果重定向到一个文件中。
访问情况
四、文件查找(1、忘记文件在哪个 2、找一批文件进行动作)
which 只能查询命令
find 查找范围 条件 [动作] 默认返回文件的路径
[root@localhost ~]# find / -name "*.sh"//以sh结尾的文件
[root@localhost ~]# find / -name "ifcfg*"//文件开头为ifcfg
[root@localhost ~]# find /opt -iname "abc"//-i忽略大小写
/opt/ABC
[root@localhost ~]# find ./ -size -3M//小于3M
[root@localhost ~]# find ./ -user lili -o -group hr//满足一个
[root@localhost ~]# find ./ -user alice -a -group hr//都满足
-o 是或者的意思
-a 是而且的意思
-not 是相反的意思(!取反)
stat file1
访问时间、修改时间、改变时间(搜区别)
[root@localhost ~]# find /etc -mtime -5//修改时间5天以内
[root@localhost ~]# find /home -nouser//没有所有者的文件
按文件类型:
[root@localhost ~]# find ./ -type f//f普通文件
[root@localhost ~]# find /dev -type d //d目录
[root@localhost ~]# find /dev -type l //l链接
[root@localhost ~]# find /dev -type b //b块设备
[root@localhost ~]# find /dev -type c //c字符设备
[root@localhost ~]# find /dev -type s //s套接字
[root@localhost~]# find /dev -type p //p管道文件
按文件权限:
[root@localhost ~]# find . -perm 644 -ls//就查644的
[root@localhost ~]# find . -perm -644 -ls//比它权限多的
[root@localhost ~]# find /etc -name "ifcfg*" -delete
|xargs = -ok = -exec( |xargs不用\;结尾)
[root@localhost ~]# find . -type f -name "*.txt" |xargs -i cp {} /tmp/(记)
五、打包压缩,解压缩 tar 参数
压缩包文件格式(压缩格式不同)[z/j/J]:
.tar.gz
.tar.bz2
.tar.xz
.zip
1、在linux系统中打包压缩
tar cf 路径/压缩包文件名 要打包的文件
2、在linux系统中解压缩
tar xf 压缩包的名字 -C(指定解压路径)
3、如果看到.zip结尾的压缩包,使用unzip解压
-d指定路径
4、
5、 打包压缩结合文件查找
find ./ -name "file*" |xargs -i tar rf /tmp/file2.tar.gz {}