|
||||||
| Forums FAQ | Members List | Search | Today's Posts | Mark Forums Read |
| ARCHIVES - Tips, Tricks & Tweaks Post your tips, tricks and tweaks about SuSE Linux in here. Please do not ask questions here - this is for factual information |
|
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
I wanted to make all the rm go to trash having accomplished it I thought I'd share may help a few new users and experienced a like. This works with KDE as the DE soz wouldn't know how to in gnome.
Edit your .bashrc to include the below next time you use the rm command it should end up in trash, rather than disappearing, good for those odd clangers. Code:
function mod_rm()
{
kfmclient move $* trash:/
}
alias rm="mod_rm"
|
|
|||
|
Quote:
/Geoff |
|
|||
|
No problem Geoff though I've noticed a slight problem just need to work away around it at the moment it won't do recursion
close Now to sort this bit out seems I posted to soon in excitement. I'm a doughnut it works fine at removing directories just was trying to pass -r to it. |
|
|||
|
you should be careful if you work a lot with scripts on the command line since most of these scripts are not written to escape aliases which are put in .bashrc. So if a script does some operation on a file and after that it deletes this file, the file won't be deleted but it'll end up in your trash bin, but still you'll get the false impression that it's deleted... if you run scripts frequently which operate on large files and after that delete them, you can easily fill up your file system because these files won't be deleted but will stay in your trash bin. It is better to choose a different alias name and not "rm" to not confuse scripts which are not written to escape things in .bashrc
maybe alias "trash" is better? |
|
|||
|
Valid point and something to take into consideration but my concern was to replace the default rm command. Not have an alternative.
I've not seen anything going into trash yet so it seems I may be OK with my usage. But I guess others wil have to judge for themselves. |
|
|||
|
why would you want to replace "rm" ? rm is there to delete files, not move them to some other place. I think it is much more logical to have the normal "rm" operate like it does and to have a "trash" alias if you are not sure about the deletion of a file so you use "trash" to move it to the trash bin
On some systems (Fedora comes to mind), if you only use "rm somefile" then "rm" will ask you for confirmation before deleting it so you'll have to use "rm -f somefile" to skip this confirmation. So to automatically avoid this confirmation step, people put in .bashrc a alias like alias rm="rm -f $*" Not so in SUSE, as when you issue "rm somefile" the "rm" version of SUSE is modified to not ask confirmation before deletion |
|
|||
|
Proabably not but I want rm to remove to trash when its invoked from the cli if you have a solution then I'm ears,
I'm not interested in alternatives I don't like the default disappear, I don't want to confirm. I can't remove rm from the users path easily. I want the opportunity of undoing a rm from th cli so if you have good practices then I'm listening. |
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|