Lesson 10: Copy a File (cp)
I had an aha moment right off the bat with this one- instead of naming one file in the command, you name first the file that already exists then the file you want to create. "cp" allows you to copy a file and give the new file a new name simultaneously. "cp -r" lets you copy directories with files in them. This does not simultaneously rename the files, however.
It appears that you can only copy files into directories that are inside the file's current directory.
Lesson 11: Moving a File (mv)
This was pretty straightforward. mv renames a file. This is different from cp because you end with the same number of files you started with.
Lesson 12: View a File (less, MORE)
Before I could start this lesson I had to figure out how to move a file to a directory that is not located within the current directory. It turns out I was having difficulty with this because I was omitting an (apparently) crucial / from the beginning of the path.
For some reason with "less" you omit the .txt when you enter the command ( less ex12 worked for me but less ex12.txt did not). Then you view the file and press q when you're done.
Then I copied the text that I wrote so it would take several screens. I'm glad I did, as scrolling in Terminal looks weird: there is no sensation of movement at all, only a colon to tell you there's more and [end] to tell you there isn't.
No comments:
Post a Comment