LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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 11-25-2011, 06:39 AM   #1
Foxbat1155
Member
 
Registered: Oct 2011
Location: Portugal.
Distribution: Debian squeeze - Fluxbox.
Posts: 109

Rep: Reputation: 1
Lightbulb Where can I modify ls command to personalize with my preferred options?


Where can I find the file that I would modify in emacs, for instance, so that when I issue ls on terminal it invokes "ls -alphX" instead of just ls?

Thankyou in advance.
 
Old 11-25-2011, 06:45 AM   #2
jhwilliams
Senior Member
 
Registered: Apr 2007
Location: Portland, OR
Distribution: Debian, Android, LFS
Posts: 1,168

Rep: Reputation: 211Reputation: 211Reputation: 211
On Ubuntu (by default), you can put custom aliases in a file called ~/.bash_aliases .

In your case, then, you would put:
Code:
alias ls='ls -alphX'
The next time you login to a shell, the change should be active.

BTW, I don't actually recommend changing ls. You could call it something else, like lsa. So:
Code:
alias lsa='ls -alphX'

Last edited by jhwilliams; 11-25-2011 at 06:46 AM.
 
1 members found this post helpful.
Old 11-25-2011, 06:46 AM   #3
Foxbat1155
Member
 
Registered: Oct 2011
Location: Portugal.
Distribution: Debian squeeze - Fluxbox.
Posts: 109

Original Poster
Rep: Reputation: 1
Exclamation Thankyou

Thankyou Mister, then should I do source bash after doing this to activate the changes?
 
Old 11-25-2011, 06:48 AM   #4
Foxbat1155
Member
 
Registered: Oct 2011
Location: Portugal.
Distribution: Debian squeeze - Fluxbox.
Posts: 109

Original Poster
Rep: Reputation: 1
Smile solved

Thankyou Mister Williams, apparently it is already working as of writing the alias...
 
Old 11-25-2011, 06:53 AM   #5
jhwilliams
Senior Member
 
Registered: Apr 2007
Location: Portland, OR
Distribution: Debian, Android, LFS
Posts: 1,168

Rep: Reputation: 211Reputation: 211Reputation: 211
Quote:
Originally Posted by Foxbat1155 View Post
Thankyou Mister, then should I do source bash after doing this to activate the changes?
~/.bashrc sources ~/.bash_aliases, so it would work to source either of those files -- eboth end up re-reading the aliases.
 
1 members found this post helpful.
Old 11-25-2011, 06:56 AM   #6
Foxbat1155
Member
 
Registered: Oct 2011
Location: Portugal.
Distribution: Debian squeeze - Fluxbox.
Posts: 109

Original Poster
Rep: Reputation: 1
Exclamation question

It says I do not have permission even though I am already root
 
Old 11-25-2011, 06:58 AM   #7
jhwilliams
Senior Member
 
Registered: Apr 2007
Location: Portland, OR
Distribution: Debian, Android, LFS
Posts: 1,168

Rep: Reputation: 211Reputation: 211Reputation: 211
Quote:
Originally Posted by Foxbat1155 View Post
It says I do not have permission even though I am already root
What is the command you are typing to get that message?
 
Old 11-25-2011, 07:07 AM   #8
Foxbat1155
Member
 
Registered: Oct 2011
Location: Portugal.
Distribution: Debian squeeze - Fluxbox.
Posts: 109

Original Poster
Rep: Reputation: 1
Arrow command

~/.bashrc sources ~/.bash_aliases
 
Old 11-25-2011, 07:11 AM   #9
jhwilliams
Senior Member
 
Registered: Apr 2007
Location: Portland, OR
Distribution: Debian, Android, LFS
Posts: 1,168

Rep: Reputation: 211Reputation: 211Reputation: 211
Quote:
Originally Posted by Foxbat1155 View Post
~/.bashrc sources ~/.bash_aliases
Oh okay. Yea, I meant that .bashrc includes .bash_aliases, so you can do one of:

Code:
source ~/.bash_aliases
or, alternatively,

Code:
source ~/.bashrc
Sorry for the confusing language.
 
2 members found this post helpful.
Old 11-25-2011, 07:12 AM   #10
Foxbat1155
Member
 
Registered: Oct 2011
Location: Portugal.
Distribution: Debian squeeze - Fluxbox.
Posts: 109

Original Poster
Rep: Reputation: 1
Wink thankyou

thankyou Sir
 
  


Reply

Tags
commands, terminal



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
How to modify rm command ? ssvirdi Linux - Newbie 13 06-23-2010 12:47 AM
How can I personalize bash with my own language? tasodan Slackware 3 05-16-2010 04:26 PM
How to modify GRUB options Jose Rivas Fedora 1 03-28-2007 01:06 PM
How to personalize email boToo Linux - Software 2 11-17-2006 09:02 PM
personalize kernel name spank Linux - Newbie 1 02-22-2004 12:15 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:55 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
Open Source Consulting | Domain Registration