In: Computer Science
Demonstrate creating, moving, and copying files from the Linux command line. (Document with steps and screenshots.)
In linux
(a)The command to create file: touch filename
Example:
Explanation:
line 1: I have a file created 'hello.txt' in Chegg folder.
line 2: 'ls' command is used to show the files in that folder.
The folder contains the newly created file 'hello.txt'
(a)The command to create file: mv source destination
here
source: location of the file to be moved.
destination: path to where the file is to be moved
Example:
Line 1: folder1 is created.
Line 2: folder2 is created.
Line 3: we entered into folder1
Line 4: A new file is created
Line 5: the file is moved from the source directory or current directory to ../folder2
Line 6:'ls' commands shows there is no 'file,txt' in folder1
Line 7 &8: Enter into folder2
Line 9: 'ls' command shows Folder2 contains 'file.txt'
so the move command is successful
The command to create file: cp source destination
here
source: location of the file to be copied.
destination: the path to where the file is to be pasted.
Example:
Line1: The file.txt is copied from the current directory (folder2)to folder1.
Line 2: folder2 still contains file.txt
Line 3 &4:move to folder1
LIne 5: folder1 also contains file.txt
so copy command is successful.