LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   ls -l ==> ll (https://www.linuxquestions.org/questions/linux-newbie-8/ls-l-%3D%3D-ll-200786/)

alaios 07-03-2004 04:37 PM

ls -l ==> ll
 
Hi! I want to know how i can create aliases useful for all the uses and only for the curent user..

I want when a user writes ll the ls -l command to be executed

david_ross 07-03-2004 04:39 PM

alias ll="ls -l"

alaios 07-03-2004 06:59 PM

Xmm... I have execute your command as root... The problem is that the ll command is not useable from the other users...

trickykid 07-03-2004 07:51 PM

Quote:

Originally posted by alaios
Xmm... I have execute your command as root... The problem is that the ll command is not useable from the other users...
Because when you create an alias at the command as a user, its only for that user for that session.. you'll need to setup this alias in each users .bash_profile, .bashrc or the /etc/profile so everyone uses that alias upon login..

alaios 07-04-2004 05:56 AM

Thz
 
Thx for your repl...
I have entered the following line in the /etc/profile

alias ll="ls -l"

This command is ok from root but the normal users can't find it

slackist 07-04-2004 06:59 AM

Create a text file called .bashrc in the home directory of the user and add the aliases to that
Here is mine, I have a different prompt to remind me if I am user or root, plus a couple of aliases for ls:

Code:

PS1='\u@\w/\$ '
alias ls='ls --color'
alias l.='ls -a'


HTH

mark

alaios 07-04-2004 04:23 PM

thx
 
Thx....for your reply but some questions....
What PS1 m,eans???
I know about bashrc but this works only for the users that have that file.... I am trying to find a way for doing that and every user can use them...

david_ross 07-04-2004 04:36 PM

PS1 stores the variable that is used to construct the bash prompt. Perhaps you could tell us which distro you are using.

alaios 07-04-2004 07:33 PM

debian 3

emetib 07-04-2004 07:53 PM

take a look at your /etc/profile. you should have a line in there that looks something like this.
PATH="/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games:$HOME/.bash_profile"
what i've done with mine is to add the $HOME/.bash_profile so that i can declare other user specific things in my ~/.bashrc. this will also make it so that others can change their aliases how they would want them to work.
if you want things set up for the entire system, all of the users, put it in /etc/bash.bashrc, the aliases that is.
for my ll, i have ls=ls -lh, this makes it human readable. it's not that big of a deal, but it's nice to have. another couple are la= ls -A, and l= -lA.

cheers.


All times are GMT -5. The time now is 08:30 PM.