Linux基本操作

====================20200810=============================

--切换账号
su wzh
--启动mysql服务
systemctl start mysqld.service
--解压
tar zxvf apache-tomcat-8.5.57.tar.gz
--复制
cp layuiweb.war apache-tomcat-8.5.57/webapps/
--防火墙开放端口
firewall-cmd --state
firewall-cmd --zone=public --add-port=8080/tcp --permanent
firewall-cmd --reload
--安装
yum install java-1.8.0-openjdk* -y
--关键字匹配查询
rpm -qa |grep java
--关键字匹配查询已安装软件
yum list java-1.8*
--xargs来删除这些包
rpm -qa | grep java | xargs rpm -e --nodeps
--显示当前PATH环境变量,该变量的值由一系列以冒号分隔的目录名组成
echo $PATH
--搜索程序路径
whereis javac
--安装文件
yum -y install mysql57-community-release-el7-10.noarch.rpm
--清除,很方便,绕开了没有root权限的问题。
yum clean all
--安装
rpm -Uvh mysql57-community-release-el7-10.noarch.rpm
--启动mysql服务
systemctl start mysqld.service
--查看mysql状态服务
systemctl status mysqld.service
--关闭数据库服务
systemctl stop mysqld.service
--进入数据库
mysql -u root -p
--查询文件
find / -name my.cnf
--编辑文件
vi server.xml
--查看文件内容
cat echarts
剪切文件
mv layuiweb.war /opt/
--删除文件
rm -rf layuiweb.war
--杀进程
kill -9 5565
--查看当前路径
pwd
--查看进程
netstat -anp | grep 8080
--退出当前路径
exit
--退出(推荐)
logout
--清屏
clear
--查看ip
ifconfig
--性能分析
top
--显示系统内存的使用情况
free -m
--显示目前在Linux系统上的文件系统的磁盘使用情况统计
df -h

--服务器之前传文件

scp  /home/helpteach/project/mallupload/1509681299449.png wasadmin@10.127.40.25:/home/test

====================20200810=============================
--退出远程连接
logout
 
--创建application.properties
 文件
touch application.properties
 
--编译application.properties
 文件
vim application.properties 
  
--查看application.properties
 文件
cat application.properties 
 
查看端口为8080的线程
netstat -anp | grep 8080
  
--结束端口为8080
运行的线程
kill -9 1606
 
--删除application.properties 文件
rm application.properties 
--查看当前所在目录
pwd
 
--删除images文件夹
rmdir images
--设置系统运行级别
inittab[3]
--保存信息到磁盘
sync
 
--查看文件内容
cat /etc/passwd
 
cat /ect/group
cat /etc/shadow
 
--创建多级目录
mkdir -p mi/nn
 
-- 创建mi
 文件夹
mkdir mi
 
--删除mi文件夹,mi文件夹包含文件
rm -rf mi
 
--修改文件名字(将a.txt文件名改为b.txt)
mv a.txt  b.txt
 
--将文件aaa.txt移到home文件夹下面
mv aaa.txt  /home
 
--查看aaa.txt中的内容
less aaa.txt 
 
--当前目录写入到a.txt文件中,a.txt不存在就创建,存在就覆盖
ll > a.txt
 
查看a.txt中的内容
more a.txt 
 
--当前目录追加到a.txt
ll >> b.txt
 
--将hello写入到c.txt中
echo "hello" >c.txt 
 
---当前目录写入到home文件夹下info.txt中
ll /home > /home/info.txt
 
--日历写入到home文件夹下mycal
cal > /home/mycal
 
--查看环境配置
echo $PATH
 
--查看/etc/profile
 文件中前五行,默认前五行
head -n 5 /etc/profile
 
head -n 10 /etc/profile
 
--查看/etc/profile
 文件中最后五行
tail /etc/profile
 
tail -n 5 /etc/profile
 
--可以做日志监听
tail -f mydata.txt 
 
--创建软连接,cd linkBoot
 进入home目录下
ln -s /home linkBoot
 
删除软连接
rm -rf linkBoot
--查看历史操作命令
hisory
 
--执行历史第n行命令
!n
--将历史命令导入到mylinux.txt文件中
history >> mylinux.txt
=================================================================================
 
 
posted @ 2019-07-26 23:36  爱河  阅读(154)  评论(0编辑  收藏  举报