LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-03-2004, 05:37 PM   #1
alaios
Senior Member
 
Registered: Jan 2003
Location: Aachen
Distribution: Opensuse 11.2 (nice and steady)
Posts: 2,185

Rep: Reputation: 45
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
 
Old 07-03-2004, 05:39 PM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 66
alias ll="ls -l"
 
Old 07-03-2004, 07:59 PM   #3
alaios
Senior Member
 
Registered: Jan 2003
Location: Aachen
Distribution: Opensuse 11.2 (nice and steady)
Posts: 2,185

Original Poster
Rep: Reputation: 45
Xmm... I have execute your command as root... The problem is that the ll command is not useable from the other users...
 
Old 07-03-2004, 08:51 PM   #4
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 234Reputation: 234Reputation: 234
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..
 
Old 07-04-2004, 06:56 AM   #5
alaios
Senior Member
 
Registered: Jan 2003
Location: Aachen
Distribution: Opensuse 11.2 (nice and steady)
Posts: 2,185

Original Poster
Rep: Reputation: 45
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
 
Old 07-04-2004, 07:59 AM   #6
slackist
Member
 
Registered: Feb 2004
Location: Phuket
Distribution: Slackware 14.1 and Slackware Arm
Posts: 477

Rep: Reputation: 41
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
 
Old 07-04-2004, 05:23 PM   #7
alaios
Senior Member
 
Registered: Jan 2003
Location: Aachen
Distribution: Opensuse 11.2 (nice and steady)
Posts: 2,185

Original Poster
Rep: Reputation: 45
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...
 
Old 07-04-2004, 05:36 PM   #8
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 66
PS1 stores the variable that is used to construct the bash prompt. Perhaps you could tell us which distro you are using.
 
Old 07-04-2004, 08:33 PM   #9
alaios
Senior Member
 
Registered: Jan 2003
Location: Aachen
Distribution: Opensuse 11.2 (nice and steady)
Posts: 2,185

Original Poster
Rep: Reputation: 45
debian 3
 
Old 07-04-2004, 08:53 PM   #10
emetib
Member
 
Registered: Feb 2003
Posts: 482

Rep: Reputation: 33
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off




All times are GMT -5. The time now is 04:59 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration