LinuxQuestions.org
Review your favorite Linux distribution.
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 08-24-2002, 02:57 AM   #1
IceNineJon
Member
 
Registered: Jun 2002
Location: Los Angeles, Ca, USA
Distribution: Mandrake 9.1
Posts: 82

Rep: Reputation: 15
changing the default options on a command?


I know I'm being extremely lazy by asking this but is there a way to change the default options on a command? For example, I almost always use the command "ls -l". Is there a way that I could just type "ls" and it would default to the "-l" option without me having to type it?

As I've said, I know I'm being lazy but it would be cool to have

Thanks!,
Jon
 
Old 08-24-2002, 03:23 AM   #2
neo77777
LQ Addict
 
Registered: Dec 2001
Location: Brooklyn, NY
Distribution: *NIX
Posts: 3,704

Rep: Reputation: 56
alias ls='ls -l'
 
Old 08-24-2002, 03:26 AM   #3
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Rep: Reputation: 64
Excellent and I couldn't have said it better, even if I had quoted the man.

To use the 'alias' all the time, and not have to set it after each reboot and such, you would place it in the ~/.bashrc (I believe) and then it would run each time. Someone correct me if that's not the correct file.

Cool
 
Old 08-24-2002, 03:31 AM   #4
IceNineJon
Member
 
Registered: Jun 2002
Location: Los Angeles, Ca, USA
Distribution: Mandrake 9.1
Posts: 82

Original Poster
Rep: Reputation: 15
I've put aliases in my .bash_profile. Is this wrong? Thanks for the quick responses guys! I wasn't aware you could overwrite a command with an alias.

Thanks again!,
Jon
 
Old 08-24-2002, 03:34 AM   #5
IceNineJon
Member
 
Registered: Jun 2002
Location: Los Angeles, Ca, USA
Distribution: Mandrake 9.1
Posts: 82

Original Poster
Rep: Reputation: 15
I just added the code and for some reason when I use "ls" now, the entries are no longer color coded (directories used to be blue, archived files were red, etc). Any ideas? I'm SSHing to this server by the way if that helps at all.
 
Old 08-24-2002, 10:07 AM   #6
neo77777
LQ Addict
 
Registered: Dec 2001
Location: Brooklyn, NY
Distribution: *NIX
Posts: 3,704

Rep: Reputation: 56
use alias ls='ls -l --color'
 
Old 08-24-2002, 01:07 PM   #7
IceNineJon
Member
 
Registered: Jun 2002
Location: Los Angeles, Ca, USA
Distribution: Mandrake 9.1
Posts: 82

Original Poster
Rep: Reputation: 15
Works great. Thanks
 
  


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
Changing Startup Options awheeler Linux - Newbie 1 08-25-2004 11:47 AM
Viewing the default kernel options six6 Mandriva 9 07-22-2004 04:21 PM
default kernel options whysyn Slackware 1 06-17-2003 12:27 AM
default user options? hux Linux - Security 2 12-18-2002 11:19 AM
Display Options - Changing turnerni Linux - Newbie 2 02-26-2001 02:57 PM


All times are GMT -5. The time now is 05:15 AM.

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