Shell脚本攻略学习笔记十二之mktemp命令
2023-09-14 09:13:15 时间
Shell脚本攻略学习笔记十二之mktemp命令
mktemp — create a temporary file or directory
- Create a temporary file as follows
[root@server4 shells]# mktemp
/tmp/tmp.MeH1jVsPRi
- To create a temporary directory, use the following commands
[root@server4 shells]# mktemp -d
/tmp/tmp.AThosQe1lF
[root@server4 shells]# cd /tmp/tmp.AThosQe1lF/
[root@server4 tmp.AThosQe1lF]# ll
total 0
- To just generate a filename without actually creating a file or directory, use this:
[root@server4 shells]# mktemp -u
/tmp/tmp.3z6y2RQlUp
[root@server4 shells]# cd /tmp/tmp.3z6y2RQlUp
-bash: cd: /tmp/tmp.3z6y2RQlUp: No such file or directory #提示不存在
- To create the temporary filename according to a template, use:
[root@server4 shells]# mktemp test.XXX
test.okb
[root@server4 shells]# mktemp test.xxx
mktemp: too few X's in template ‘test.xxx’
[root@server4 shells]# mktemp test.XX
mktemp: too few X's in template ‘test.XX’
[root@server4 shells]# mktemp test.XXX
test.xv6
[root@server4 shells]# mktemp HH.XXX
HH.8Yy
[root@server4 shells]# mktemp LIUBAI.XXX
LIUBAI.vZ9
相关文章
- Python 学习笔记 列表 for 循环 xxx XXX
- MyBatis 源码学习笔记(二)- MyBatis 进阶(Part A)
- git 命令学习笔记
- event.srcElement 用法笔记
- Unity3D学习笔记9——加载纹理
- 深度学习笔记(七)–ResNet(残差网络)
- 操作系统的概念 (OS学习笔记)
- JavaScript笔记(2) 构造函数和原型
- Java基础入门笔记01——JAVASE,EE,ME 常用Dos命令,JVM,JRE,JDK「建议收藏」
- Redis笔记
- PetaLinux学习笔记 2
- cycleGAN笔记
- 工程伦理复习笔记(全)
- ES6 学习笔记(五)基本类型Boolean
- 一周技术学习笔记(第94期)-为什么很多leader都喜欢做闭环
- docker使用笔记 I -- Dockerfilebuildrunkill
- Django+Celery学习笔记5——定时推送消息
- Rust学习笔记Day18 智能指针Cow/MutexGuard
- 【笔记】在HTML中用meta控制浏览器默认模式
- 学习小组Day7笔记--大姚
- 【多媒体】多媒体架构(面向GPT的学习笔记记录)
- Linux防火墙iptables学习笔记(三)iptables命令详解和举例
- Linux防火墙iptables学习笔记(三)iptables命令详解和举例
- Redis高频面试查缉手册(redis高频面试笔记)
- Nginx学习笔记之事件驱动框架处理流程
- JavaScript学习笔记之JS函数