ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Linux: Aliases

    IT Discussion
    linux sam linux administration alias
    7
    17
    4.2k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • alex.olynykA
      alex.olynyk @scottalanmiller
      last edited by

      @scottalanmiller How do make a permanent alias? For example I want to shorten clear to cls.

      scottalanmillerS stacksofplatesS 2 Replies Last reply Reply Quote 0
      • scottalanmillerS
        scottalanmiller @alex.olynyk
        last edited by scottalanmiller

        @alex.olynyk said:

        @scottalanmiller How do make a permanent alias? For example I want to shorten clear to cls.

        # alias cls="clear"
        

        Then add it into your .bashrc file for just you or into the /etc/profile for everyone on a system.

        1 Reply Last reply Reply Quote 0
        • scottalanmillerS
          scottalanmiller
          last edited by

          Or your .profile if you want it across all of your shells.

          1 Reply Last reply Reply Quote 0
          • aaron-closed accountA
            aaron-closed account Banned
            last edited by

            This post is deleted!
            scottalanmillerS 1 Reply Last reply Reply Quote 1
            • scottalanmillerS
              scottalanmiller @aaron-closed account
              last edited by

              @aaron said:

              @scottalanmiller I am enjoying these write-ups and would like to share them with some of my junior staff. Is there an index page of sorts ?

              There are ways to show them as an index. One is the official "table of contents" which presents the entire series "in order":

              http://mangolassi.it/topic/7825/sam-learning-linux-system-administration

              And then there is the "SAM Linux Administration" tag which shows all of the articles tagged as part of the series which will show them more in "order they were written":

              http://mangolassi.it/tags/sam linux administration

              1 Reply Last reply Reply Quote 1
              • scottalanmillerS
                scottalanmiller
                last edited by

                My plan is to get a small "banner" that goes across the top of each and points back to the main page to make navigation much easier and clearer. Just need to get a banner made, though 🙂

                1 Reply Last reply Reply Quote 3
                • stacksofplatesS
                  stacksofplates @alex.olynyk
                  last edited by

                  @alex.olynyk said:

                  @scottalanmiller How do make a permanent alias? For example I want to shorten clear to cls.

                  You can just use ctrl+l then you don't even need the alias.

                  1 Reply Last reply Reply Quote 0
                  • DustinB3403D
                    DustinB3403
                    last edited by

                    In order for me to properly remove the sample "go2t" alias I had to use

                    unalias go2t
                    alias
                    alias ls='ls --color=auto'
                    

                    Prior to unalias I had

                     alias 
                     alias go2t=''
                     alias ls='ls --color=auto'
                    
                    scottalanmillerS 1 Reply Last reply Reply Quote 0
                    • scottalanmillerS
                      scottalanmiller @DustinB3403
                      last edited by

                      @DustinB3403 Thanks. OP has been fixed.

                      1 Reply Last reply Reply Quote 0
                      • tonyshowoffT
                        tonyshowoff
                        last edited by

                        Instead of just using aliases, set your home directory in your PATH before /usr/bin/local and create replacement programs to irritate anyone using your user account... that's what I do for fun on my personal machine.

                        travisdh1T 1 Reply Last reply Reply Quote 2
                        • travisdh1T
                          travisdh1 @tonyshowoff
                          last edited by

                          @tonyshowoff said in Linux: Aliases:

                          Instead of just using aliases, set your home directory in your PATH before /usr/bin/local and create replacement programs to irritate anyone using your user account... that's what I do for fun on my personal machine.

                          If it's just your local machine..... why not do that system wide? (Apparently I'm feeling especially evil tonight.)

                          1 Reply Last reply Reply Quote 2
                          • DustinB3403D
                            DustinB3403
                            last edited by

                            You know just because I hate having to type "clear" every time... every linux system I have is getting the "cls" alias!

                            stacksofplatesS 1 Reply Last reply Reply Quote 0
                            • stacksofplatesS
                              stacksofplates @DustinB3403
                              last edited by

                              @DustinB3403 said in Linux: Aliases:

                              You know just because I hate having to type "clear" every time... every linux system I have is getting the "cls" alias!

                              You can just do ctrl+l

                              DustinB3403D 1 Reply Last reply Reply Quote 0
                              • DustinB3403D
                                DustinB3403 @stacksofplates
                                last edited by

                                @johnhooks said in Linux: Aliases:

                                @DustinB3403 said in Linux: Aliases:

                                You know just because I hate having to type "clear" every time... every linux system I have is getting the "cls" alias!

                                You can just do ctrl+l

                                And have to remember yet another keyboard shortcut?!

                                travisdh1T tonyshowoffT 2 Replies Last reply Reply Quote 0
                                • travisdh1T
                                  travisdh1 @DustinB3403
                                  last edited by

                                  @DustinB3403 said in Linux: Aliases:

                                  @johnhooks said in Linux: Aliases:

                                  @DustinB3403 said in Linux: Aliases:

                                  You know just because I hate having to type "clear" every time... every linux system I have is getting the "cls" alias!

                                  You can just do ctrl+l

                                  And have to remember yet another keyboard shortcut?!

                                  SOME of us had nothing BUT keyboard shortcuts to work with at one point 😉 Seriously, real, physical RS-232 terminals with 64 keys were no fun! I can't even find pictures of the one I was stuck with, it was numbers, letters, and a ctrl key.

                                  1 Reply Last reply Reply Quote 0
                                  • tonyshowoffT
                                    tonyshowoff @DustinB3403
                                    last edited by

                                    @DustinB3403 said in Linux: Aliases:

                                    @johnhooks said in Linux: Aliases:

                                    @DustinB3403 said in Linux: Aliases:

                                    You know just because I hate having to type "clear" every time... every linux system I have is getting the "cls" alias!

                                    You can just do ctrl+l

                                    And have to remember yet another keyboard shortcut?!

                                    ctrl + l (L) is pretty universal for clear screen in the POSIX-compliant world, it's really about learning standard short cuts, like ctrl + k is delete line, ctrl + c is SIGINT, hell the latter even works in MSDOS and PowerShell.

                                    1 Reply Last reply Reply Quote 1
                                    • 1 / 1
                                    • First post
                                      Last post