Point taken. It wasn't taken personally.
|
Quote:
Also, I would still like to know exactly what it is that I am doing when I use the ./ command? |
Quote:
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. |
Quote:
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 ">". |
I would recommend you not use spaces in filenames, they are difficult to deal with because the shell assumes that spaces separate a list of filenames.
|
Code:
mv g95manual.pdf g95 Code:
mv g95manual.pdf .. # .. is a shortcut for the upper level directory Quote:
Code:
cd ` |
The way the backticks work is that they are substituted for the output of the command in them.
Code:
$ pwd Note that the backticks are sometimes considered "deprecated". This is the new way: Code:
$ pwd |
So it seems that the ticks can be used to embed one command within another. Why is it then that if I put nothing between the ticks, for example:
Code:
cd `` Code:
cd ` Also, if . is a shortcut for the current working directory, what is the / for? |
The default action for cd is to change to your home directory. cd `` is equivalent to cd.
Path name components are separated by /, so when you specify the current directory with ., a slash must separate it from the file name following. |
All times are GMT -5. The time now is 02:33 PM. |