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
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Alias in bash

  • 12-04-2018 9:24am
    #1
    Registered Users, Registered Users 2 Posts: 3,249 ✭✭✭


    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, Registered Users 2 Posts: 1,193 ✭✭✭liamo


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


  • Registered Users, Registered Users 2 Posts: 3,249 ✭✭✭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, Registered Users 2 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, Registered Users 2 Posts: 8,858 ✭✭✭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, Registered Users 2 Posts: 1,386 ✭✭✭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, Registered Users 2 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, Registered Users 2 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, Registered Users 2 Posts: 741 ✭✭✭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