当前位置:网站首页>liunx指令
liunx指令
2022-06-29 20:01:00 【有诗亦有远方】
liunx指令
1. ls(查看文件)
ls
2. mkdir(创建文件夹)
mkdir 文件夹名
3. touch (创建文件)
touch 文件名
4. cat(查看内容)
cat 文件名
5. rm -rf(删除文件)
rm -rf deamon.json
6. vi(修改)
1.vi + filename //进入文件编辑模式
2.按i,进入插入模式
3.按esc退出
4.按shift+ : 号 然后输入 wq退出
7. 修改环境变量

1.打开编辑
vim /etc/profile
2.$PATH:(路径1):$PATH:(路径2)
第一个环境 第二个环境
8. docker exec -it(进入容器)
docker exec -it 容器ID /bin/bash
9. ls -lah(显示隐藏文件)
ls -lah
10. cp(复制命令)
cp 文件名 目录
11. docker logs -f (查看容器日志)
docker logs -f logstash(容器名)
12. 清除容器日志
新建文件docker-clear-log,放在/usr/local/bin/目录下,文件内容如下:
#!/bin/bash -e
if [[ -z $1 ]]; then
echo "No container specified"
exit 1
fi
if [[ "$(docker ps -aq -f name=^/${1}$ 2> /dev/null)" == "" ]]; then
echo "Container \"$1\" does not exist, exiting."
exit 1
fi
log=$(docker inspect -f '{
{
.LogPath}}' $1 2> /dev/null)
truncate -s 0 $log
赋予文件相应的权限,我仅仅给了它所有者读写执行的权限,其他人无权限执行:
chmod 700 /usr/local/bin/docker-clear-log
最后,执行
docker-clear-log <container>
边栏推荐
- Etcd database source code analysis - put process of server
- 剑指 Offer 59 - II. 队列的最大值
- 14,04 millions! Appel d'offres pour la mise à niveau de la base de données relationnelle et du système logiciel Middleware du Département des ressources humaines et sociales de la province du Sichuan!
- Sword finger offer 41 Median in data stream
- How to use filters in jfinal to monitor Druid for SQL execution?
- 【摸鱼神器】UI库秒变低代码工具——表单篇(一)设计
- 文件包含漏洞
- Ovirt database modify delete node
- ASP. Net core creates razor page and uploads multiple files (buffer mode) (Continued)
- npm ERR! fatal: early EOF npm ERR! fatal: index-pack failed
猜你喜欢

Linux Installation mysql8

There are more than 20 databases in a MySQL with 3306 ports. How can I backup more than 20 databases with one click and do system backup to prevent data from being deleted by mistake?

Understanding of software test logic coverage

JVM(4) 字節碼技術+運行期優化

Flume configuration 1 - basic case

【编译原理】语法分析
![[observation] softcom power liutianwen: embrace change and](/img/d8/a367c26b51d9dbaf53bf4fe2a13917.png)
[observation] softcom power liutianwen: embrace change and "follow the trend" to become an "enabler" of China's digital economy
![[notes] take notes again -- learn by doing Verilog HDL – 008](/img/7f/0ca73446247455ac4d8f9667083a87.png)
[notes] take notes again -- learn by doing Verilog HDL – 008

Performance improvement at the cost of other components is not good

Deficiencies and optimization schemes in Dao
随机推荐
[sword finger offer] 51 Reverse pair in array
Spark存储体系底层架构剖析-Spark商业环境实战
Flume configuration 4 - Custom source+sink
Chapter II (physical layer)
1404万!四川省人社厅关系型数据库及中间件软件系统升级采购招标!
As the "only" privacy computing provider, insight technology is the "first" to settle in the Yangtze River Delta data element circulation service platform
Performance improvement at the cost of other components is not good
Oracle11.2.0.4-rac cluster hang analysis record
Flume configuration 1 - basic case
剑指 Offer 59 - II. 队列的最大值
剑指 Offer 66. 构建乘积数组
CorelDRAW最新24.1.0.360版本更新介绍讲解
Flume配置4——自定義Source+Sink
Foxit software was invited to appear at the 2022 advanced manufacturing digital intelligence development forum
Flume配置4——自定义Source+Sink
网站压力测试工具——Webbench
A keepalived high availability accident made me learn it again!
一个mysql里有3306端口下,一个mysql有20多个数据库,怎么一键备份20多个数据库,做系统备份,防止数据误删除?
[network orientation training] - Enterprise Park Network Design - [had done]
JVM (2) garbage collection