Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
06-10-2004, 04:45 PM
|
#1
|
LQ Newbie
Registered: Jun 2004
Posts: 3
Rep:
|
Terminal command for GUI command "Remove to trash"
I'm new to linux and I've found that in the GUI interface, the command "Remove to Trash" (in Fedora Core 2) places the file in the directory /root/trash (or whatever). However, in the terminal when I go to the trash directory, command ls (list) shows no files, and ll command also shows none. However, the GUI interface still shows the file existing in the trash directory (visual). It can be moved, manipulated, etc, but not in the terminal form.
Assuming that the GUI trash folder can be opened and the files restored back onto Desktop in this instance, then in the terminal, what are the commands to do this? (this being, restore. If the terminal doesn't show the files in the trash directory, basically, how can I get them to show, and be able to move back onto an area using the cp comand.)
Why is it that the file exists in GUI, but not in the terminal interface? If it's something along the lines of "Gui recognizes that the file was removed at a point", then what file or command tells the GUI interface that the file currently exists in trash and can be restored when moved? Can this command or file be accessed in terminal ( I would assume so, I'm just ignorant to the process).
One more thing, deleting a file in the terminal, command rm, removes it entirely. What is the equal alternative to it in GUI interface, so that the file is removed completely, not just "Removed to trash", stored in a trash directory, and still taking up space.
thanks, much appreciated.
|
|
|
06-10-2004, 06:51 PM
|
#2
|
Senior Member
Registered: Aug 2003
Location: Birkenhead/Britain
Distribution: Linux From Scratch
Posts: 2,073
Rep:
|
cd ~/.Trash
ls
mv * ~/Desktop
To add the delete command to the right click menu open nautilus and click Edit> Preferences> Behaviour> Trash> Include a Delete command that bypasses Trash
|
|
|
06-23-2004, 02:01 AM
|
#3
|
Member
Registered: Mar 2004
Distribution: Ubuntu Feisty
Posts: 641
Rep:
|
Quote:
Originally posted by Andrew Benton
cd ~/.Trash
|
I got a message saying no such file or directory?
|
|
|
06-29-2004, 01:50 PM
|
#4
|
LQ Newbie
Registered: Sep 2003
Location: Portland, Oregon
Distribution: Debian and Gentoo
Posts: 27
Rep:
|
asdf
Hi, the trash in KDE 3.1 is located at ~/Desktop/Trash ( '~' = meta-character (special character) which gives your shell the location of your home directory). I don't know about any other versions of KDE, Gnome or any other window managers though, so what you might try is typing the command:
find ~/ -name *[Tt]rash*
The above command will look for any file or directory that contains the word 'trash' or 'Trash', and display their location. You could then 'cd' into the locations to see if they contain the files that are in your trash can. If the files in your trash can through your GUI are there, then there you have it, your trash can location.
As for the rm command, I don't believe there is such a thing as a command-line command which doesn't destroy the record of a file off the hardrive. Once you delete a file it's gone, though I've heard you can recover it through a more knowledgeable process which I am not too familiar with. Each directory has a list of inodes, which point to files, the inode #'s are looked up in an inode table and the hardrive address is found through this inode table, when a file is deleted (using rm for example), the inode entry in that directory is deleted and the space is marked as free (I believe)... so to recover a file that is lost somehow you can find the hardrive address that contained the blocks of memory you deleted, and if the memory has not been overwritten by some other data, you can access your old data (the deleted file wasn't deleted, it was marked as free). However this is no "trash-can" because it's completely inconsistent and I believe completely un-documented. So anyhousels, I'm pretty sure that by default no shell comes with any command that will store the deleted files in a "trash-can", but there may be a command you can download that would do just that, or if you know scripting or programming at all, it wouldn't be hard at all to make your own command that saves the file in another place before marking the space free.
|
|
|
All times are GMT -5. The time now is 05:40 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|