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.
 
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.
 

Rusty

Moderator
NAS Support
6,554
1,952
www.blackvoid.club
NAS
DS718+, DS918+, 2x RS3614RPxs+
Router
  1. RT1900ac
  2. RT2600ac
  3. MR2200ac
Operating system
  1. macOS
Mobile operating system
  1. iOS
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
 
1
0
NAS
DS1821+
Operating system
  1. Linux
  2. macOS
  3. Windows
Mobile operating system
  1. Android
  2. iOS
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
 
Of note, $HOME or $USER does not work in /etc.defaults/profile or /etc.defaults/.bashrc_profile
Sure it does not. those files are for general behavior, not for user specific.

The recommendation is to enabe "Enable user home service" (see post somewhere above) and then add user specific customizations to the file ~/.bashrc.
 

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!

Top