How to make an alias in shell?

Currently reading
How to make an alias in shell?

The post of the link is 12 years old now...
For gods sake Synology replaced ash with bash in DSM6.

I am not sure if /etc.defaults/profile is used, but if you do a new login to the shell and execute `set`, you will see that the last executed command was /etc.defaults/.bashrc_profile, which will execute `source ~/.bashrc` (if user profiles are enabled).

You can either enable user profiles home folder and store your aliases in ~/.bashrc or globaly add the aliases to /etc.defaults/.bashrc_profile

update: appearantly /etc.defaults/profile is used as well.
 
Last edited:
5
0
NAS
918+
The post of the link is 12 years old now...
For gods sake Synology replaced ash with bash in DSM6.

I am not sure if /etc.defaults/profile is used, but if you do a new login to the shell and execute `set`, you will see that the last executed command was /etc.defaults/.bashrc_profile, which will execute `source ~/.bashrc` (if user profiles are enabled).

You can either enable user profiles home folder and store your aliases in ~/.bashrc or globaly add the aliases to /etc.defaults/.bashrc_profile

update: appearantly /etc.defaults/profile is used as well.
That's a great answer, thanks.

Thanks for the details!
 
5
0
NAS
918+
The post of the link is 12 years old now...
For gods sake Synology replaced ash with bash in DSM6.

I am not sure if /etc.defaults/profile is used, but if you do a new login to the shell and execute `set`, you will see that the last executed command was /etc.defaults/.bashrc_profile, which will execute `source ~/.bashrc` (if user profiles are enabled).

You can either enable user profiles home folder and store your aliases in ~/.bashrc or globaly add the aliases to /etc.defaults/.bashrc_profile

update: appearantly /etc.defaults/profile is used as well.
Just wanted to add that editing the /etc.defaults/.bashrc_profile is the way to go if you want to make an alias as that get loaded on login. whereas /etc.defaults/profile does not.

Thanks @one-eyed-king
 
Welcome!

I came to the same conclusion yesterday evening.

Though, if you want the aliases to be user specific, you can turn on "Enable user home service" in control panel -> user -> tab "Advanced" -> section "User Home" and add your aliases in ~/.bashrc.
 
5
0
NAS
918+
Welcome!

I came to the same conclusion yesterday evening.

Though, if you want the aliases to be user specific, you can turn on "Enable user home service" in control panel -> user -> tab "Advanced" -> section "User Home" and add your aliases in ~/.bashrc.
That's a good addition, thanks.
 

Create an account or login to comment

You must be a member in order to leave a comment

Create account

Create an account on our community. It's easy!

Log in

Already have an account? Log in here.

Welcome to SynoForum.com!

SynoForum.com is an unofficial Synology forum for NAS owners and enthusiasts.

Registration is free, easy and fast!

Trending threads

Top