Quote:
Originally Posted by colucix
You should definitively read something about where the shell look for commands and the PATH environment variable. Here is a good starting point.
Personally, I'd not put my own executables in /usr/bin, since this is the place where many system wide commands are placed (moreover you need root privileges to add/remove something from /usr/bin). Better to keep them in your HOME directory, for example in /home/user/bin ( user being your true user name). Furthermore, this directory is already listed in the PATH environment variable by many Linux distributions.
Hope this helps.
|
Hey that's great thanks for the link, very informative.
Through my experimentation, it seems then that to move a file from its current directory to a subdirectory I use the command mv, then the name of the fie, then the name of the subdirectory into which I want to move the file. What if I want to go in the other direction though? For example:
BenardLenards-MacBook-Pro:g95 BenardLenard$ mv g95manual.pdf "fortran code files"
BenardLenards-MacBook-Pro:g95 BenardLenard$ ls
Fortran Code Files bin
INSTALL lib
BenardLenards-MacBook-Pro:g95 BenardLenard$ cd "fortran code files"
BenardLenards-MacBook-Pro:fortran code files BenardLenard$ ls
a.out g95manual.pdf ini_1.f95 ini_2.f95
BenardLenards-MacBook-Pro:fortran code files BenardLenard$ pwd
/Users/BenardLenard/g95/fortran code files
BenardLenards-MacBook-Pro:fortran code files BenardLenard$ ls
a.out g95manual.pdf ini_1.f95 ini_2.f95
BenardLenards-MacBook-Pro:fortran code files BenardLenard$ mv g95manual.pdf g95
BenardLenards-MacBook-Pro:fortran code files BenardLenard$ ls
a.out g95 ini_1.f95 ini_2.f95
BenardLenards-MacBook-Pro:fortran code files BenardLenard$
Here we can see that I have moved the file "g95manual.pdf" from the G95 directory into the subdirectory "Fortran Code Files" with success. Then, when trying to move the same file back to its original position, I seem to have somehow renamed the file to "g95" instead of moving it to the g95 directory.
My questions are:
How can I rename it to what it originally was.
How can I move the file to where it originally was.
(on a side note, what does the command "cd `" do? I accidentally entered this instead of "cd ~" and it gave me a ">".