LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   adding shortcuts for command line (https://www.linuxquestions.org/questions/linux-newbie-8/adding-shortcuts-for-command-line-142693/)

hamish 02-05-2004 01:37 PM

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

synaptical 02-05-2004 01:39 PM

Re: adding shortcuts for command line
 
yes, it's in ~/.bashrc. ex:

alias ls='ls -lh'

jazernorth 02-05-2004 01:41 PM

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

hamish 02-05-2004 01:46 PM

Thanks so much guys, it is now sorted.

Much appreciated.
Hamish

Thymox 02-05-2004 07:41 PM

If you want all users to have this, then you put it in /etc/bashrc rather than each users ~/.bashrc

synaptical 02-05-2004 07:45 PM

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?

Thymox 02-05-2004 07:58 PM

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 06:20 AM.