LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
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 02-05-2004, 01:37 PM   #1
hamish
Member
 
Registered: Aug 2003
Location: Edinburgh
Distribution: Server: Gentoo2004; Desktop: Ubuntu
Posts: 720

Rep: Reputation: 30
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
 
Old 02-05-2004, 01:39 PM   #2
synaptical
Senior Member
 
Registered: Jun 2003
Distribution: Mint 13/15, CentOS 6.4
Posts: 2,020

Rep: Reputation: 46
Re: adding shortcuts for command line

yes, it's in ~/.bashrc. ex:

alias ls='ls -lh'
 
Old 02-05-2004, 01:41 PM   #3
jazernorth
Member
 
Registered: Jan 2004
Location: Green Bay
Distribution: RedHat 8.0, LFS-5.0
Posts: 100

Rep: Reputation: 15
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
 
Old 02-05-2004, 01:46 PM   #4
hamish
Member
 
Registered: Aug 2003
Location: Edinburgh
Distribution: Server: Gentoo2004; Desktop: Ubuntu
Posts: 720

Original Poster
Rep: Reputation: 30
Thanks so much guys, it is now sorted.

Much appreciated.
Hamish
 
Old 02-05-2004, 07:41 PM   #5
Thymox
Senior Member
 
Registered: Apr 2001
Location: Cornwall, England.
Distribution: Debian + Ubuntu
Posts: 4,345

Rep: Reputation: 56
If you want all users to have this, then you put it in /etc/bashrc rather than each users ~/.bashrc
 
Old 02-05-2004, 07:45 PM   #6
synaptical
Senior Member
 
Registered: Jun 2003
Distribution: Mint 13/15, CentOS 6.4
Posts: 2,020

Rep: Reputation: 46
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?
 
Old 02-05-2004, 07:58 PM   #7
Thymox
Senior Member
 
Registered: Apr 2001
Location: Cornwall, England.
Distribution: Debian + Ubuntu
Posts: 4,345

Rep: Reputation: 56
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
 
  


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
adding files through command line browser Linux - General 6 05-21-2005 06:53 PM
Adding users via command Line AmdMhz Linux - Software 4 10-31-2004 01:29 PM
adding a user in the command line Daredevil Linux - Newbie 5 02-27-2004 12:56 PM
adding command line to starting coltranefawz Linux - Software 1 07-02-2003 11:34 AM
Another Newbie Question - Command Line Shortcuts? AtomiCTheGr8 Linux - General 9 08-14-2002 09:02 PM


All times are GMT -5. The time now is 10:48 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration