Operating System - HP-UX
1748182 Members
3388 Online
108759 Solutions
New Discussion

Why no recycle bin in UNIX

 
Kapil Jha
Honored Contributor

Why no recycle bin in UNIX

Hello Gurus,
Can I have a quick discussion as to why unix creator did not include feature for recycle bin.Can we have trashcan kind of facility , like from AdvFS , in vxfs and HFS.

Your replies are highly appreciated.
BR,
Kapil

 

 

P.S. This thread has been moved from HP-UX > Databases to HP-UX > sysadmin. - Hp Forum Moderator

I am in this small bowl, I wane see the real world......
12 REPLIES 12
Kapil Jha
Honored Contributor

Re: Why no recycle bin in UNIX

Oops... I created thread in database , please move it to system admin.
BR,
Kapil
I am in this small bowl, I wane see the real world......
V. Nyga
Honored Contributor

Re: Why no recycle bin in UNIX

Hi Kapil,

CDE has a trashcan at the right side ...
You can use it when you work in the file manager of CDE.
If you use the command line (rm) then you would have to create an alias for rm.
For example
alias rm script
Your script has to move the files to $HOME/.dt/Trash.

Volkmar
*** Say 'Thanks' with Kudos ***
Dennis Handly
Acclaimed Contributor

Re: Why no recycle bin in UNIX

>I created thread in database, please move it to system admin.

(Moderators don't like moving from one category to another in popular forums, where they expect everyone to read every thread.)

Because big boys don't admit to making mistakes? ;-)

If you want one, you can roll your own rm. Here are some old threads about your topic:
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1166683
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1050654
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1033162
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=939680
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=66836
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=59753
James R. Ferguson
Acclaimed Contributor

Re: Why no recycle bin in UNIX

Hi Kapil:

Why no recycle bin? Well to save precious disk space no doubt in the days when disk, memory, I/O and CPU were precious commodities not to be capraciously wasted --- something that some bloated software would do well to remember in my opinion.

In keeping with DWIM (Do What I Mean), if you ask to remove a file it is removed. No messages; no fuss; poof!

Removing a file without futher ceremony conforms to Unix's Rule of Least Surprise: Do what was asked.

Regards!

...JRF...
V. Nyga
Honored Contributor

Re: Why no recycle bin in UNIX

@JRF - great, ROFL :-))))))))))))
*** Say 'Thanks' with Kudos ***
Bob E Campbell
Honored Contributor

Re: Why no recycle bin in UNIX

The CDE comment is on the right track. If you open up a DOS window and remove a file, it will not be placed in the recycle bin. If you use a file manager, most of them provide the support.

You can easily define a wrapper to rm to provide the ability from a shell window. Just be sure to define a cron job to empty the bin.
Kapil Jha
Honored Contributor

Re: Why no recycle bin in UNIX

Like in windows if we remove data from recycle bin then also some software recover data.
Why this was not developed in UNIX , if accedental we remove a file we only lose the inode link we have , file is physically present on the disk so this is my question
why no unrm??
sorry if m getting weired but curiosity ;)
BR,
Kapil
I am in this small bowl, I wane see the real world......
Dennis Handly
Acclaimed Contributor

Re: Why no recycle bin in UNIX

>if accidentally we remove a file we only lose the inode link we have, file is physically present on the disk

10 seconds later that area on the disk may be overwritten.
As Volkmar and Bob say, if you want unrm, use the trashcan in CDE.

>why no unrm??

Because a temporary limbo has to be designed into rm(1).
James R. Ferguson
Acclaimed Contributor

Re: Why no recycle bin in UNIX

Hi Kapil:

>Kapil: Like in windows if we remove data from recycle bin then also some software recover data. Why this was not developed in UNIX...why no unrm??

Again, I would respond with: Well, when do you *really* mean *remove*?

Certainly there are temporary files that processes create that would be a grand waste to confine to a recycle bin instead of casting them into oblivion.

If nothing else, you can create an alias for 'rm' that adds the '-i' switch to force you to confirm deletion in interactive settings:

# alias rm='rm -i'

Of course, this only applies to your current shell session and does not propagate to any script you run therein; nor unconditionally would you want it to do so.

If the idea of permanently removing a file bothers you, ask yourself if you *always* make a backup of every file you change?

As already noted, you can write a shell wrapper around a command and move or copy any file you want before manipulating it. In this fashion you can craft your own re-cycle bin.

A properly setup Unix server only allows the 'root' user to remove (or write to) "system" directories, like '/usr'. Non-root users can't harm your system, unless they promote themselves programatically or otherwise to a privileged level. As an administrator, you control (and hopefully prevent) this. Thus what a normal user does to hurt themselves is their own doing.

For me, it reduces to "think before you act", and have appropriate disaster recovery procedures in place for (hopefully rare) times of simple stupid, catastrophic mistakes.

Regards!

...JRF...