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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
02-05-2004, 01:37 PM
|
#1
|
Member
Registered: Aug 2003
Location: Edinburgh
Distribution: Server: Gentoo2004; Desktop: Ubuntu
Posts: 720
Rep:
|
adding shortcuts for command line
Hi
I'm trying to set a couple of shortcuts for command line, for example, when I type "ls", I want it to "ls -lh" .
I have done this before and I'm sure that it was done by adding an alias in ~/.bashrc or something, but I can't remember at all.
Can anyone refresh my memory?
I'm running Suse 8.2
regards
Hamish
|
|
|
02-05-2004, 01:39 PM
|
#2
|
Senior Member
Registered: Jun 2003
Distribution: Mint 13/15, CentOS 6.4
Posts: 2,020
Rep:
|
Re: adding shortcuts for command line
yes, it's in ~/.bashrc. ex:
alias ls='ls -lh'
|
|
|
02-05-2004, 01:41 PM
|
#3
|
Member
Registered: Jan 2004
Location: Green Bay
Distribution: RedHat 8.0, LFS-5.0
Posts: 100
Rep:
|
In your ~/.bashrc you can add:
alias lsl='ls -lh --color=tty'
Then:
source .bashrc
This will make it work immediatly. It will only work for that user.
JN
|
|
|
02-05-2004, 01:46 PM
|
#4
|
Member
Registered: Aug 2003
Location: Edinburgh
Distribution: Server: Gentoo2004; Desktop: Ubuntu
Posts: 720
Original Poster
Rep:
|
Thanks so much guys, it is now sorted.
Much appreciated.
Hamish
|
|
|
02-05-2004, 07:41 PM
|
#5
|
Senior Member
Registered: Apr 2001
Location: Plymouth, England.
Distribution: Mostly Debian based systems
Posts: 4,368
Rep:
|
If you want all users to have this, then you put it in /etc/bashrc rather than each users ~/.bashrc
|
|
|
02-05-2004, 07:45 PM
|
#6
|
Senior Member
Registered: Jun 2003
Distribution: Mint 13/15, CentOS 6.4
Posts: 2,020
Rep:
|
Quote:
Originally posted by Thymox
If you want all users to have this, then you put it in /etc/bashrc rather than each users ~/.bashrc
|
is that a hidden file, too? i don't have an /etc/bashrc -- my "global" bashrc settings are in /etc/profile, but maybe that's a slack thing?
|
|
|
02-05-2004, 07:58 PM
|
#7
|
Senior Member
Registered: Apr 2001
Location: Plymouth, England.
Distribution: Mostly Debian based systems
Posts: 4,368
Rep:
|
Possibly - I haven't got Slack installed on VMW anymore so I can't verify that, sorry. But no, it shouldn't be a hidden file in /etc
|
|
|
All times are GMT -5. The time now is 05:22 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|