Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Alias in bash

Options
  • 12-04-2018 10:24am
    #1
    Registered Users Posts: 3,193 ✭✭✭


    Hello Linux chaps,

    In my .bashrc I have created the following alias
    alias rmtmp="sudo rm -rf /usr/local/snip/snip/*/temp/*"
    

    However when I log in
    rmtmp
    

    gives command not found ...
    sudo rmtmp
    
    (then enter password) does the same, the only way I can run it is if I sudo as su.

    so
    sudo su
    

    then rmtmp is regognised and runs.

    Is there some permission I need to toggle on .bashrc for this to run outside su ?


Comments

  • Registered Users Posts: 1,193 ✭✭✭liamo


    Did you create the alias in root's .bashrc by accident?


  • Registered Users Posts: 3,193 ✭✭✭TomSweeney


    liamo wrote: »
    Did you create the alias in root's .bashrc by accident?

    :)

    Was just coming in here to post that ... hehe
    :o

    thanks!


  • Registered Users Posts: 760 ✭✭✭mach1982


    Speaking about alias , as a Harry Potter fan I used spell names for some of mine ie apt-get == accio


  • Registered Users Posts: 8,667 ✭✭✭Worztron


    Damn handy feature is alias. I use them every day.

    Mitch Hedberg: "Rice is great if you're really hungry and want to eat two thousand of something."



  • Registered Users Posts: 1,298 ✭✭✭nullObjects


    mach1982 wrote: »
    Speaking about alias , as a Harry Potter fan I used spell names for some of mine ie apt-get == accio

    Ha, that's kind of cool!

    alias Alohomora ="unzip"
    alias Avada_Kedavra = "kill -9"


  • Advertisement
  • Registered Users Posts: 760 ✭✭✭mach1982


    Ha, that's kind of cool!

    alias Alohomora ="unzip"
    alias Avada_Kedavra = "kill -9"


    Think I'll borrow them as just reinstalled Ubuntu , and might set up ssh as Portus.


  • Registered Users Posts: 760 ✭✭✭mach1982


    I just found a old blog post with all my Alisa

    alias accio='sudo apt-get install'
    alias ak='kill -9' # Avada Kedavra is just too long, an to hard to spell
    alias portus='cd /home'
    alias scourgify='sudo apt-get remove'
    alias mischief-managed='sudo shutdown –h now'


  • Registered Users Posts: 724 ✭✭✭Dero


    A bit of a mouthful, but I like that mischievous feeling... :D
    alias i-solemnly-swear-that-i-am-up-to-no-good='sudo -i'
    


Advertisement