LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 01-16-2012, 04:59 AM   #1
Regicide
LQ Newbie
 
Registered: Jan 2012
Posts: 6

Rep: Reputation: Disabled
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???

Thank you in advance, it's much appreciated
 
Old 01-16-2012, 05:54 AM   #2
corp769
LQ Guru
 
Registered: Apr 2005
Posts: 5,817

Rep: Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002
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*
Cheers,

Josh
 
Old 01-16-2012, 06:31 AM   #3
Regicide
LQ Newbie
 
Registered: Jan 2012
Posts: 6

Original Poster
Rep: Reputation: Disabled
Josh, you're an absolute legend. I first tried your wildcard trick which presented me with the following message

rm: cannot remove `recup_dir.4052/f403014328.txt': Permission denied

so then I just used the same formula but with: sudo chown username recup_dir*

and it worked a treat

Thanks a million!!!
 
Old 01-16-2012, 06:53 AM   #4
Regicide
LQ Newbie
 
Registered: Jan 2012
Posts: 6

Original Poster
Rep: Reputation: Disabled
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.

Any ideas of how I can get around this one?????

Thanks (again!) in advance!!!!
 
Old 01-16-2012, 07:13 AM   #5
corp769
LQ Guru
 
Registered: Apr 2005
Posts: 5,817

Rep: Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002
Could you show me the output of "ls -al" within the top level directory?
 
Old 01-16-2012, 07:33 AM   #6
Regicide
LQ Newbie
 
Registered: Jan 2012
Posts: 6

Original Poster
Rep: Reputation: Disabled
I think this is what you mean?

~ $ ls -al /

total 208
drwxr-xr-x 21 root root 4096 2011-06-01 15:57 .
drwxr-xr-x 21 root root 4096 2011-06-01 15:57 ..
drwxr-xr-x 2 root root 4096 2011-11-02 15:43 bin
drwxr-xr-x 4 root root 4096 2011-07-10 16:36 boot
drwxr-xr-x 19 root root 4300 2012-01-16 11:20 dev
drwxr-xr-x 144 root root 12288 2012-01-16 11:20 etc
drwxr-xr-x 6 root root 4096 2011-11-09 07:22 home
lrwxrwxrwx 1 root root 36 2011-06-01 15:56 initrd.img -> boot/initrd.img-2.6.38-8-generic-pae
drwxr-xr-x 19 root root 4096 2011-06-01 15:56 lib
drwx------ 2 root root 16384 2011-06-01 15:49 lost+found
drwxr-xr-x 2 root root 4096 2012-01-16 11:20 media
drwxr-xr-x 2 root root 4096 2011-04-21 17:50 mnt
drwxr-xr-x 4 root root 4096 2011-05-22 12:26 opt
dr-xr-xr-x 170 root root 0 2012-01-16 08:45 proc
drwx------ 19 root root 4096 2011-12-27 11:34 root
drwxr-xr-x 2 root root 12288 2012-01-03 08:18 sbin
drwxr-xr-x 2 root root 4096 2011-03-21 08:26 selinux
drwxr-xr-x 2 root root 4096 2011-04-25 23:50 srv
drwxr-xr-x 13 root root 0 2012-01-16 08:45 sys
drwxrwxrwt 16 root root 110592 2012-01-16 12:17 tmp
drwxr-xr-x 11 root root 4096 2011-04-25 23:56 usr
drwxr-xr-x 14 root root 4096 2011-04-28 12:42 var
lrwxrwxrwx 1 root root 33 2011-06-01 15:56 vmlinuz -> boot/vmlinuz-2.6.38-8

If not then maybe this?????

~ $ ls -al


total 560
drwxr-xr-x 39 petros petros 135168 2012-01-16 11:32 .
drwxr-xr-x 6 root root 4096 2011-11-09 07:22 ..
drwx------ 3 petros petros 4096 2011-06-01 16:28 .adobe
-rw------- 1 petros petros 8370 2012-01-16 10:39 .bash_history
-rw-r--r-- 1 petros petros 220 2011-06-01 15:52 .bash_logout
drwxr-xr-x 2288 petros petros 69632 2012-01-15 10:53 bup
drwx------ 15 petros petros 4096 2012-01-16 08:45 .cache
drwx------ 3 petros petros 4096 2011-06-01 21:24 .compiz
drwxr-xr-x 20 petros petros 4096 2012-01-15 18:19 .config
drwx------ 3 petros petros 4096 2011-06-01 16:00 .dbus
drwxr-xr-x 10 petros petros 4096 2012-01-16 08:47 Desktop
-rw-r--r-- 1 petros petros 73 2012-01-16 08:45 .dmrc
drwxr-xr-x 2 petros petros 20480 2012-01-12 12:24 Documents
drwxr-xr-x 7 petros petros 4096 2012-01-16 11:19 Downloads
drwxr-xr-x 12 petros petros 4096 2011-12-19 19:22 .dvdcss
-rw------- 1 petros petros 16 2011-06-01 16:00 .esd_auth
drwxr-xr-x 2 petros petros 4096 2011-10-07 09:34 .fontconfig
drwx------ 5 petros petros 4096 2012-01-16 08:45 .gconf
drwx------ 2 petros petros 4096 2012-01-16 11:22 .gconfd
-rw-r----- 1 petros petros 0 2011-11-09 20:44 .gksu.lock
drwxr-xr-x 11 petros petros 4096 2012-01-15 23:12 .gnome2
drwx------ 2 petros petros 4096 2011-06-01 16:00 .gnome2_private
drwxr-xr-x 2 petros petros 4096 2012-01-02 22:44 .gstreamer-0.10
-rw-r--r-- 1 petros petros 162 2012-01-16 08:45 .gtk-bookmarks
dr-x------ 2 petros petros 0 2012-01-16 08:45 .gvfs
-rw------- 1 petros petros 66780 2012-01-16 08:45 .ICEauthority
drwxr-xr-x 2 petros petros 4096 2011-06-01 16:01 .icons
drwxr-xr-x 3 petros petros 4096 2011-08-04 11:40 .java
drwxr-xr-x 3 petros petros 4096 2011-06-01 21:21 .libreoffice
drwxr-xr-x 6 petros petros 4096 2011-06-01 22:50 .linuxmint
drwxr-xr-x 3 petros petros 4096 2011-06-01 16:00 .local
drwxr-xr-x 2 petros petros 4096 2011-12-25 12:47 LUIS BOOK
drwx------ 3 petros petros 4096 2011-06-01 16:52 .macromedia
drwxr-xr-x 4 petros petros 4096 2011-06-01 15:52 .mozilla
drwxr-xr-x 2 petros petros 4096 2011-08-21 22:03 .mplayer
drwxr-xr-x 2 petros petros 4096 2011-06-01 16:00 .nautilus
drwxr-xr-x 15 petros petros 4096 2011-06-01 15:52 .opera
drwxr-xr-x 3 petros petros 12288 2011-12-26 15:46 Pictures
drwx------ 3 petros petros 4096 2011-06-02 15:42 .pki
-rw-r--r-- 1 petros petros 675 2011-06-01 15:52 .profile
drwx------ 2 petros petros 4096 2012-01-16 08:45 .pulse
-rw------- 1 petros petros 256 2011-06-01 16:00 .pulse-cookie
drwxr-xr-x 2 petros petros 4096 2012-01-07 09:46 Random
-rw-r--r-- 1 petros petros 237 2011-12-27 10:49 .registry
drwx------ 5 petros petros 4096 2012-01-14 00:01 .Skype
drwxr-xr-x 6 petros petros 4096 2011-11-10 11:53 SOAS shit
-rw-r--r-- 1 petros petros 0 2011-06-01 16:03 .sudo_as_admin_successful
-rw-r--r-- 1 petros petros 3058 2012-01-15 10:15 testdisk.log
drwxr-xr-x 2 petros petros 4096 2011-06-01 16:01 .themes
drwx------ 4 petros petros 4096 2011-06-01 16:14 .thumbnails
drwx------ 4 petros petros 4096 2011-06-05 18:21 .thunderbird
-rw-r--r-- 1 petros petros 684 2011-06-01 22:48 .xscreensaver-getimage.cache
-rw------- 1 petros petros 27664 2012-01-16 11:20 .xsession-errors
-rw------- 1 petros petros 30571 2012-01-15 23:12 .xsession-errors.old

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!!!

Thanks so much!!!
 
Old 01-16-2012, 08:11 AM   #7
corp769
LQ Guru
 
Registered: Apr 2005
Posts: 5,817

Rep: Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002
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?
 
Old 01-16-2012, 08:30 AM   #8
Regicide
LQ Newbie
 
Registered: Jan 2012
Posts: 6

Original Poster
Rep: Reputation: Disabled
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.
 
Old 01-16-2012, 08:44 AM   #9
corp769
LQ Guru
 
Registered: Apr 2005
Posts: 5,817

Rep: Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002
Oh ok, no problem! And if you can, could you kindly mark your thread as solved using the thread tools located at the top of the page? Thanks!

Cheers,

Josh
 
Old 01-16-2012, 09:06 AM   #10
Regicide
LQ Newbie
 
Registered: Jan 2012
Posts: 6

Original Poster
Rep: Reputation: Disabled
No problem. Thread is certainly solved!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
need to unlock after multiple wrong telnet logins fredcook12 Linux - Newbie 2 09-11-2011 07:51 PM
id3ed manipulating multiple files at a time bucovaina78 Linux - Software 0 10-30-2008 12:44 PM
Linux Mint - how to disable multiple virtual desktops SunsetRider Linux - Desktop 1 05-27-2008 07:00 PM
how to grab multiple files at the same time in SFTP? HiOctane21 Programming 1 05-02-2004 02:32 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:27 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration