LinuxQuestions.org
Review your favorite Linux distribution.
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 06-09-2013, 12:01 PM   #1
andrew.comly
Member
 
Registered: Dec 2012
Distribution: Lubuntu 12.10
Posts: 34
Blog Entries: 2

Rep: Reputation: Disabled
Question sudo rm -rfv ~.Trash-1000 can't delete


I would like to empty my trash can. I am signed on as the only user of this Lubuntu 13.04 OS, but even though I use: "sudo rm -rfv ~/.Trash-1000", sudo shred -fuz, chmod -x filename and even sudo chown -R a 2067508202, the system never lets me delete. And when I navigate to this file and ls -la, the innermost jpg files are all in pink. Part of the log as below:

a@a-NC210-NC110:/media/a/AC/.Trash-1000/expunged/2067508202$ ls -la
總計 1276
drwx------ 1 a a 4096 12月 26 23:46 .
drwx------ 1 a a 4096 5月 19 22:57 ..
-rw------- 1 a a 97559 5月 21 2004 Sammi_2012 09 28.jpg
-rw------- 1 a a 82785 5月 21 2004 TeacherReviews-Vanessa0803.jpg
-rw------- 1 a a 71366 5月 21 2004 TeacherReviews-Vanessa0824.jpg

a@a-NC210-NC110:/media/a/AC/.Trash-1000/expunged/2067508202$ shred -fuz TeacherReviews-Vanessa0803.jpg
shred: TeacherReviews-Vanessa0803.jpg:無法移除: 沒有此一檔案或目錄
a@a-NC210-NC110:/media/a/AC/.Trash-1000/expunged/2067508202$ shred -fuz 學生外師課程建異表_CA20120908.jpg
shred: 學生外師課程建異表_CA20120908.jpg:無法移除: 沒有此一檔案或目錄
a@a-NC210-NC110:/media/a/AC/.Trash-1000/expunged/2067508202$ cd ..
a@a-NC210-NC110:/media/a/AC/.Trash-1000/expunged$ sudo chown -R a 2067508202
a@a-NC210-NC110:/media/a/AC/.Trash-1000/expunged$ sudo rm -Rf /media/a/AC/.Trash-1000/expunged/2067508202
rm: 無法移除 ‘/media/a/AC/.Trash-1000/expunged/2067508202’: 目錄不是空的
a@a-NC210-NC110:/media/a/AC/.Trash-1000/expunged$
 
Old 06-09-2013, 10:04 PM   #2
GlennsPref
Senior Member
 
Registered: Apr 2004
Location: Brisbane, Australia
Distribution: Mageia Studio-13.37 Kubuntu.
Posts: 3,325
Blog Entries: 33

Rep: Reputation: 199Reputation: 199
Hi, This has happend to me, but the trash was on a usb stick.

Eventually, I used the filemanager to restore the files, and then changed the files permissions, etc

sent them to the trash again and was able to empty the trash and delete the trash folder.

Maybe it will work for you.

Glenn
 
Old 06-10-2013, 09:04 AM   #3
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora
Posts: 2,440

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
what is the error you are getting?
 
Old 06-10-2013, 01:53 PM   #4
rtmistler
Member
 
Registered: Mar 2011
Location: Milford, MA. USA
Distribution: MontaVista, Ubuntu, MINT
Posts: 964
Blog Entries: 7

Rep: Reputation: 443Reputation: 443Reputation: 443Reputation: 443Reputation: 443
I was going to recommend that you rename the files using command completion or something. Or do
Quote:
ls -l > t.sh
and then edit the t.sh to make it a bash script where you take the file names from the ls output and rename them to be normally named files like 1.txt, 2.txt, and so forth. However, I can't figure out what's up here, instead of having bad file names, you have bad data in the result of your ls command.

1.) Recommend you restart if you haven't done so.
2.) If those files were from a removable drive which is no longer mounted, place it back in; if possible and try to delete them that way.
 
Old 06-10-2013, 02:21 PM   #5
thedaver
Member
 
Registered: Jan 2010
Posts: 65

Rep: Reputation: 21
You can try to manually clean house by using the inode references to the files that have the problematic characters.

1) Go to your folder with a problem file.

2) 'ls -il' (( ell ess space dash eye ell ))

This lists the files with their inode reference, on my system the inode is the first column.
[ example: assume inode you want to remove is 7832263 ]

3) find . -inum 7832263 -exec rm -i {} \;

4) Rinse and repeat.
 
1 members found this post helpful.
Old 06-25-2013, 12:28 AM   #6
andrew.comly
Member
 
Registered: Dec 2012
Distribution: Lubuntu 12.10
Posts: 34
Blog Entries: 2

Original Poster
Rep: Reputation: Disabled
Red face Translation for Chinese error messages

Quote:
Originally Posted by lleb View Post
what is the error you are getting?
Pardon me for not translating this earlier:
a@a-NC210-NC110:/media/a/AC/.Trash-1000/expunged/2067508202$ ls -la
Total 1276
drwx------ 1 a a 4096 12 26 23:46 .
drwx------ 1 a a 4096 5 19 22:57 ..
-rw------- 1 a a 97559 5 21 2004 Sammi_2012 09 28.jpg
-rw------- 1 a a 82785 5 21 2004 TeacherReviews-Vanessa0803.jpg
-rw------- 1 a a 71366 5 21 2004 TeacherReviews-Vanessa0824.jpg
-rw------- 1 a a 0 6月 10 00:07 ForeignTeacherTraineeClassSuggestionSheet_CA20120908.jpg
-rw------- 1 a a 99572 5月 21 2004 ForeignTeacherTraineeClassSuggestionSheet_CA20120926.jpg
-rw------- 1 a a 78082 5月 22 2004 ForeignTeacherTraineeClassSuggestionSheet_Ca20121031.jpg
-rw------- 1 a a 78082 5月 22 2004 ForeignTeacherTraineeClassSuggestionSheet_Can20120921.jpg
-rw------- 1 a a 89501 5月 22 2004 ForeignTeacherTraineeClassSuggestionSheet_Ei20120924.jpg
-rw------- 1 a a 95546 5月 22 2004 ForeignTeacherTraineeClassSuggestionSheet_Ei20121022.jpg
-rw------- 1 a a 79424 5月 23 2004 ForeignTeacherTraineeClassSuggestionSheet_Ma20121128.jpg
-rw------- 1 a a 69347 5月 23 2004 ForeignTeacherTraineeClassSuggestionSheet_MA20121214.jpg
-rw------- 1 a a 106965 5月 23 2004 ForeignTeacherTraineeClassSuggestionSheet_Q20120904.jpg
-rw------- 1 a a 72037 5月 23 2004 ForeignTeacherTraineeClassSuggestionSheet_Qu20121022.jpg
-rw------- 1 a a 96888 5月 23 2004 ForeignTeacherTraineeClassSuggestionSheet_Qu20121030.jpg


a@a-NC210-NC110:/media/a/AC/.Trash-1000/expunged/2067508202$ shred -fuz TeacherReviews-Vanessa0803.jpg
shred: TeacherReviews-Vanessa0803.jpg:Cannot remove: No such file or directory exists.
a@a-NC210-NC110:/media/a/AC/.Trash-1000/expunged/2067508202$ shred -fuz ForeignTeacherTraineeClassSuggestionSheet_CA20120908.jpg
shred: ForeignTeacherTraineeClassSuggestionSheet_CA20120908.jpg:Cannot remove: No such file or directory exists.
a@a-NC210-NC110:/media/a/AC/.Trash-1000/expunged/2067508202$ cd ..
a@a-NC210-NC110:/media/a/AC/.Trash-1000/expunged$ sudo chown -R a 2067508202
a@a-NC210-NC110:/media/a/AC/.Trash-1000/expunged$ sudo rm -Rf /media/a/AC/.Trash-1000/expunged/2067508202
rm: Cannot remove: ‘/media/a/AC/.Trash-1000/expunged/2067508202’: Directory not empty
a@a-NC210-NC110:/media/a/AC/.Trash-1000/expunged$
 
Old 06-25-2013, 12:44 AM   #7
andrew.comly
Member
 
Registered: Dec 2012
Distribution: Lubuntu 12.10
Posts: 34
Blog Entries: 2

Original Poster
Rep: Reputation: Disabled
How to you use the file manager to restore?

Quote:
Originally Posted by GlennsPref View Post
Hi, This has happend to me, but the trash was on a usb stick.

Eventually, I used the filemanager to restore the files, and then changed the files permissions, etc

sent them to the trash again and was able to empty the trash and delete the trash folder.

Maybe it will work for you.

Glenn
I am running gksudo nautilus via terminal. In both situations I right click, then for nautilus I select the "move to..." option, then thy to move it to the folder "a" of the removable hard disk. I encounter the error: "Error encountered when trying to move file to /media/a/AC/a directory." with a "No such file or directory exists" under "Display more .." option below.
 
Old 06-25-2013, 06:31 PM   #8
GlennsPref
Senior Member
 
Registered: Apr 2004
Location: Brisbane, Australia
Distribution: Mageia Studio-13.37 Kubuntu.
Posts: 3,325
Blog Entries: 33

Rep: Reputation: 199Reputation: 199
Midnightcommander, dolphin and konqueror have this, "restore trash to original folder" (or something like that).

open the waste bin as a folder, right click file, select restore(dolphin)
 
Old 06-26-2013, 06:18 PM   #9
andrew.comly
Member
 
Registered: Dec 2012
Distribution: Lubuntu 12.10
Posts: 34
Blog Entries: 2

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by GlennsPref View Post
Midnightcommander, dolphin and konqueror have this, "restore trash to original folder" (or something like that).

open the waste bin as a folder, right click file, select restore(dolphin)
pcmanfm & nautilus don't have the restore option when right clicking. On a previous installation of Lubuntu I tried installing and using dolphin, but then the whole system crashed and I had to conduct a new installation. I searched for Midnightcommander in synaptic package manager, but the search for such a program turned up nothing. Actually due to the previous crash I don't think installing KDE fm managers is a good idea. Thanks anyway!

Last edited by andrew.comly; 06-26-2013 at 06:19 PM. Reason: typo
 
Old 06-27-2013, 02:19 AM   #10
GlennsPref
Senior Member
 
Registered: Apr 2004
Location: Brisbane, Australia
Distribution: Mageia Studio-13.37 Kubuntu.
Posts: 3,325
Blog Entries: 33

Rep: Reputation: 199Reputation: 199
lmgtfy
Code:
midnight commander ubuntu 12.10
Code:
Midnight Commander — Ubuntu Apps Directory
apps.ubuntu.com › All Apps › Accessories‎
GNU Midnight Commander is a text-mode full-screen file manager. ... 2012 Canonical Ltd. Ubuntu and Canonical are registered trademarks of Canonical Ltd.
UbuntuUpdates - Package "mc" (quantal 12.10)
www.ubuntuupdates.org/package/core/quantal/universe/base/mc‎
Midnight Commander - a powerful file manager ... Release: quantal (12.10) ... Save this URL for the latest version of "mc": http://www.ubuntuupdates.org/mc ...
Install Midnight Commander (MC) 4.7.3 In Ubuntu ~ Web Upd8 ...
www.webupd8.org/2010/.../install-midnight-commander-mc-473-in.htm...‎
Jul 7, 2010 – Install Midnight Commander (MC) 4.7.3 In Ubuntu ~ Ubuntu / Linux blog. ... How To Get A Complete GNOME 3 Desktop In Ubuntu 12.10, ...
[ubuntu] midnight commander - Ubuntu Forums
ubuntuforums.org/showthread.php?t=1663139‎
Jan 9, 2011 – Thread: midnight commander ... http://ubuntuforums.org/showthread.php?t=2147295. Advanced reply ... Distro: Ubuntu 12.10 Quantal Quetzal ...
I think the package is called mc

Cheers

Last edited by GlennsPref; 06-27-2013 at 08:10 PM. Reason: colour.
 
Old 08-02-2013, 09:58 AM   #11
andrew.comly
Member
 
Registered: Dec 2012
Distribution: Lubuntu 12.10
Posts: 34
Blog Entries: 2

Original Poster
Rep: Reputation: Disabled
Cool "mc" results

cool program!

Unfortunately, midnight commander can only restore files that are on ext2 filesystem, I always like HDD that are compatible with windows, mac and linux in case of an emergency; thus this file is currently on NTFS.

Andrew

Last edited by andrew.comly; 08-02-2013 at 11:26 AM. Reason: append
 
Old 09-21-2013, 10:23 AM   #12
andrew.comly
Member
 
Registered: Dec 2012
Distribution: Lubuntu 12.10
Posts: 34
Blog Entries: 2

Original Poster
Rep: Reputation: Disabled
Below is another attempt after I learned about deleting files via their inode numbers. Notice how some files don't even have inode numbers:
a@a-NC210-NC110:/media/a/Seagate Expansion Drive/20130921/AC/媒体/音乐/pouch1$ ls -lia
ls: cannot access 百度歌词搜索_独一无二.htm: Input/output error
ls: cannot access 百度歌词搜索_说清楚.htm: Input/output error
ls: cannot access 眉飞色舞.mp3: Input/output error
ls: cannot access 说清楚.mp3: Input/output error
total 5500
324777 drwx------ 1 a a 4096 9月 21 21:47 .
324145 drwx------ 1 a a 16384 9月 21 20:58 ..
74 -rw------- 1 a a 638855 9月 21 21:47 a236.txt
325882 -rw------- 1 a a 2959360 8月 29 02:22 炫耀美丽.mp3
325883 -rw------- 1 a a 33792 8月 8 14:22 独一无二.mp3
325884 -rw------- 1 a a 1334319 8月 21 18:07 百度歌词搜索_天衣无缝.htm
325885 -rw------- 1 a a 638855 9月 21 21:27 百度歌词搜索_炫耀美丽.htm
? -????????? ? ? ? ? ? 百度歌词搜索_独一无二.htm
? -????????? ? ? ? ? ? 百度歌词搜索_说清楚.htm
? -????????? ? ? ? ? ? 眉飞色舞.mp3
? -????????? ? ? ? ? ? 说清楚.mp3
a@a-NC210-NC110:/media/a/Seagate Expansion Drive/20130921/AC/媒体/音乐/pouch1$ sudo find . -inum 325885 -exec rm -i {} \;
[sudo] password for a:
rm: remove regular file ‘./百度歌词搜索_炫耀美丽.htm’? y
rm: cannot remove ‘./百度歌词搜索_炫耀美丽.htm’: No such file or directory
find: `./百度歌词搜索_独一无二.htm': Input/output error
find: `./百度歌词搜索_说清楚.htm': Input/output error
find: `./眉飞色舞.mp3': Input/output error
find: `./说清楚.mp3': Input/output error
a@a-NC210-NC110:/media/a/Seagate Expansion Drive/20130921/AC/媒体/音乐/pouch1$

[My external HDD is not ext2, it's NTFS, thus mc won't work]

I also try chmod, as below, but the system just hangs.
chmod +x BaiduLyrics_flauntingbeauty.htm (this is a translation of 325885 above)
 
Old 09-21-2013, 06:38 PM   #13
John VV
Guru
 
Registered: Aug 2005
Posts: 12,603

Rep: Reputation: 1677Reputation: 1677Reputation: 1677Reputation: 1677Reputation: 1677Reputation: 1677Reputation: 1677Reputation: 1677Reputation: 1677Reputation: 1677Reputation: 1677
Quote:
My external HDD is not ext2, it's NTFS
now you inform us as to this

chmod will NOT work
ntfs dose NOT support file permissions

depending on how you are mounting this
fstab or a udev rule and NTFS-3g are responsible for mounting a ntfs drive
and simulating !!! the file permissions

so how is this drive mounted
 
2 members found this post helpful.
Old 09-21-2013, 07:01 PM   #14
Habitual
Senior Member
 
Registered: Jan 2011
Distribution: Slack14_64_Multilib
Posts: 3,042
Blog Entries: 4

Rep: Reputation: 734Reputation: 734Reputation: 734Reputation: 734Reputation: 734Reputation: 734Reputation: 734
Quote:
Originally Posted by John VV View Post
now you inform us as to this

chmod will NOT work
ntfs dose NOT support file permissions

depending on how you are mounting this
fstab or a udev rule and NTFS-3g are responsible for mounting a ntfs drive
and simulating !!! the file permissions
I finally had to fix something with my ntfs perms also. I went with
Code:
/dev/sdbX /path/to/mountpoint ntfs-3g    rw,uid=1000,gid=100,dmask=022,fmask=133 0 0
in my fstab.
Now I have correct Linux-style file perms for my rysnc backups

Why not just delete Trash-1000 from the usb drive instead of emptying it?
 
1 members found this post helpful.
Old 09-29-2013, 12:04 PM   #15
andrew.comly
Member
 
Registered: Dec 2012
Distribution: Lubuntu 12.10
Posts: 34
Blog Entries: 2

Original Poster
Rep: Reputation: Disabled
Question RE: how external ntfs HDD is mounted

Quote:
Originally Posted by John VV View Post
depending on how you are mounting this
fstab or a udev rule and NTFS-3g are responsible for mounting a ntfs drive
and simulating !!! the file permissions

so how is this drive mounted
John VV,

In case you mean what directory it's mounted under, it's under /media/a/AC, where “AC” is the name of the HDD. It mounts automatically as soon as I plug it into the USB port.

In case you mean directories: I don't have anything under /etc/fstab but I do have a /etc/fstab.d directory, however this is empty, even after I hit “Ctrl + h”. I looked at the wikipedia entry, and it said that some other versions of linux(like solarus) this might be under /etc/vfstab, but my directory doesn't have vfstab either. About udev: I do have this directory, and it has the following files: “applications.d(directory), sysctl.conf, ufw.conf, after.rules, after6.rules, before.rules, before6.rules”. The applications.d directory only has one file named cups (Common UNIX Printing System) in it. Finally about NTFS-3g, I don't have any directory like this in /etc.

Concerning man pages for commands, all 3 commands, as the man pages were output for all(see below)
a@a-NC210-NC110:~$ man udev
a@a-NC210-NC110:~$ man fstab
a@a-NC210-NC110:~$ man NTFS-3g
This shows that these commands are already installed on my system.

Concerning your suggestion to just delete “.Trash-1000” rather than emptying it”: some of the unremovable files are in the “.Trash-1000 folder”, but others are just in regular folders that when I ran a new rsync it just couldn't delete the files/folders on the ntfs drive like it naturally can on the internal ext4 formatted HDD. Concerning the “.Trash-1000” file, I do try to delete it, but I just get the error message “.Trash-1000: Unable to trash file: Invalid argument” when executing from pcmanfm. From terminal I'll execute “sudo rm -rfv .Trash-1000” then I get:
removed directory: ‘.Trash-1000/files’
removed ‘.Trash-1000/info/.Trash-1000.trashinfo’
removed ‘.Trash-1000/info/a.trashinfo’
removed ‘.Trash-1000/info/Sammi_2012 09 28.2.jpg.trashinfo’
removed ‘.Trash-1000/info/Sammi_2012 09 28.jpg.trashinfo’
removed directory: ‘.Trash-1000/info’
The above feedback from terminal is totally bogus since I'll go back into the .Trash-1000/expunged/2067508202 directory and those files are still there.

I'm not totally sure what you mean by how is the external portable HDD mounted.

Andrew
 
  


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
Retrieve files on exernal had drive .trash-1000 ryu Linux - Hardware 3 01-23-2013 06:29 PM
want to delete Trash contain D.suman4@yahoo.in Linux - Enterprise 1 11-10-2012 02:14 AM
Missing documents in .Trash-1000 QueenyLv Linux - Software 3 03-12-2011 11:19 AM
.Trash and .Trash-1000 sethusubbiah Linux - Newbie 6 07-31-2010 06:46 AM
delete from trash today53 Linux - Newbie 6 11-05-2003 10:32 AM


All times are GMT -5. The time now is 06:29 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration