LinuxQuestions.org
Register a domain and help support LQ
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 08-23-2008, 11:38 AM   #1
cmx08
Member
 
Registered: Aug 2008
Location: Malaysia
Distribution: Fedora Core
Posts: 35

Rep: Reputation: 15
How to open the trash folder and empty the trash in command line


Hi All

I m using Linux fedora core. Can I know how to open the trash folder and empty the trash in command line? I can't find the trash folder.

Thx.
 
Old 08-23-2008, 08:32 PM   #2
aus9
Guru
 
Registered: Oct 2003
Posts: 5,056

Rep: Reputation: Disabled
Code:
rm /home/name/.local/share/Trash/info/* /home/name/.local/share/Trash/files/*

change name to your name pls

check the pathway first in case your distro differs...I use a KDE sidux distro
 
Old 08-23-2008, 10:52 PM   #3
okos
Member
 
Registered: May 2007
Location: California
Distribution: Slackware/Ubuntu
Posts: 609

Rep: Reputation: 37
To be safe and not accidentally delete something by mistyping, I would do the following:

cd /home/name/.local/share/Trash/info/
ls
rm file name
or
rm -fr directory

you can use the wild card "*" as you please.

rm filename.*
 
Old 08-29-2008, 08:46 AM   #4
cmx08
Member
 
Registered: Aug 2008
Location: Malaysia
Distribution: Fedora Core
Posts: 35

Original Poster
Rep: Reputation: 15
Unhappy

Hi all thx for reply but i still can't open the trash folder.

Code:
[root@localhost /]# cd /home/chong/.local/share/Trash/files/
-bash: cd: /home/chong/.local/share/Trash/files/: No such file or directory
[root@localhost /]# cd /home/chong/.local/share/Trash/info/
-bash: cd: /home/chong/.local/share/Trash/info/: No such file or directory
[root@localhost ~]# cd /home/chong/.local/
-bash: cd: /home/chong/.local/: No such file or directory
It appear no such file or directory. One more thing I can't find the /.local in the /home/chong. Why?

Last edited by cmx08; 08-29-2008 at 09:14 AM.
 
Old 08-29-2008, 09:12 AM   #5
cmx08
Member
 
Registered: Aug 2008
Location: Malaysia
Distribution: Fedora Core
Posts: 35

Original Poster
Rep: Reputation: 15
Unhappy

Now i found the /.Trash directory in /home/chong directory but I can't see any file I delete.

Code:
[root@localhost ~]# cd /home/chong/.Trash
[root@localhost .Trash]# ls -la
total 16
drwx------  2 chong chong 4096 Aug 17 00:51 .
drwx------ 33 chong chong 4096 Aug 21 16:23 ..
[root@localhost .Trash]#
 
Old 08-29-2008, 09:15 AM   #6
arizonagroovejet
Senior Member
 
Registered: Jun 2005
Location: England
Distribution: SLED, openSUSE
Posts: 1,021

Rep: Reputation: 172Reputation: 172
Are you using GNOME or KDE? Last time I checked they kept their Trash in different places. This is one of those cases where what is important is what desktop environment you are using rather than what distro you are using.

KDE keeps the trash in ~/.local/share/Trash and you can empty from the command line using
Code:
ktrash --empty
Gnome I believe keeps it's trash in ~/.Trash and I guess to empty that from the command line you just us
Code:
rm -rf ~/.Trash/*
I Don't know about other desktop environments.

~/.local/share/Trash is the location used by applications that follow the XDG desktop standards from Freedesktop.org. The info directory is used to store information about when a file was put in to Trash and where it was before it was put in to Trash. This allows you to do things like restore a file back to it's original location and write scripts to do nifty stuff like automatically delete files from Trash once they've been in there for a certain amount of time. It's more sophisticated than just moving files in to ~/.Trash
 
  


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
Move to trash works beautifully, but empty trash .. different story. kd5eax Mandriva 2 12-04-2007 02:52 PM
Evolution: Can't Empty Trash; Summary and Folder Mismatch snickdog Linux - Software 1 03-17-2007 02:00 PM
Deleting files from command line goes to trash? HSN Linux - Enterprise 1 02-18-2007 11:38 PM
Evolution will not empty trash folder azebuski Linux - Software 0 05-25-2004 11:40 AM
empty trash Moleman Linux - Software 1 05-16-2003 12:23 PM


All times are GMT -5. The time now is 08:17 AM.

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