introduction
This article will start from Linux
the system-related article describes, mainly to be a record, but also to facilitate encountered Linux
problems associated with the system could be discussed.
- Common Commands
- to sum up
First, the commonly used commands
1, view the command
PS - Process Status view the process status
//查看tomcat所有进程信息
ps -aux | grep tomcat
//查看端口174896端口监听状况
netstat -anp | grep 174896
View history commands
//查看服务器的历史命令操作
history
File Viewer
//查看a.properties文件内容
vim a.properties
View Log command
//查看日志
less XXX.debug.log
shift + G 命令到文件尾部 然后输入 ?加上你要搜索的关键字例如 ?1213
shift + n 关键字之间进行切换
//查看日志
tail XXX.debug.log
tail -50f XXX.debug.log 实时监控最新50行日志
tail -n 10 XXX.debug.log 查询日志尾部最后10行的日志
crtl + c 回到当前目录
2, directory
//查看当前目录
pwd
//返回上一级目录
cd ..
//列出所有文件及其权限
ll
//列出所有文件
ls
2, file operations
//删除文件
rm -rf c.properties
//移动文件
mv /home/jk/a.properties /usr/java/
//复制文件
cp /home/jk/a.properties /usr/java/
Modify the file
//查看a.properties文件内容
vim a.properties
//数据i进行insert操作,光标移动到需要修改的地方进行修改,esc退出
:wq保存退出
3, the operation command
service operation
//启动、停止、重启tomcat服务
systemstl start/stop/restart tomcat
//杀掉端口为174896的进程
kill -s 9 174896
Second, summary
This paper focuses on commonly used Linux
commands an explanation, I hope to help students in need, follow-up will continue to update more Linux
tips and commands.