当前位置:网站首页>Liunx instruction
Liunx instruction
2022-06-29 20:15:00 【There are poems and distant places】
liunx Instructions
- 1. ls( see file )
- 2. mkdir( Create folder )
- 3. touch ( create a file )
- 4. cat( View content )
- 5. rm -rf( Delete file )
- 6. vi( modify )
- 7. Modify environment variables
- 8. docker exec -it( Into the container )
- 9. ls -lah( Show hidden files )
- 10. cp( Copy command )
- 11. docker logs -f ( View container log )
- 12. Clear container log
1. ls( see file )
ls
2. mkdir( Create folder )
mkdir Folder name
3. touch ( create a file )
touch file name
4. cat( View content )
cat file name
5. rm -rf( Delete file )
rm -rf deamon.json
6. vi( modify )
1.vi + filename // Enter file edit mode
2. Press i, Enter insertion mode
3. Press esc sign out
4. Press shift+ : Number Then input wq sign out
7. Modify environment variables

1. Open editor
vim /etc/profile
2.$PATH:( route 1):$PATH:( route 2)
The first environment The second environment
8. docker exec -it( Into the container )
docker exec -it Containers ID /bin/bash
9. ls -lah( Show hidden files )
ls -lah
10. cp( Copy command )
cp file name Catalog
11. docker logs -f ( View container log )
docker logs -f logstash( Container name )
12. Clear container log
New file docker-clear-log, Put it in /usr/local/bin/ Under the table of contents , The contents of the document are as follows :
#!/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
Give the file corresponding permissions , I only gave its owner read / write permission to execute , Others have no permission to execute :
chmod 700 /usr/local/bin/docker-clear-log
Last , perform
docker-clear-log <container>
边栏推荐
- How to use filters in jfinal to monitor Druid for SQL execution?
- [buuctf.reverse] 142_[SUCTF2019]babyunic
- La collection numérique Meng xiangshun, artiste national du tigre peint, est disponible en quantité limitée et est offerte avec Maotai de l'année du tigre
- [sword finger offer] 51 Reverse pair in array
- XSS漏洞
- Zotero期刊自動匹配更新影響因子
- Foxit software was invited to appear at the 2022 advanced manufacturing digital intelligence development forum
- 使用Gunicorn部署web.py应用
- As the "only" privacy computing provider, insight technology is the "first" to settle in the Yangtze River Delta data element circulation service platform
- Flume ng configuration
猜你喜欢
![[compilation principle] semantic analysis](/img/2e/9c17da3dbc758b2985e55201c73f99.png)
[compilation principle] semantic analysis

How to set a pod to run on a specified node

Flume configuration 2 - ganglia for monitoring

Lock4j -- distributed lock Middleware -- customize the logic of lock acquisition failure
![[fishing artifact] code tool for lowering the seconds of UI Library -- form part (I) design](/img/ad/0efd744334bf648b149aa1841b58af.png)
[fishing artifact] code tool for lowering the seconds of UI Library -- form part (I) design

Three.js开发:粗线的画法

关于印发宝安区重点产业项目和总部项目遴选及用地保障实施细则(2022修订版)的通知

苹果iPhone手机升级系统内存空间变小不够如何解决?

Etcd database source code analysis - put process of server

Flume配置4——自定義Source+Sink
随机推荐
Nutch2.1 distributed fetching
proxmox集群节点崩溃处理
Software engineering - principles, methods and Applications
Union find
Notepad++--宏(记录操作过程)
0/1 score planning topic
File contains vulnerability
第二章(物理层)
Flume theory
How to use filters in jfinal to monitor Druid for SQL execution?
Flume configuration 3 - interceptor filtering
Linux安装MySQL5
一个超赞的开源的图片去水印解决方案
Application of twelve factors (4)
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?
剑指 Offer 59 - II. 队列的最大值
There is no small green triangle on the method in idea
Flume配置4——自定义Source+Sink
What is a database? Database detailed notes! Take you into the database ~ you want to know everything here!
.NetCore统一认证授权学习——Run(1)