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.
1. rm file command removes the file named "file" and it doesn't store that
file in the trash, because you are deleting that file through command
prompt. But if you delete anything on command prompt it doesn't go to
trash.
If you try to delete same file in graphics mode it will be sent to
trash.
2. Normally > is used to save the output of the command to a file.
rm file > /dev/null will not save the output to any file as you
specify /dev/null, because /dev/null is a null pointer.
if you use
rm file > file1 then it will delete the file "file" and just create
an empty file named file1, because rm file doesn't give any output.
Normally redirection is used to to store output of some ls dir like
commands or with customized scripts.
for example
ls -l > file2
3. There is no such tool like Disk cleanup in linux. Normally it is not
required. Because of multiple advantages of ext3 filesystem is is not
required. But as size of your data increases OS stores data in
fragements. So in such cases you may need to run fsck to improve read
performance.
But in case of filesystem related problem fsck command is used to check
and repair filesystem. But fsck command is used in runlevel1 or unmount
partitions and then run fsck command.
If you try to delete same file in graphics mode it will be sent to trash.
Deletion and trash has nothing to do with graphics or text mode. It has to do with whether the tool doing the deleting understands 'deletion' or 'movement to trash'. There are several graphical file managers which delete files and, while I can't think of one, I'm sure a console file manager with a trash command would be trivial.
Quote:
Originally Posted by vedang
Because of multiple advantages of ext3 filesystem is is not required. But as size of your data increases OS stores data in fragements. So in such cases you may need to run fsck to improve read performance.
Ext3 isn't the only filesystem available for Linux. Though it is true that there are a variety of them that are good and few or none do defragmentation. But, I think what Paris Heng is asking is more for a decrapulator than a defragger. Basically, no, there isn't a disk cleanup tool, but Linux tends to generate nowhere near as much crap as Windows and tends to concentrate it in the various tmp directories (which can generally be safely emptied) and in /var, where things like logrotate and whatnot are generally set up by your distro to keep the crap to a reasonable and reasonably steady level. As far as your dotfiles in $HOME, it'd basically be up to you to police that how you wanted.
Well, there are a few applications that do secure file deletion, if that is what you had in mind. Apply them and you can rest assured that no-one will be able to retrieve them behind your back. The number of file systems they can handle is very limited, though, ext2 in most cases and perhaps also ext3 but that is about it.
Linux does not have a registry unlike Windows, which is precisely the part that tends to need most cleaning. There is little point in using windows-like cleaners on Linux.
Thanks for the information. But i still wonder, if i using rm file, like you mentioned it did not go to trash. It is remove to somewhere else? Or it just vanish after the removal?
Basically, this bit from unlink(2) should explain it pretty clearly:
Quote:
unlink() deletes a name from the filesystem. If that name was the last link to a file and no processes have the file open the file is deleted and the space it was using is made available for reuse.
If the name was the last link to a file but any processes still have the file open the file will remain in existence until the last file descriptor referring to it is closed.
Basically, IOW, it is rendered inaccessible to most tools and, when nothing's using it anymore and the space is needed, it will be overwritten.
I don't much trust any of these new-fangled .biz domains, but you might like
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.