cd /usr
切换到/usr目录下
注: Linux的文件系统和Windows不一样,windows有c盘,d盘,e盘,Linux 看上去就只有一个盘,/usr就是相当于硬盘上的usr目录。
ls
ls -lh
ls 用来遍历当前目录下所有的文件和目录
ls -lh 遍历详细信息,如权限,所属用户,创建日期,大小等等信息
pwd
有时候敲着敲着就忘记自己处于哪个目录下了,那么这个时候就可以使用pwd命令来显示当前所处与的目录
mkdir -p /test/abc
创建目录 /test/abc
-p的意思是如果abc的父目录不存在,那么就会帮助创建其父目录
touch test.java
创建test.java文件
rm -f test.java
使用rm命令删除文件。 -f是强制删除的意思
rm -rf /test/abc
rm 命令也可以用来删除目录 -r表示删除目录 f表示强制
查看文件的命令有多种,这里介绍tail
tail -50f /etc/passwd
查看 /ect/passwd 文件的内容, -50 表示查看最后50行 f表示滚动查看,当这个文件发生变化的时候,会自动展示最新的内容。
这种方式特别适合查看日志文件。
退出方式: Ctrl+c
查看Linux下Tomcat运行日志
第一步: 进入Tomcat路径下的 /www/server/tomcat/logs:
cd /www/server/tomcat/logs
第二步: tail -f catalina-daemon.out
这样运行时候就可以查看运行日志了
退出tail命令是Ctrl+c。
重启Tomcat
第一步: 进入Tomcat路径下的 /www/server/tomcat/bin:
cd /www/server/tomcat/bin
第二步: 使用Tomcat关闭命令
./shutdown.sh
查看Tomcat是否以关闭
ps -ef|grep java
若没有相关信息则已关闭tomcat
否则直接杀死进程
kill -9 7010
第三步: 启动Tomcat
./startup.sh
Comments | 11 条评论
There is noticeably a bundle to know about this. I assume you made certain good points in features also. Susann Benedict Peta
What a information of un-ambiguity and preserveness of valuable familiarity concerning unexpected emotions. Jordan Carlin Lyudmila
I really liked your blog post. Really thank you! Much obliged. Allina Ralph Charline
You made some good points there. I looked on the internet for the subject and found most people will approve with your website. Tatiania Joey Gabbi
I like it whenever people come together and share ideas. Great website, keep it up. Eloise Dimitry English
Touche. Solid arguments. Keep up the amazing effort. Cindra Ermin Shushan
Ahaa, its nice dialogue on the topic of this piece of writing at this place at this webpage, I have read all that, so now me also commenting here. Molly Godard Jentoft
What a information of un-ambiguity and preserveness of precious experience on the topic of unpredicted emotions. Carlin Clayton Deth
There is noticeably a package to understand about this. I think you ensured nice points in features likewise. Rosalind Teodoro Valerie
Good post! We are linking to this particularly great post on our website. Keep up the great writing. Jo-Anne Friedrick Bertrando
I believe you have observed some very interesting points , thanks for the post. Sabra Towny Joey