User Tools

Site Tools


opus:fall2012:khoose2:part1

Part 1

Entries

Entry 1: 9/5/2012

I understand everything done by a computer is the result of a file regardless of what it is, this is important because it cleared up a lot of things done by computers that I couldn't comprehend prior to learning this.

Entry 2: 9/14/2012

Learned the basics of the ViM text editor, this will be extremely helpful to know in the future because as I understand more about Linux/Unix the more I suspect I will favor them in the not-too-distant future.

Entry 3: 9/28/2012

Today wildcars are introduced, they will be very helpful when searching long lists of entries or when I'd like to know how many entries there possibly are.

Entry 4: 9/28/2012

Today I learned about the use of scripts and their potential applications, this is exciting because the usefulness is only limited by how far you take it.

Keywords

Keyword

File modes (permissions)

Definition

Settings assigned to a file, influencing the access privileges of User(Host), Guest(not user, same terminal), and World(everyone else).

References

List any sites, books, or sources utilized when researching information on this topic. (Remove any filler text).

  • Matthew Haas, The Lair, in CSCS1730 class.
  • Dj Dates, C208 CCC, in CSCS1200 class.

unix Keyword 1 Phase 2

file copying/moving/renaming

Definition

File copying- When you of make a copy of a file or folder using the command cp. File moving- When you move a folder or file to a different location using the mv command. File renaming- When you rename a file or folder also uses the mv command.

References

Demonstration

Demonstration of the indicated keyword.

Alternatively (or additionally), if you want to demonstrate something on the command-line, you can do so as follows:

lab46:~$ vim file1
lab46:~$ ls
Desktop    Music      Videos           closet   public_html
Documents  Pictures   archive1.tar.gz  file.c   src
Downloads  Public     archive2.zip     file.gz  the answer.txt
Maildir    Templates  archives         file1
lab46:~$ mv file1 file2
lab46:~$ ls
Desktop    Music      Videos           closet   public_html
Documents  Pictures   archive1.tar.gz  file.c   src
Downloads  Public     archive2.zip     file.gz  the answer.txt
Maildir    Templates  archives         file2
lab46:~$ mv file2 /home/khoose2/src/Unix/submit/Opus
lab46:~$ cd /home/khoose2/src/Unix/submit/Opus | ls
file2

Experiment 1

Question

How can you both rename and and move files using the same command?

Resources

Hypothesis

I hypothesize that the input 'mv file1 file2' will perform the action of changing the file name of 'file1' to 'file2'. I also hypothesize that the input 'mv file2 /home/khoose2/src/Unix/submit/Opus' will move the file 'file2' from the previous hypothesis test, to the final directory destination of Opus.

From what I have read it seems that the linux command 'mv' can be used to both rename and move files. The difference is the use of paths for moving files, and the use of file names when renaming.

Experiment

I will;

  1.) create a sample file named 'file1' by inputing the command 'vim file1'.
   A.) once in the vi text editor type ':wq', exiting the file and saving it.
   B.) enter the input command 'ls' to verify the creation of file 'file1'.
   B.) enter the input command 'mv file1 file2'.
   C.) enter 'ls' to verify the change of name to 'file2'.
  2.) enter the input command 'mv file2 /home/khoose2/src/Unix/submit/Opus'.
   A.) input the command 'cd /home/khoose2/src/Unix/submit/Opus | ls'; thus displaying the contents of the specified directory to verify the file 'file2' was successfully moved.
   

Data

lab46:~$ vim file1 lab46:~$ ls Desktop Music Videos closet public_html Documents Pictures archive1.tar.gz file.c src Downloads Public archive2.zip file.gz the answer.txt Maildir Templates archives file1 lab46:~$ mv file1 file2 lab46:~$ ls Desktop Music Videos closet public_html Documents Pictures archive1.tar.gz file.c src Downloads Public archive2.zip file.gz the answer.txt Maildir Templates archives file2 lab46:~$ mv file2 /home/khoose2/src/Unix/submit/Opus lab46:~$ cd /home/khoose2/src/Unix/submit/Opus | ls file2

Analysis

Based on the data collected:

  My hypothesis was correct, the actions I predicted were verified by my experiment and testing. There were no errors and the command were accepted without question.

Conclusions

Thanks to my experiment I illustrated the example of how the Linux command 'mv' can be used for both moving files and renaming files, depending on the use of paths or file names. This illustration proves my hypothesis correct.

opus/fall2012/khoose2/part1.txt · Last modified: 2012/09/30 19:12 by khoose2