nixCraft Linux Forum

nixCraft

Linux Tech Support Forum

To delete files in Trash

This is a discussion on To delete files in Trash within the CentOS / RHEL / Fedora forums, part of the Linux Distribution category; Hi all, I have some files with root permission in trash which can't be deleted even after logged in as ...


Go Back   nixCraft Linux Forum > Linux Distribution > CentOS / RHEL / Fedora

Register FAQ Members List Calendar Forgotten your password? Mark Forums Read
  #1 (permalink)  
Old 07-02-2008, 12:12 PM
Junior Member
User
 
Join Date: Jul 2008
My distro: Red Hat
Posts: 1
Rep Power: 0
Ramya is on a distinguished road
Default To delete files in Trash

Hi all,
I have some files with root permission in trash which can't be deleted even after logged in as root. I used USB which contained windows virus and I deleted the same in Red Hat Linux. Now I want to empty the trash. I deleted the folder trash from root and I created it newly. But still this files are there in my user login. Please suggest me the possible way to delete these files.

Thanks in advance.
Ramya.L.
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 09-08-2008, 09:59 AM
Junior Member
User
 
Join Date: Sep 2008
My distro: CentOS
Posts: 1
Rep Power: 0
musicaly is on a distinguished road
Default Trash can fix

I also had this problem. There were things in the trash can that had root privileges. The root account doesn't have very good access to them. Anyways, I figured out the solution.

Open a terminal while in your regular account (not root account). go to the trash directory using this command:
Code:
cd ~/.Trash/
That will take you to the correct folder in your terminal. Now you login as root by issuing the following command:
Code:
su
it will prompt you for the root password. Enter it and you will still be within your .Trash directory! Now all you need to do is delete the files using this command:
Code:
rm -rf *
This will delete everything in the trash can including everything that had root privileges. To turn your terminal normal again without root privaleges, all you need to do is enter the command:
Code:
exit
And you will be back to where you were before you switched to root.

I hope that helps !
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
Script to delete a set of files in Remote machine ashok333 Shell scripting 4 05-09-2008 08:24 PM
How do I delete copyright protected files? raj Getting started tutorials 5 03-25-2008 01:48 AM
i need a script to delete one folder with files on my ftp silver_ch Shell scripting 1 03-27-2007 11:15 AM
Linux find and delete files cbzee Linux software 4 12-20-2006 01:01 PM
can ext3 securely delete files Linux software 1 01-11-2006 01:08 PM


All times are GMT +5.5. The time now is 03:22 AM.


Powered by vBulletin® Version 3.7.4 - Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36