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.
11-25-2011, 06:39 AM
#1
Member
Registered: Oct 2011
Location: Portugal.
Distribution: Debian squeeze - Fluxbox.
Posts: 107
Rep:
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.
11-25-2011, 06:45 AM
#2
Senior Member
Registered: Apr 2007
Location: Portland, OR
Distribution: Debian, Android, LFS
Posts: 1,159
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.
11-25-2011, 06:46 AM
#3
Member
Registered: Oct 2011
Location: Portugal.
Distribution: Debian squeeze - Fluxbox.
Posts: 107
Original Poster
Rep:
Thankyou
Thankyou Mister, then should I do source bash after doing this to activate the changes?
11-25-2011, 06:48 AM
#4
Member
Registered: Oct 2011
Location: Portugal.
Distribution: Debian squeeze - Fluxbox.
Posts: 107
Original Poster
Rep:
solved
Thankyou Mister Williams, apparently it is already working as of writing the alias...
11-25-2011, 06:53 AM
#5
Senior Member
Registered: Apr 2007
Location: Portland, OR
Distribution: Debian, Android, LFS
Posts: 1,159
Quote:
Originally Posted by
Foxbat1155
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.
11-25-2011, 06:56 AM
#6
Member
Registered: Oct 2011
Location: Portugal.
Distribution: Debian squeeze - Fluxbox.
Posts: 107
Original Poster
Rep:
question
It says I do not have permission even though I am already root
11-25-2011, 06:58 AM
#7
Senior Member
Registered: Apr 2007
Location: Portland, OR
Distribution: Debian, Android, LFS
Posts: 1,159
Quote:
Originally Posted by
Foxbat1155
It says I do not have permission even though I am already root
What is the command you are typing to get that message?
11-25-2011, 07:07 AM
#8
Member
Registered: Oct 2011
Location: Portugal.
Distribution: Debian squeeze - Fluxbox.
Posts: 107
Original Poster
Rep:
command
~/.bashrc sources ~/.bash_aliases
11-25-2011, 07:11 AM
#9
Senior Member
Registered: Apr 2007
Location: Portland, OR
Distribution: Debian, Android, LFS
Posts: 1,159
Quote:
Originally Posted by
Foxbat1155
~/.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,
Sorry for the confusing language.
2 members found this post helpful.
11-25-2011, 07:12 AM
#10
Member
Registered: Oct 2011
Location: Portugal.
Distribution: Debian squeeze - Fluxbox.
Posts: 107
Original Poster
Rep:
thankyou
thankyou Sir
Thread Tools
Search this Thread
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
All times are GMT -5. The time now is 04:36 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