Linux基本操作
发布时间:2020-12-13 23:38:17 所属栏目:Linux 来源:网络整理
导读:--退出远程连接 logout ? --创建application.properties ?文件 touch application.properties ? --编译application.properties ?文件 vim application.properties? ?? --查看application.properties ?文件 cat application.properties? ? 查看端口为8080的线
--退出远程连接
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
(编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |