[SOLVED] create a "bookmark" for navigating filesystem from the linux command line
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!
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.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
I would like to add to what Sasha posted is that you could setup a .bashrc & .bash_profile for your user;
~$ cat .bash_profile
# .bash_profile <<< Begin of File
# Source .bashrc
if [ -f ~/.bashrc ]; then
fi <<< End Of File (EOF)
:~$ cat .bashrc
#.bashrc <<<< begin of file
# Add bin to path
# Dynamic resizing
shopt -s checkwinsize
# Custom prompt
if [ `id -un` = root ]; then
# Add color
eval `dircolors -b`
# User defined aliases
alias clls='clear; ls'
alias ll='ls -l'
alias lsa='ls -A'
alias lsg='ls | grep'
alias lsp='ls -1 /var/log/packages/ > package-list'
alias web='links -g -download-dir ~/ www.google.com'
alias pond="cd ~Dropbox/programming/ruby/function_library/pond_design"
#To clean up and cover your tracks once you log off
#Depending on your version of BASH, you might have to use
# the other form of this command
trap "rm -f ~$LOGNAME/.bash_history" 0
#The older KSH-style form
# trap 0 rm -f ~$LOGNAME/.bash_history <<< End Of File (EOF)
That is a great idea. Thank you. However, I'm having a hard time understanding everything you are doing with the .bashrc and .bash_profile.
Is there a way to simply create a .bash_aliases and put them in there?
I did this:
# User defined aliases
alias pond="cd ~/Dropbox/programming/ruby/function_library/pond_design"
and saved that in .bash_aliases but when I type pond the bash command is not recognized. Can you explain what I have to do so that it is recognized?
If you copy each of the text samples to their own file then you can use them. The first sample is a '.bash_profile' where I test for the existance of '.bashrc' then execute if there. The second sample is '.bashrc' that you would have your commands that you wish available. The first part test for 'root' if so then the colorized prompt is set red with the prompt information. Otherwise it is set to green for a normal user for prompt. Then the alias is setup. At the close is just for cleanup.
So if you save each sample to the required files for '.bashrc' and '.bash_profile' you would have things set for the next time you enter the console. There after for each time you enter your console you would have things setup this way until you change or remove the files.
~/.bashrc and ~/.bash_profile are two bash initialization files, ~/.bash_aliases is not, and bash has no means to know that. Bash can't open every single file in your home directory to see what's inside of it.
Bash will source ~/.bashrc when it's launched in a non-login interactive mode, for example, when you use an xterm or a similar terminal emulator. ~/.bash_profile will be read automatically when you use bash as a login shell, for example when you login in command line instead of a graphical login manager.
Hence, all the bash related stuff goes either into ~/.bashrc, ~/.bash_profile, or both. Or, if you want to set it globally, into /etc/profile. However, I don't understand what the difficulty is. It isn't any more complicated to create a file called ~/.bashrc than it is to create one named ~/.bash_aliases...