DEV Community

Discussion on: Lazy habits in linux terminal

Collapse
 
itsjzt profile image
Saurabh Sharma

I like to use trash, It's a lot better tool. check it out! npmjs.com/package/trash-cli

Collapse
 
martyonthefly profile image
Sylvain Marty

Thanks, I'll give it a try ! :)

Thread Thread
 
itsjzt profile image
Saurabh Sharma

but don't forget to make alias, so you get trash when typing rm

Thread Thread
 
legolord208 profile image
jD91mZM2

That's a bad idea, scripts might use rm and it starts adding up to your trash. Also, if you keep the habit of using rm you might be less careful when using it on a machine that doesn't have trash installed.

Solution: For now, make rm print something like "no, use trash", and get a habit of using trash over rm.

Thread Thread
 
martyonthefly profile image
Sylvain Marty

Good observation!

In fact, I don't think I'll continue to use trash because it's relatively slow compared to rm. Finally, it's a part of my job to think before acting ¯_(ツ)_/¯.

Thread Thread
 
legolord208 profile image
jD91mZM2

No no no that's not what I meant! Even if I barely ever need to restore from trash, it's really nice to not feel worried you're destroying your system. Also, shouldn't moving directories be faster than deleting each file?

Thread Thread
 
martyonthefly profile image
Sylvain Marty

I'm guessing NodeJS fs is not as fast as the linux filesystem ? ^

Thread Thread
 
legolord208 profile image
jD91mZM2

You were using a NodeJS version of trash-cli? Try github.com/andreafrancia/trash-cli.

Thread Thread
 
martyonthefly profile image
Sylvain Marty

I tried the version mentioned earlier:
github.com/sindresorhus/trash-cli

I'll give a try to yours :)

Thread Thread
 
legolord208 profile image
jD91mZM2

Always choose the first result on Google ;)