How to make an alias in shell?

Currently reading
How to make an alias in shell?

Last edited:
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.
 
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!
 
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.

That's a good addition, thanks.
 
how do i install pip on a ds220j? i am looking for a solution no solution?
From all the notes below I can not understand the method to use?
Do you have python installed via Package center? If not install it, then ssh into your nas and run:
After pip has downloaded install it:
python3 get-pip.py
You might need to move into a folder where python is installed and also depending on the version use the correct command
 
That's a good addition, thanks.
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.

Just want to confirm that this also works in DSM 7.

Of note, $HOME or $USER does not work in /etc.defaults/profile or /etc.defaults/.bashrc_profile
 

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!

Back
Top