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.
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.
But this will only work if you are in the parent directory of 'BAL013', and setting up 100+ of these is going to be very tedious. Plus, they will take up as much memory as the symlinks will take up disk space, if not more. I think this is a task better suited for a shell function:
Code:
cd_dir () {
cd /home/mettam/work/${1}
}
and call it like:
Code:
$ cd_dir BAL013
You can put this function in your .bashrc and it will get sourced at login just like an alias.
As yet another alternative, set the bash CDPATH variable:
Code:
export CDPATH=.:/path/to/work
CDPATH now includes the current directory and /path/to/work and this works from anywhere in the file system. For example, if you are in /usr/local and you type `cd BAL001` you will be taken to /path/to/work/BAL001. See `man bash` and search for CDPATH for a bit more info.
A bash script needs to load up another terminal and run the command cd, so a bash script will take up both hard drive and memory space.
Who said anything about a bash script? I mentioned a shell function, and the one I posted takes all of 33 bytes. If you put it in your .bashrc it will be sourced at login, and it will be available in the current terminal.
In any event, it is looking like gilead's solution is the most elegant for the OP's purposes.
The problem now is I am forced to use tcsh not bash, so my aliases are entered in my .cshrc.user file. I tryed to enter Bulliver's script in my .cshrc file but it didnt understand it.
Can someone give me the syntax for a .cshrc file.
Bulliver's file looks ideal if only it worked with tcsh.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.