LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices


Reply
  Search this Thread
Old 09-24-2019, 01:43 AM   #1
StepNjump
Member
 
Registered: Jul 2011
Posts: 32

Rep: Reputation: Disabled
Ghost files in /usr/.Trash-0/files ????


My df on /var was getting high (61%)

I attempted to delete all files in /usr/.Trash-0/files using nemo (rooted). There was 6GB of old stuff in there... Thought I deleted everything

but no!

When I du -h | grep /var, nothing was changed so I tried
du -hx /var/.Trash-0/files as sudo -i and there is nothing left in there either.

yet when I do a du -hs /var I show 8.5GB while in df -h | grep var, it's consistent with the du command. Still running at 61%.

Did I delete anything? Where did they go??

Ghost files???

Thanks for your input.

Pierre StepNjump
 
Old 09-24-2019, 01:56 AM   #2
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
This is a little confusing.
It seems you changed from /usr to /var halfway through your post??? Why?
Generally speaking, there shouldn't be any .Trash directories in either /usr or /var!
Please show us full command output, no paraphrasing.
And since you already work on the command line, don't use nemo for finally deleting your files, use 'rm'.
And don't use nemo "rooted".

Last edited by ondoho; 09-24-2019 at 01:57 AM.
 
1 members found this post helpful.
Old 09-24-2019, 02:23 AM   #3
StepNjump
Member
 
Registered: Jul 2011
Posts: 32

Original Poster
Rep: Reputation: Disabled
Hi, thanks for getting back to me so quickly!

Sorry.. What happened is that a few days ago, I found out that my /var was full at 99% so I had to find a way to remove some files. then I found out that snap 'older' applications were still in the system, so I followed the directions to remove those which it provided me with a few extra MBs of room but still not enough. Then I deleted some temp files in there which didn't make any difference.

snap list --all | while read snapname ver rev trk pub notes; do if [[ $notes = *disabled* ]]; then snap remove "$snapname" --revision="$rev"; fi; done

Then later in his post, the guy mentionned that after running this script, the user also had to empty the trash bin on /var.

WHICH got me to be curious so..

i did this:
sudo find / -type d -name *Trash*

Found out there was a hidden trash bin in /var under /var/.Trash-0 so I deleted everything in ../files which provided me a few extra GB of elbow room.

Then I looked for other trash bins using the find command above.

That's when I found the /usr/ hidden trash bin in there also...

Sorry for the confusion. It was a lack of attention on my part. I guess I'm getting tired. My original question really had to do with the /usr trash.

Ok! Noted not to run nemo as root. Would you mind telling me what the main reason is for it please? I'm always afraid to use rm -rf having heard so many horror stories in the past! But ok, point well taken and thanks for that.

I know my FHS is a little bit complex because when I installed this system, I was told that it's better to install /var /usr /etc /home and other folders on separate partitions which I did! In a way, I kind of gotten used and started to like it that way to be honnest with you. If it weren't for that installation, I would have never known that I had multiple installations of snap and flatpak versions of all kinds. I wouldn't have found out that these partitions also contained hidden trash bins! So it's all good....

Here is an shortened version of my df -h
As you can see, I have 5.3 GB free on /usr. Before I deleted the files in the hidden trash, it was showing the same amount of data on this partition...

/dev/sda12 12G 6,1G 5,3G 54% /usr
tmpfs 7,6G 111M 7,5G 2% /dev/shm
tmpfs 5,0M 4,0K 5,0M 1% /run/lock
tmpfs 7,6G 0 7,6G 0% /sys/fs/cgroup
/dev/sda8 598M 1,6M 552M 1% /srv
/dev/sda5 488M 219M 234M 49% /boot
/dev/sda11 15G 8,5G 5,6G 61% /var


root@CA7:/usr/.Trash-0# du -hs /usr/.Trash-0
1,8M /usr/.Trash-0

I guess those files were either ghost files or if were really true files, they never deleted....
Weird..

Thanks again for your help.

Pierre

Last edited by StepNjump; 09-24-2019 at 02:25 AM.
 
Old 09-24-2019, 05:36 AM   #4
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian sid
Posts: 2,683

Rep: Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783
graphical file managers tend not to delete files by default.
Instead they move then to "trash"
and you empty it


I'm not sure what happens if you use a graphical file manager to delete files in the hidden trash dir
Does it move them to where they already are?

you need to be clear on how you are deleting things


IMO, graphical file managers are only good for viewing thumbnails of documents


here is something you may find useful
the command ncdu

it is a comandline based du with ncurses

https://dev.yorhel.nl/ncdu/
some screenshots
https://dev.yorhel.nl/ncdu/scr


assuming Debian ( or one of its derivatives )
Code:
sudo apt install ncdu
you can also delete with it ( no trash so be careful )
 
1 members found this post helpful.
Old 09-24-2019, 01:43 PM   #5
StepNjump
Member
 
Registered: Jul 2011
Posts: 32

Original Poster
Rep: Reputation: Disabled
Firerat, thank you very much. This is a very nice one (midnight commander style). It's nice also because you can see at a glance the size of every directories in relation to others.
thank you very much for your help.

Pierre
 
Old 09-24-2019, 01:47 PM   #6
StepNjump
Member
 
Registered: Jul 2011
Posts: 32

Original Poster
Rep: Reputation: Disabled
Well, I guess we'll never know where the files went but doesn't really matter. I learned
- not to ever use nemo or any other app in sudo mode due to security issues that may arise
- not to delete files using nemo but rather use ncdu or rm -r /directory

Thank you guys. I will close this thread.
Thanks for both of your help.

Pierre, StepNjump
 
  


Reply



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
Trash is Full. Empty Trash before moving more files/folders to Trash. wdarledge Slackware 45 12-13-2017 03:53 PM
Compromised? Files "/usr/lib.hwm", "/usr/lib.pwd", "/usr/lib.pwi" Klaus Pforte Linux - Security 4 09-28-2004 11:33 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop

All times are GMT -5. The time now is 07:09 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
Open Source Consulting | Domain Registration