Creating users or global aliases.
Now we have learned how to create aliases right on the on your own obsession, but you might not know
one thing, that as soon as you log out of your concern or PUDI session where you have created your
aliases, that aliases, they will go away.
There is no way to save them.
Now, how can you save aliases?
So every time you log in, they remain for your session?
Well, there are basically two type of aliases that you create in a user environment.
One is user that applies only to a specific user profile and then the next one is the global alias.
Global alias applies to everyone who has an account on your system.
So if you create one aliases, every user who logs into the system will be able to access that alias.
If you wanted to set up an alias specific to only one user, then you have to log in to that user and
then go into the user home directory.
Inside of the home directory there's a file called Dot Bash or RC Dot files.
Any time there's a dot in front of a file.
It means their file is a hidden file.
So you would have to actually specify.
Dot Bash asked for global aliases if you wanted to set up a global aliases.
You have to specify that in the ETSI configuration file and that as ETSI Bash RC site.
So let's take an example of an elitist.
Let's say if I wanted to set up an alias that will look like this, I wanted to run H.H. and it I wanted
to give me the hostname instead of me typing the entire host name I just wanted to do.
So let's go into my Linux machine.
I am logged into the machine right here.
And if you notice when I run h h it's his command phone, so I need to create an alias for it.
So when I type alias H.H. Equal.
Hostname.
Now, if I type just aliases, you will see that this ELLISS has been added to my environment.
OK, perfect.
Now if I just type H.H., it will give me the hostname, right?
That's perfect.
Now, remember this this setup of elissa's stays here.
As long as I'm logged into this this console session, as long as as soon as I'm out of this or I am
logged in from another PUDI session, let's say I won't be able to access this alias because this alias
is tied to this particular session.
So as as an example, I could show you right here, if you notice, I have this PUDI session, I'm logged
into the same length machine.
I will become myself because in the other session right here, that's myself to who am I?
That is my cell.
So I'm going to become myself and now and I type who am I?
You'll see I'm logged in as myself when I type H.H..
You will see Kumanovo see same user but different session.
But this H.H. it's actually tied to this session or this terminal.
So if I wanted to make that global meaning not so global, I find a way to make that tided to my user
account than what I have to do is I would v.i. my dot Bashar C file that is right here in my home directory.
If I do X minus L A to A is to view the hidden files as well.
You you're going to notice that there's a file called Bashar C, so go ahead and Vidot bash our C file.
Go to the end of it.
And you could put a comment.
Personal aliases.
And then you put an alias, the name of the alias Equal and the common name.
Save the file and now if you go in and put in another session, so let's say this, it's not going to
show up right away on this session because this this session is still holding the old environment.
So you have to create a new session.
So go click on this icon and click a duplicate session.
It will open up another PUDI session, login with your username.
And now if you type H.H., you will see your hostname is there.
So now that's how you could tie up your alias with a user account.
Now, what if you wanted to tie up that alias to everyone who logged into the system, which is called
what, global alias?
So in that case, let's say if I become I mean, do a duplicate session again, if I become root and
login as root and I type H h.
You see, Root doesn't have access to that alias.
So I wanted to make that alias available to everyone.
So for that, you first of all, you have to be rude because every time you need to modify the ETSI
configuration file, you have to be a root.
So n root.
So while your root make sure your root type who am I then go into V.I. the file at Basche.
Ah, see fall and this fall, I'll go to the end of it by hitting Shift G and then put your comment
as global.
Aliases and hair, you could type alias.
H.H..
Equal.
Hostname.
And save this file.
Now, again, if you type H.H. right now, it's not going to work because this session, the H.H. is
tied up to the U.S. accounts globally, so you have to log in again.
So I'm going to go ahead and close the session.
I'm going to go ahead and close this session and I'm going to use the same session.
I'm going to start as a duplicate session.
So the first one I'm going to try is I have Zoll.
And I'm going to see that as I have TSOL, I have access to the earliest, but now you probably thinking,
hey, I added that to the user profile.
That's why you do.
OK, that's fine.
Now, let me log in to the route Akao.
So I'm going to go in and I'm going to type root.
And I'm going to organize route who am I am route and now if I type in H.H. and you'll see the aliases
right here, you can also type aliases to see what is inside of the environment, what is set as an
alias, as you sit by aliases set as this one as well.
If you have more users in this machine, you could try to log in to that user.
So if I Dukat etsi password to see what other uses I have, I have created some of the user, but then
I deleted it.
So let's see if I create a new user user add I create a new use a call James.
James is creative, let me set up a pass for James.
That's fine, I'll password is set up, let's clear the screen and let's actually exit out of the screen,
let's exit out of this screen to now I'm going to login those do the duplicate session.
Let's log in as James now.
And let's see if that H.H. Elias is also accessible by James H.H. Sorry, Nadji.
And you see that Eleusis that we set it up in Etsi Bashar, she is now also accessible to James as well.
So that's how you set up a user.
Aliases and global aliases is something that you should remember when you log out and you don't add
aliases to these files, it will go away.