To do this, add a PATH variable to your .bashrc file.
For example, to add a directory called /getstuff/bin, type the following:
PATH=$PATH:/getstuff/bin ; export PATH
This example first reads all the current path directories into the new PATH ($PATH), adds
the /getstuff/bin directory, and then exports the new PATH.
Some people add the current directory to their PATH by adding a directory identified
simply as a dot (.), as follows:
PATH=.:$PATH ; export PATH
This enables you always to run commands in your current directory before evaluating any other command
in the path (which people may be used to if they have used DOS). However, the security risk
with this procedure is that you could be in a directory that contains a command that you don??™t intend
to run from that directory. For example, a malicious person could put an ls command in a directory
that, instead of listing the content of your directory, does something devious. Because of this, the
practice of adding the dot to your path is highly discouraged.
WHATEVER??”You can create your own environment variables to provide shortcuts in
your work. Choose any name that is not being used and assign a useful value to it. For
example, if you do a lot of work with files in the /work/time/files/info/memos
directory, you could set the following variable:
M=/work/time/files/info/memos ; export M
You could make that your current directory by typing cd $M.
Pages:
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208