Linux - NewbieThis 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.
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am familiar with the Bash shell, however I have begun learning to program in Raspbian linux which is specifically for the Raspberry Pi micro computer.
I want to put some aliases in what is the .bashrc file in bash shell distros however the only file similar in the Bourne shell is the /etc/profile. There are no entries in this text file with the alias command and when I enter in my home directory the alias command it returns 'no such command'.
So how are aliases entered in a Bourne shell?
You add aliases by specifying them in either the /etc/profile (for global system config, i.e. for all users) or in your local HOME/.bashrc (for your own environment config only). They are defined as in Bash, e.g.
Code:
alias l='/usr/bin/ls --color=auto -F'
alias ll='/usr/bin/ls --color=auto -l -h'
alias df='/usr/bin/df -h --output=source,fstype,itotal,ipcent,iused,iavail,size,pcent,used,avail,target'
But use aliases carefully. Try to avoid conflicts with existing commands or existing aliases. Use the alias command to see all aliases already defined in the environment.
Thanks for the reply; found the /home/.bashrc file and sure enough it has the alias commands. Put my favorite alias ll='ls -al | more' in and it works. As I remember the .bashrc file in a bash shell distro is in the root directory structure. It's been awhile .
in general Raspbian is a debian release for Raspberry Pi, and the bash is almost the same as on any other release.
By the way bash means Bourne-Again SHell.The original bourne shell is named sh, not bash. You can read about .bashrc and related files on the man page of bash.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.