当前位置:网站首页>Rename file with command line
Rename file with command line
2022-07-27 19:17:00 【BasilGuo】
Rename file with command line
1.mv
I just want to rename one file, so I use mv to modify the filename
mv oldfilename newfilename
If necessary, you can use with directory. Just like:
mv ~/Documents/test.txt ~/Documents/test/test.txt
2.rename
However, when the file is very big, mv can behavior efficiently or not is a question.So, I need another solution.
Thus, I surf the Internet and find that I can use rename to rename myfile.
The usage is:
rename [-h|-m|-V] [-v] [-n] [-f] [-e | -E perlexpr]* |perlexpr [ files]
-n: list the file will be renamed
-v: list the file has been renamed
Yeah, it is a Perl expression, but I just know regex a little.
For instance, I’d like to rename “first_shell.sh” to “first.sh”, I can write:
rename ‘s/first_shell/first/’ *.sh
You can use man rename in terminal for help.
Poor User Experience~
边栏推荐
猜你喜欢

v-if,v-else,v-for

「测试新手百科」5 分钟快速上手Pytest 自动化测试框架

How to break the team with automated testing

I'm afraid I won't use the JMeter interface testing tool if I accept this practical case

Nacos的基本使用(1)——入门

进行接口测试时,连接数据库,对数据源进行备份、还原、验证操作

一篇让你掌握线程和线程池,还解决了线程安全问题,确定不看看?

The understanding of string in C.

搭建阿里云+typora+Picgo图床错误分析

There is a problem with the time zone when the idea connects to the database. The server returns invalid timezone is red Need to set ‘serverTimezone‘ property.
随机推荐
Nacos集群部署-高可用保证
Nacos基本概念和单机部署
Unity学习笔记(实现传送带)
Double insurance for line breaking
Kinect for Unity3d----KinectManager
换行问题双保险
normal distribution, lognormal distribution,正态随机数的生成
asp. Net experience
IDEA连接数据库时区问题,报红Server returns invalid timezone. Need to set ‘serverTimezone‘ property.
PHP字符串操作
Using functions to extract numbers from text strings in Excel
Electromagnetic field learning notes - vector analysis and field theory foundation
Dynamic proxy
idea优化小攻略
kettle EXCEL 累计输出数据
Introduction to assembly language (1)
How can I get started quickly when I change my career to soft testing and job hopping to a new company?
如何用自动化测试搞垮团队
Basic concepts of Nacos and single machine deployment
web UI 自动化测试:Selenium 语法详解 史上最全