[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!
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.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
How to unlock multiple files at the same time on Linux Mint?????
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):
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!!!
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.