Find the answer to your Linux question:
Results 1 to 4 of 4
Hey guys, This may seem like a stupid request but I was wondering how do you rename a command? I want "cls" to do the same thing instead of, or ...
  1. #1
    Just Joined! basica's Avatar
    Join Date
    Nov 2011
    Posts
    8

    Rename Commands in Bash

    Hey guys,

    This may seem like a stupid request but I was wondering how do you rename a command? I want "cls" to do the same thing instead of, or in addition to the "clear" command.

    Working with the Windows shell during work hours has cemmented that as the clear command and it is irratating me to bits. I remember reading that this was possible via an environmental variable if I recall correctly but my Google searches are just bringing up how to rename files in Linux :P

    Thanks for the help guys!

  2. #2
    Linux Guru Irithori's Avatar
    Join Date
    May 2009
    Location
    Munich
    Posts
    2,096
    hi

    You can create an alias ( alias cls='clear' ) and insert it into your ~/.bashrc
    After sourcing that (or relogin), cls will be available.

    Code:
    man bash
    You must always face the curtain with a bow.

  3. #3
    Just Joined! basica's Avatar
    Join Date
    Nov 2011
    Posts
    8
    Thanks, exactly what I was after. Alias was the word I was looking for! Thanks again for the help!

  4. #4
    Linux Newbie lugoteehalt's Avatar
    Join Date
    Jan 2004
    Posts
    231
    Also:

    <ctrl> + l

    an L

    This is such a common thing that you might as well memorise the above.
    All power is violence; all power is evil.
    Money As Debt

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...