Welcome to the VirtuQ Forums.
Results 1 to 2 of 2

Thread: rm command

  1. #1
    Member
    Join Date
    Oct 2011
    Location
    Allahabad, India
    Posts
    245

    rm command

    Hi,

    As per the slide in "4-4 File and Directory Deletion" ,

    rm new.txt , must ask for confirmation
    rm: remove regular empty file `new.txt'? yes
    then it would delete.

    Same case is with
    rm -r foo , must ask for confirmation
    rm:descend into directory `foo'?

    But this is not happening when I try to run rm command.

    First I created a fresh empty file new.txt using vi command in my home directory and give command on Xterm
    rm new.txt
    then it didn't ask the question to whether remove regular empty file or not.

    Second I created a new directory foo using mkdir command and then cd to move into the directory then I created a few non-empty files inside foo
    and give command on xterm
    rm -r foo
    then it doesn't ask the question to descend into directory `foo' or not.


    Regards
    Anon10020
    Last edited by anon10020; 19-10-2011 at 06:49 AM.

  2. #2
    VirtuQ™ Moderator
    Join Date
    Jul 2011
    Location
    Bangalore, India
    Posts
    1,044
    Blog Entries
    2
    Anon10020,

    That is because by default mv is not aliased to the interactive version. Do the following:

    alias mv="mv -i"

    and then try. If you know how to edit your .bashrc, you should put the following in there:

    alias mv="mv -i"
    alias cp="cp -i"
    alias rm="rm -i"

    Cheers,

    Anup


 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •