The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

bashrc alias problem

Discussion in 'General Discussion' started by jayrb, May 23, 2010.

  1. jayrb

    jayrb Registered

    Joined:
    Sep 27, 2008
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Hi all,

    Working in server today and having major grief with the most basic of commands which have been run who knows how many times. I'm no guru, but this is bread & butter stuff. Have even checked bash_history to confirm I have actually used them verbatim before.

    Code:
    # mv * ../
    mv: invalid option -- r
    
    # cp * ../.
    cp: invalid option -- e
    It's mapping mv/cp as an alias and it looks like there's a typo, but I cannot find the source of this alias. Checked all the bashrc files I can find...

    - no user specific mappings
    - /etc/bashrc has nothing

    /root/.bashrc has:
    alias rm='rm -i'
    alias cp='cp -i'
    alias mv='mv -i'

    Running cPanel 11.25.0-S45750 (current STABLE) and did a force update with option to reinstall selected.

    Any suggestions?

    tia,
    Jay
     
  2. jayrb

    jayrb Registered

    Joined:
    Sep 27, 2008
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    bashrc resolved

    Problem solved. It may be obvious to the pros, but here's what happened in case it helps someone like me...

    In the directory I was attempting to move, there is a dir titled '-restore'. The mv cmd saw -r as an arg and failed as this is not a valid.

    This has to be an application-created dir that appeared a couple weeks ago. Now I'm messing around trying to figure out how to rename it and get rid of it. Who names a dir something like that?

    Jay
     
  3. Spiral

    Spiral BANNED

    Joined:
    Jun 24, 2005
    Messages:
    2,023
    Likes Received:
    7
    Trophy Points:
    0
    Use a -- flag in your command ....

    Thus:
    Code:
    mv * ../
    
    Should be:
    Code:
    mv -- ./* ..
    
    The '--' tells the command to ignore any further options and can be used with **most** linux commands)
     
Loading...

Share This Page