Skip to content

Magenaut

  • Home
  • Topics
    • Notes
    • Tutorial
    • Bug fixing
    • Extension
    • Server
  • Q&A
  • Privacy Policy
  • About

rename

What’s the difference between ‘rename’ and ‘mv’?

August 11, 2022 by Magenaut

It’s not completely clear to me, but what is the difference between mv and rename (from util-linux-ng 2.17.2 as /usr/bin/rename)? Are there advantages of one over the other beyond rename accepting regular expressions and mv doesn’t? I believe rename can also handle multiple file renames at once, whereas mv does not do this.

Categories Q&A, Unix & Linux Tags mv, rename Leave a comment

How to replace spaces in all file names with underscore in Linux using shell script?

August 11, 2022 by Magenaut

I tried following shell script which should replace spaces from all xml filenames

Categories Q&A, Unix & Linux Tags files, find, mv, rename, shell-script Leave a comment

How can I move files by type recursively from a directory and its sub-directories to another directory?

August 11, 2022 by Magenaut

What would be a good way to move a file type from a directory and all of its sub-directories?

Categories Q&A, Unix & Linux Tags command-line, directory, find, rename Leave a comment

How can I find files and then use xargs to move them?

August 11, 2022 by Magenaut

I want to find some files and then move them.

Categories Q&A, Unix & Linux Tags find, rename, xargs Leave a comment

move file by list in file (with leading whitespace)

August 11, 2022 by Magenaut

I have a file that contains file names. For example:

Categories Q&A, Unix & Linux Tags files, rename, shell-script Leave a comment

How do open files behave on linux systems?

August 10, 2022 by Magenaut

I just renamed a log file to “foo.log.old”, and assumed that the application will start writing a new logfile at “foo.log”. I was surprised to discover that it tracked the logfile to its new name, and kept appending lines to “foo.log.old”.

Categories Q&A, Unix & Linux Tags files, open-files, rename Leave a comment

mv * folder (avoiding ‘cannot move’ error)

August 10, 2022 by Magenaut

Anytime I want to move thousands of files to a new folder, I always encounter the same problem. > mkdir my_folder > mv * my_folder mv: cannot move 'my_folder to a subdirectory of itself 'my_folder' While I think that the error above is harmless (is it?) I am wondering if there is a way of … Read more

Categories Q&A, Unix & Linux Tags rename, zsh Leave a comment

“mkdir foo; svn mv * foo”

August 10, 2022 by Magenaut

I often want to do some variant of this idiom:

Categories Q&A, Unix & Linux Tags directory, rename, shell, wildcards Leave a comment

Recursively rename e-mail files from .txt to .eml

August 10, 2022 by Magenaut

Directory “$d” contains a few thousand e-mail files with the .txt extension. To open them in my e-mail client, I need to rename them to .eml

Categories Q&A, Unix & Linux Tags find, rename Leave a comment

Renaming files to have lower case extensions with ‘rename’

August 10, 2022 by Magenaut

I’m trying to currently rename a large set of files and have been using quite kludgy methods to do so, such as:

Categories Q&A, Unix & Linux Tags perl, regular-expression, rename Leave a comment
Older posts
Newer posts
← Previous Page1 Page2 Page3 … Page5 Next →
  1. michealSmith07 on Is there a way to dynamically refresh the less command?August 21, 2022

    That is a very nice post. I like this post.

  2. anonymous on Fix libwacom9 dependency issue when upgrade DebianJune 27, 2022

    saved my day!! Thanks for the help…

  3. sreedhar on Fix libwacom9 dependency issue when upgrade DebianMay 10, 2022

    Thanks its working

  4. saintnick on Fix libwacom9 dependency issue when upgrade DebianMay 10, 2022

    remove libwacom2 worked for me as well

  5. ranafoul on Fix libwacom9 dependency issue when upgrade DebianApril 22, 2022

    apt remove libwacom2 helped on kali 2022.01. gr8

.net ajax asp.net asp.net-core asp.net-mvc asp.net-mvc-3 asp.net-mvc-4 asp.net-web-api bash c# command-line css custom-post-types custom-taxonomy dataframe dictionary django entity-framework functions gridview html iis javascript jquery json linux list matplotlib numpy pandas php plugin-development plugins posts python python-2.7 python-3.x security shell shell-script sql string vb.net webforms wp-query

© 2026 Magenaut • Built with GeneratePress