Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How does the Linux system rename multiple files at a time?

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

The editor today takes you to understand how the Linux system renames multiple files at a time. The knowledge points in the article are introduced in great detail. Friends who feel helpful can browse the content of the article with the editor, hoping to help more friends who want to solve this problem find the answer to the problem. Let's follow the editor to learn more about "what is the way to rename multiple files in the Linux system at a time".

Rename multiple files at a time in Linux system

You can do this using find:

Find-name "* poster.jpg"-exec sh-c'mv "$0" ${0% mv *} / folder.jpg "'{}'\; description

Here, for each file name that matches, execute:

Sh-c'mv "$0" ${0% folder.jpg *} / folder.jpg "'{} 'where' {}'is the file name passed to command_string as an argument:

Mv "$0" ${0% Universe *} / folder.jpg "so, finally, $0 will have a file name.

Finally, ${0% / *} / folder.jpg extends to the path of the old file name and adds / folder.jpg.

Example

Notice that I replaced mv with echo

$find-name "* poster.jpg"-exec sh-c 'echo "$0" ${0% echo *} / folder.jpg "' {}'\ . / anotherpath/my-poster.jpg. / anotherpath/folder.jpg. / path/to/file/test-poster.jpg. / path/to/file/folder.jpg. / tuxisthebest/ohyes/path/exm/bold-poster.jpg. / tuxisthebest/ohyes/path/exm/folder.jpg what is a Linux system Linux is a free-to-use and free-spread UNIX-like operating system, is a POSIX-based multi-user, multi-task, multi-thread and multi-CPU operating system Using Linux, you can run major Unix tools, applications, and network protocols.

Thank you for your reading, the above is the whole content of "what is the way to rename multiple files in the Linux system at a time". Friends who learn to learn to hurry up to operate it. I believe that the editor will certainly bring you better quality articles. Thank you for your support to the website!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report