Results 1 to 4 of 4

Thread: rm command not working

  1. #1
    Join Date
    Nov 2011
    Beans
    2

    Question rm command not working

    I'm taking an Introduction to Unix/Linux course at my community college, and for an assignment on learning basic scripting, we were asked to write a script that created five aliases and test them to see if they worked. During this process, I created an alias for 'rm' that went:

    alias rm='del'

    When I check my aliases, it lists the above alias, but when I try to use "rm" or "del" in the terminal, it tells me in both instances "del: command not found." I checked in /bin and the rm executable is still there, so I at least didn't delete that somehow.

    Ultimately, I could just reinstall Ubuntu on my virtual machine, but I'd prefer to use that as a last resort if possible.

    Thanks ahead of time!

  2. #2
    Join Date
    Mar 2008
    Location
    Birmingham, UK
    Beans
    Hidden!

    Re: rm command not working

    That'll be because the alias is the wrong way around. You have aliased the non-existent command 'del' to run when you type 'rm', which is why 'rm' no longer works, and 'del' doesn't work since, again, it's not a command.

    The syntax is:
    Code:
    alias what_you_want_to_write='what_you_want_to_run'
    So what I believe you are aiming for is:
    Code:
    alias del='rm'
    Desktop: Phenom 955 BE | GA-MA790XT-UD4P | 8GB TG Elite 1600 | BFG GTX 275
    Conky Screenshots | Last.fm | New to Ubuntu?

  3. #3
    Join Date
    Nov 2011
    Beans
    2

    Re: rm command not working

    Wow, that is an embarrassing mistake. Thank you for helping me!

  4. #4
    Join Date
    Mar 2008
    Location
    Birmingham, UK
    Beans
    Hidden!

    Re: rm command not working

    Heh, we all make them. Glad I could help.
    Desktop: Phenom 955 BE | GA-MA790XT-UD4P | 8GB TG Elite 1600 | BFG GTX 275
    Conky Screenshots | Last.fm | New to Ubuntu?

Tags for this Thread

Bookmarks

Posting Permissions

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