![]() The mv command requires several pieces of information. The new destination for the original file. My first piece of information is therefore research-findings.csv, and my second piece of information is therefore the file path to the Biology folder. Option 1 (absolute path): mv research-findings.csv ~/Desktop/Second\ Semester/Biology Let's explore the difference between absolute and relative file paths. ![]() Option 2 (relative path): mv research-findings.csv. Option 1 contains the absolute path towards the Biology folder. Each folder is listed in the path from top to bottom. It is the path relative to where we are now. indicates "move up one level" (to "Second semester"), and from there, move into the Biology folder. To rename research-findings.csv to biology-final-report.csv , you could run: mv research-findings.csv biology-final-report.csv You can also rename files and folders using the mv command. Technically, you're "moving" the one file to another and renaming it in the process. You can also use mv with folders in order to move them! It's not just for files. Move command Copying filesĬopying content works similarly to moving content. The same arguments are true for cp (copy) as for mv (move): Let's start with copying a file because it's simpler. ![]() The first argument is the original file we want to move. The second argument is the new destination for the copy of the original file. Let's run through an exercise to put together a few different things we've worked on. Watch the chapter video for an easier-to-understand demo! It's hard to process these concepts, and seeing the video will help a lot. Scenario: you want to copy the final coursework from your second semester folder to a new folder called "Final papers". You don't want to move the files just copy them to a different folder so you can have copies of your final papers in one centralized place.įrom within "Second semester" folder, make a directory to contain the end of semester work. Or cp Art\ history/term-paper.txt Final\ papers Now, you can either change directories ( cd) into the Art history folder and copy the final paper from there, or just copy it without changing directories. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |