Linux: Aliases
-
@scottalanmiller How do make a permanent alias? For example I want to shorten clear to cls.
-
@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.
-
Or your .profile if you want it across all of your shells.
-
This post is deleted! -
@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":
-
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
-
@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.
-
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'
-
@DustinB3403 Thanks. OP has been fixed.
-
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.
-
@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.)
-
You know just because I hate having to type "clear" every time... every linux system I have is getting the "cls" alias!
-
@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
-
@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?!
-
@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.
-
@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.