Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Alias in bash

  • 12-04-2018 10:24AM
    #1
    Registered Users, Registered Users 2 Posts: 3,257 ✭✭✭


    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,257 ✭✭✭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,971 ✭✭✭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,424 ✭✭✭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, Paid Member Posts: 748 ✭✭✭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