[SOLVED] How to unlock multiple files at the same time on Linux Mint?????
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
How to unlock multiple files at the same time on Linux Mint?????
Hello!
I'm looking for help on how to unlock thousands and thousands of files at the same time so as to avoid having to do it one by one which would take me a life time!
To cut a long story short when my friend was installing Linux on my laptop he didn't move my folders from windows onto an external hard drive before installing Linux. He managed to recuperate them but they all came back locked.
All the folders are named "recup_dir.1" all the way to "recup_dir.4502" (so 4503 folders in total!)
I am aware of the command to unlock files: sudo chown username file
This works fine for individual files but I don't know of a way to delete multiple files at the same time for example "recup_dir.1 - recup_dir.4502"
Does anyone know how I can delete them all at the same time???
If you mean to actually delete them, and that is all, you can use wildcards for this. For example (and in your case):
Code:
rm -rf recup_dir*
[Note - using -rf will not prompt you before removing the files. I highly recommend you run the following to see what exactly is going on, and to manually tell it which ones you want deleted:]
rm -i recup_dir*
One last thing, please, Josh...or anyone else for that matter ;-)
I've now deleted all the files using the wildcard you recommended: "rm -rf recup_dir*, except now I have one (unlocked) folder called "bup" full of locked files labelled "recup_dir.1" - "recup_dir.2286" (so, 2286 files in total which is like 40G worth of unwanted stuff). For some reason these don't seem to want to be unlocked or deleted and they weren't touched when I used the wildcard: rm -rf recup_dir*
If I try to unlock them using: sudo chown username recup_dir*
I get this message as if they don't exist:
chown: cannot access `recup_dir*': No such file or directory
and if I try to unlock individual files such as: sudo chown petros recup_dir.1
I get this message:
chown: cannot access `recup_dir.1': No such file or directory
I think it must have something to do with the fact that they're in a folder (the name of which is "bup") but I can't understand why they can't be unlocked or deleted or why the folder should be a problem.
If this is not what you were asking for then please let me know more specifically how I can show you exactly what it is you need to help me. I'm very new to Linux so I'm still trying to get to grips with everything!!!
Oh ok. Well I'm talking about with the directory that has all of the files you are working with. And for future reference, can you please use code tags?
Ok, sorry about the code tags. I just looked up what you mean by that so will use them next time. I actually just managed to delete those files by simply going in as the administrator, which I don't remember being able to do before, so all is good now.
Thanks a lot for all your help. I really appreciate it.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.