<?xml version="1.0" encoding="iso-8859-1"?>
<rss version="2.0">
<channel>
  <title>Linux Format forums</title>
  <link>http://linuxformat.com/forums/index.php</link>
  <description>Help, discussion, magazine feedback and more</description>
  <language>english</language>
  <copyright>(c) Copyright Sun May 19, 2013 4:11 pm by Linux Format forums</copyright>
  <managingEditor>webmaster@linuxformat.com</managingEditor>
  <webMaster>webmaster@linuxformat.com</webMaster>
  <pubDate>Sun May 19, 2013 4:11 pm</pubDate>
  <lastBuildDate>Sun May 19, 2013 4:11 pm</lastBuildDate>
  <docs>http://backend.userland.com/rss</docs>
  <generator>phpBB2 RSS Syndication Mod by Lucas</generator>
  <ttl>1</ttl>

  <image>
    <title>Linux Format forums</title>
    <url></url>
    <link>http://linuxformat.com/forums/</link>
    <description>Help, discussion, magazine feedback and more</description>
  </image>

                                      <item>
                                        <title>RE: Ahh what a day! bash and aliases</title>
                                        <link>http://linuxformat.com/forums/viewtopic.php?p=20069#20069</link>
                                        <description>&lt;br /&gt;
                                      Author: &lt;a href='http://linuxformat.com/forums/profile.php?mode=viewprofile&amp;u=3555'&gt;shifty_ben&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
                                      Posted: Tue Mar 28, 2006 3:31 pm&lt;br /&gt;&lt;br /&gt;
                                      &lt;br /&gt;&lt;br /&gt;
                                      Cheers for the suggestions &lt;img src=&quot;images/smiles/icon_biggrin.gif&quot; alt=&quot;Very Happy&quot; border=&quot;0&quot; /&gt; Ive taken a different approach and made and alias for rm which leads to rm -i that should be enough to prevent to many issues. I make nightly backups now so if anything does go its not the end of the world</description>
                                        <comments>http://linuxformat.com/forums/viewtopic.php?p=20069#20069</comments>
                                        <author>shifty_ben</author>
                                        <pubDate>Tue Mar 28, 2006 3:31 pm</pubDate>
                                        <guid isPermaLink="true">http://linuxformat.com/forums/viewtopic.php?p=20069#20069</guid>
                                      </item>
                                      <item>
                                        <title>RE: Ahh what a day! bash and aliases</title>
                                        <link>http://linuxformat.com/forums/viewtopic.php?p=20068#20068</link>
                                        <description>&lt;br /&gt;
                                      Author: &lt;a href='http://linuxformat.com/forums/profile.php?mode=viewprofile&amp;u=5411'&gt;jhooks&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
                                      Posted: Tue Mar 28, 2006 3:26 pm&lt;br /&gt;&lt;br /&gt;
                                      &lt;br /&gt;&lt;br /&gt;
                                      I forgot to mention.  mv and cp can both overwrite files, perhaps you should alias them to scripts that can determine when files will be overwritten so that they also an go to a &quot;recycle bin&quot;.</description>
                                        <comments>http://linuxformat.com/forums/viewtopic.php?p=20068#20068</comments>
                                        <author>jhooks</author>
                                        <pubDate>Tue Mar 28, 2006 3:26 pm</pubDate>
                                        <guid isPermaLink="true">http://linuxformat.com/forums/viewtopic.php?p=20068#20068</guid>
                                      </item>
                                      <item>
                                        <title>RE: Ahh what a day! bash and aliases</title>
                                        <link>http://linuxformat.com/forums/viewtopic.php?p=20067#20067</link>
                                        <description>&lt;br /&gt;
                                      Author: &lt;a href='http://linuxformat.com/forums/profile.php?mode=viewprofile&amp;u=5411'&gt;jhooks&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
                                      Posted: Tue Mar 28, 2006 3:15 pm&lt;br /&gt;&lt;br /&gt;
                                      &lt;br /&gt;&lt;br /&gt;
                                      If it were me, I would want so way of dealing with multiple files of the same name.  Perhaps a simple way to do it would be to have get the full path for the file(s) to be deleted so that when you did &lt;br /&gt;
    'rm ~/file.txt' in '/home/user'&lt;br /&gt;
it ra&lt;br /&gt;
    'mkdir -p /var/deleted/home/user/; mv /home/user/somefile.txt /var/deleted/home/user/file.txt'&lt;br /&gt;
&lt;br /&gt;
Perhaps you would want some way to keep multiple deleted copies of the same file.  You could append a timestamp to the end of each file or even better move it to a folder which was timestamped.  E.g. 'timestamp=$(date +%Y%m%d%H%M%S\-%N); mkdir -p /var/deleted/$timestamp/home/user/; mv /home/user/somefile.txt /var/deleted/$timestamp/home/user/file.txt'&lt;br /&gt;
&lt;br /&gt;
Anyway have fun.</description>
                                        <comments>http://linuxformat.com/forums/viewtopic.php?p=20067#20067</comments>
                                        <author>jhooks</author>
                                        <pubDate>Tue Mar 28, 2006 3:15 pm</pubDate>
                                        <guid isPermaLink="true">http://linuxformat.com/forums/viewtopic.php?p=20067#20067</guid>
                                      </item>
                                      <item>
                                        <title>RE: Ahh what a day! bash and aliases</title>
                                        <link>http://linuxformat.com/forums/viewtopic.php?p=17993#17993</link>
                                        <description>&lt;br /&gt;
                                      Author: &lt;a href='http://linuxformat.com/forums/profile.php?mode=viewprofile&amp;u=3555'&gt;shifty_ben&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
                                      Posted: Sun Feb 26, 2006 11:36 am&lt;br /&gt;&lt;br /&gt;
                                      &lt;br /&gt;&lt;br /&gt;
                                      Kool cheers, Im going to see if I can put something together tomorrow, 9 weeks of straight work and then the stress of that last night have left me rather knackered.&lt;br /&gt;
Damn my fat fingers!</description>
                                        <comments>http://linuxformat.com/forums/viewtopic.php?p=17993#17993</comments>
                                        <author>shifty_ben</author>
                                        <pubDate>Sun Feb 26, 2006 11:36 am</pubDate>
                                        <guid isPermaLink="true">http://linuxformat.com/forums/viewtopic.php?p=17993#17993</guid>
                                      </item>
                                      <item>
                                        <title>RE: Ahh what a day! bash and aliases</title>
                                        <link>http://linuxformat.com/forums/viewtopic.php?p=17983#17983</link>
                                        <description>&lt;br /&gt;
                                      Author: &lt;a href='http://linuxformat.com/forums/profile.php?mode=viewprofile&amp;u=162'&gt;Nigel&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
                                      Posted: Sun Feb 26, 2006 1:26 am&lt;br /&gt;&lt;br /&gt;
                                      &lt;br /&gt;&lt;br /&gt;
                                      I guess the best way would be to set up a bash script that cycles through it's arguments moving them to /var/deleted, then alias that script to rm.&lt;br /&gt;
That would take care of the case where you type&lt;br /&gt;
&lt;br /&gt;
rm foo.txt bar.doc old/*.junk&lt;br /&gt;
&lt;br /&gt;
You would have to have something that removed  parameters (eg -i), or better yet did something appropriate with them.</description>
                                        <comments>http://linuxformat.com/forums/viewtopic.php?p=17983#17983</comments>
                                        <author>Nigel</author>
                                        <pubDate>Sun Feb 26, 2006 1:26 am</pubDate>
                                        <guid isPermaLink="true">http://linuxformat.com/forums/viewtopic.php?p=17983#17983</guid>
                                      </item>
                                      <item>
                                        <title>Ahh what a day! bash and aliases</title>
                                        <link>http://linuxformat.com/forums/viewtopic.php?p=17981#17981</link>
                                        <description>&lt;br /&gt;
                                      Author: &lt;a href='http://linuxformat.com/forums/profile.php?mode=viewprofile&amp;u=3555'&gt;shifty_ben&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
                                      Posted: Sun Feb 26, 2006 12:52 am&lt;br /&gt;&lt;br /&gt;
                                      &lt;br /&gt;&lt;br /&gt;
                                      Hi all,&lt;br /&gt;
&lt;br /&gt;
having just spent the best part of three hours recovering deleted inodes after a very badly placed space, I think its time I set up an alias for rm. Although there are a lot of other users that remotely log into my webserver I think it is probably as much for me as anyone else. What I want to do is move any 'deleted# files to a folder in /var lets call it /var/deleted then I will set up a cron job to clear this every 7 days or so.&lt;br /&gt;
I was going to add this to my /etc/profile&lt;br /&gt;
&lt;br /&gt;
alias rm=&quot;mv /var/deleted&quot;&lt;br /&gt;
&lt;br /&gt;
but then it occurred to me if I do that, then it will in effect be the user typing&lt;br /&gt;
&lt;br /&gt;
mv /var/deleted foo.txt&lt;br /&gt;
&lt;br /&gt;
which isn`t what I want, it may be because its late but I cant for the life of me think of how to enter it so it works in the way I want to, any help will be much appreciated&lt;br /&gt;
&lt;br /&gt;
Thanks&lt;br /&gt;
&lt;br /&gt;
Ben</description>
                                        <comments>http://linuxformat.com/forums/viewtopic.php?p=17981#17981</comments>
                                        <author>shifty_ben</author>
                                        <pubDate>Sun Feb 26, 2006 12:52 am</pubDate>
                                        <guid isPermaLink="true">http://linuxformat.com/forums/viewtopic.php?p=17981#17981</guid>
                                      </item></channel></rss>