A possible file in which to write a system wide alias.

New to Debian (Or Linux in general)? Ask your questions here!

A possible file in which to write a system wide alias.

Postby stf92 » 2018-05-30 23:11

Hi: I used a non Debian linux distribution and, writing an alias in /etc/profile had system wide effect. Now with Debian 9 an alias in that file has effect only under root. A possible file in which to write an alias such that it is valid for all users including root?
stf92
 
Posts: 41
Joined: 2018-05-27 20:16

Re: A possible file in which to write a system wide alias.

Postby bw123 » 2018-05-31 00:20

User avatar
bw123
 
Posts: 3580
Joined: 2011-05-09 06:02
Location: TN_USA

Re: A possible file in which to write a system wide alias.

Postby Bulkley » 2018-05-31 00:40

bw123 is correct. For example, in ~/.bashrc I have added alias sx="startx" under # some more ls aliases. It looks like this:
Code: Select all
# some more ls aliases
#alias ll='ls -l'
#alias la='ls -A'
#alias l='ls -CF'
alias sx="startx"
Bulkley
 
Posts: 5667
Joined: 2006-02-11 18:35

Re: A possible file in which to write a system wide alias.

Postby None1975 » 2018-05-31 12:40

Bulkley wrote:bw123 is correct. For example, in ~/.bashrc I have added alias sx="startx" under # some more ls aliases.

You may want to put all your additions into a separate file like
Code: Select all
 ~/.bash_aliases
instead of adding them directly in
Code: Select all
 .bashrc
User avatar
None1975
 
Posts: 702
Joined: 2015-11-29 18:23
Location: Lithuania, Vilnius

Re: A possible file in which to write a system wide alias.

Postby debiman » 2018-05-31 17:28

FYI:
there is a user by that alias on linuxquestions.org.
people have been very patient and polite for decades (since 2007), but recently more and more complaints came in that stfu92 is actually some sort of troll, never doing the slightest bit of research, indulging in complainerism etc.
i think it's no coincidence that we find the same alias here right now at this juncture in the train of events...
User avatar
debiman
 
Posts: 3064
Joined: 2013-03-12 07:18

Re: A possible file in which to write a system wide alias.

Postby stf92 » 2018-05-31 20:54

If I use ~/.bashrc then the alias will have effect for the user to which that file belongs. I.e., suppose I am user_1. Then writing the alias in /home/user_1/.bashrc will have effect only for user_1 and not for root. Isn't the meaning of "system wide" not known here?
stf92
 
Posts: 41
Joined: 2018-05-27 20:16

Re: A possible file in which to write a system wide alias.

Postby bw123 » 2018-05-31 21:14

User avatar
bw123
 
Posts: 3580
Joined: 2011-05-09 06:02
Location: TN_USA


Return to Beginners Questions

Who is online

Users browsing this forum: No registered users and 4 guests

fashionable