Linux - NewbieThis 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
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.
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.
If the message is correct, it is the permission or owner of the parent folder(s) that are the problem.
Open a konsole, it will open in your /home/rich directory. You can show directory ownership and permissions with the command 'ls -dl /home/rich' Don't use the quotes, and add what ever the path you need to know about to the above. The standard place to find the trash in in the folder called desktop. It is possible to move it, so you may have to look for it.
Ownership is changed with the command chown and permissions are altered with chmod. If you are running KDE, you can open Konqueror with the house icon on the desktop. By right clicking on the icon, you will get a pop up window, there is a Properties option. Click it, and you will get a tabbed set of properties. There is a tab for permissions and it show the owner. I think if you are not the owner, you have to change at the command line.
So what probably happen is that you 'su'-ed while in your home directory or some else with more privileges than you deleted the parent folder. Now you won't see the folder in your home directory because it's in the recycle bin. I would have thought this would have gone to the root user's bin but maybe someone can enlighten me on why not.
What you need to do is empty the recycle bin as root in your GUI space.
The full path is the directories to the file in question. All paths in linux start from the root designated as / so your home directory is /home/rich where home is a folder on the root, and rich is a folder in home. The further in you go the directories are separated by the / character.
Quote:
I typed the ls -dl /home/rich and get this:
drwxr-xr-x 60 rich rich 4096 2007-12-17 22:45 /home/rich
This output, note the d at the beginning. This says it is a directory. The rwx is the permissions for rich, you can read write and execute anything in your home directory. Note, rich is the owner, and the group for this directory. Others can only read and execute the files.
To find any file from the command prompt, known as konsole in KDE, you can use the find command, or you can use the loacte command. I prefer locate because it is much faster than find. Open a konsole and swith to root using the 'su' command ( no quotes). Give the root password. Then run the command 'updatedb' without the quotes. That will build a database on your system of all files. It will take a few minutes to complete. You will see lots of disk activity. Once done type as a regular user 'locate thenameofthefileyou wanttofind' No quotes. The file name does not need to be complete, if you are not sure of the spelling. Case does matter, so be careful there.
It still just tells me that the file is in the trash. I appreciate this, and write down all the commands I use in a notebook, and what I did with those commands. You just now showed me a valuable tool of how to find any file.
To delete any file, it is easiest to change to the directory where the file is. So from a command prompt, say from your home directory, do a 'cd .trash' without the quotes. That should put you in the hidden directory trash. Notice the period before trash. That makes the file system treat the directory as hidden. Continue that until you are in the directory where the file is.
To delete the file run the command 'rm filetobedeleted' without the quotes and spell the file name including case correctly. If you have permission, the system will ask you are you sure, respond with a 'y'. The file should be gone. If you don't have permission, do a 'ls -l filetobedeleted' ( no quotes ) and see who owns it. If it is root, run the command suing 'sudo rm filetobedeleted'
Mow isn't all this typing fun? If you start to type a looooog file name, press the tab key. If what you have typed is unique to all things in the directory you are in, then the system will complete the looooog file name. Try it, it saves your finger tips...
Of course you cad delete any file you have permission for from any directry. You do that by preceding the file name to be deleted with the path to the file.
Another slick thing, learn to use cut and paste in the command line. Run the locate command. When you see the file you want top blow away, highlight it with the mouse pointer, copy and paste that at the command line, after you the the 'rm' command. Press enter, and you will discover you don't need to type out that long string.
What you need to do is search for the folder where that file is in. Write the complete pathname down and put it here on LinuxQuestions.
Now type in the console:
Quote:
cd insert your just written down pathname here
cd stands for 'Change Directory'.
Then type:
Quote:
ls -a
ls stands for 'List'. -a is a option for ls that shows hidden files and folders as well. Now you have a list of files and the file you want to delete should be there too. Now type:
Quote:
sudo rm insert the file you want to delete here
sudo gives you operator rights for everything you type in next to sudo. rm stands for 'ReMove'.
And the same error message appears when I try to empty the trash.
Is it the ellipses (,,,) that precede the filename?
" /...gspca.mod "
VINCENT is correct, you are not in the directory where the files are. The string to commas indicate there are more directories. Try my cut and paste method. Do the locate, type cd and then paste the path from the locate command and press enter. That should get you to the correct directory.
Then the only obstacle will be the permission and file owner.
I am embarrassed, and I apologize for being so ignorant. But I really do not understand what you are telling me. I've read the last 2 posts several times, but I can't understand what to do.
I don't know the whole path name for the file name because it is "..." I don't know what it is. But the locate command did tell me it's in .Trash.
And I apologize, but I don't understand what you're telling me with the cut and paste method.
It's not critical that I remove this file from the trash. If it's too much of a hassle to help me further, I will understand. And I thank you for what you've taught me already.
I don't use the GUI tools much, certainly not the trash can.
Just did a test on my Gnome desktop (not Ubuntu, but should be similar). .Trash is empty except for the expected "dot" and "dot-dot". Delete something from the GUI, it appears under .Trash, and the handy-dandy icon gets some crumpled paper. Cute...
Delete the file (from .Trash) from a terminal, and the icon reverts to "empty".
Sooo ... given that @MooseMagnet is just trying to empty the trash, if it were me I'd just do this from a terminal
If your only concern is to empty the trash - as pointed by syg00 - why not change owner of all the trash content and then delete it? E.g. something like this
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.