Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

[solved]how to sudo delte files in trash?

New to Debian (Or Linux in general)? Ask your questions here!
Post Reply
Message
Author
hthi
Posts: 213
Joined: 2015-05-09 15:43
Has thanked: 1 time

[solved]how to sudo delte files in trash?

#1 Post by hthi »

debian 8 64bit
nautilus

In order to delete files in /var/log, I ran

Code: Select all

gksudo nautilus
In trash none of the deleted files are present.
Is there a command which will delete files in trash? Thank you.
Last edited by hthi on 2017-08-19 17:43, edited 1 time in total.

User avatar
4D696B65
Site admin
Site admin
Posts: 2696
Joined: 2009-06-28 06:09
Been thanked: 86 times

Re: how to sudo delte files in trash?

#2 Post by 4D696B65 »

Check trash in /root

User avatar
debiman
Posts: 3063
Joined: 2013-03-12 07:18

Re: how to sudo delte files in trash?

#3 Post by debiman »

most gui file managers i know, do not use the trashcan when run as root.
in other words, deleted is deleted, and you most probably got a warning about it.
Is there a command which will delete files in trash? Thank you.
if there are no files in root's trashcan, there's nothing to delete.
otherwise: empty trash (in file manager).

hthi
Posts: 213
Joined: 2015-05-09 15:43
Has thanked: 1 time

Re: how to sudo delte files in trash?

#4 Post by hthi »

Thank you.
You say, if you run

Code: Select all

gksudo nautilus
then, what you click right and move to trash, is deleted? Are you sure?
It does say move to trash.
Further more in /var/log I moved to trash about 40gb of files. I did it
because the system was close to 0gb of free space.
After restarting I was unable to start the gui desktop. Telling me
the system could not run because of lack of free space.
Pressing ctrl + alt + f2, in command line, I got
other files deleted. After restart of the computer, I was able to
start the gui desktop.
Indicating that the files in /var/log I moved to trash are located
somewhere. If they are, I cannot find the location. I
navigated to /home/pc/.local/share/Trash. The 3 folders were
empty.

User avatar
Zjho
Posts: 48
Joined: 2016-09-15 17:46

Re: how to sudo delte files in trash?

#5 Post by Zjho »

Was /root/.local/share/Trash empty too ?
My nautilus 3.22.3-1 does use this directory with root although log file sizes are controlled by other means.

User avatar
debiman
Posts: 3063
Joined: 2013-03-12 07:18

Re: how to sudo delte files in trash?

#6 Post by debiman »

hthi wrote:You say, if you run

Code: Select all

gksudo nautilus
then, what you click right and move to trash, is deleted? Are you sure?
no, i did not say that.
i said that in my experience, the filemanager does not support moving stuff to trash when run as root.
yours obviously does, and you have to find out where it puts the files, or look in the trash can and empty or restore them, what ever.
Further more in /var/log I moved to trash about 40gb of files. I did it
because the system was close to 0gb of free space.
After restarting I was unable to start the gui desktop. Telling me
the system could not run because of lack of free space.
yes, because moving things to trash is not the same as deleting.
I cannot find the location. I
navigated to /home/pc/.local/share/Trash. The 3 folders were
empty.
no, when you run as root, it means you run as the user named root, essentially.
so the trash can is somewhere in /root, probably /root/.local/share/Trash

PS:
system maintenance should be done in other ways.
through the terminal, or preferably programmatically.
i'm sure systemd provides a mechanism for roatating or limiting log files.

hthi
Posts: 213
Joined: 2015-05-09 15:43
Has thanked: 1 time

Re: how to sudo delte files in trash?

#7 Post by hthi »

Thank you. The trashed files were located in

Code: Select all

/root/.local/share/Trash/files
sudo rm deleted the files.
through the terminal, or preferably programmatically.
I thought sudo gksudo nautilus would be faster.

Post Reply