User Tools

Site Tools


wiki:cpmv

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
wiki:cpmv [2015/11/11 10:44]
asa
wiki:cpmv [2015/11/13 09:40]
asa
Line 1: Line 1:
-==== Moving and copying files and directories (chapter 4) ====+===== Moving and copying files and directories (chapter 4) =====
  
 First, go into the ''​cs580''​ directory we created last time. First, go into the ''​cs580''​ directory we created last time.
Line 9: Line 9:
 </​code>​ </​code>​
 Type some stuff and then save the file and exit the program. Type some stuff and then save the file and exit the program.
 +
 +We can view the contents of the file without having to invoke the editor by using the ''​more''​ or ''​less''​ commands:
 +<code bash>
 +$ more my_new_file.txt
 +</​code>​
 +Note that ''​less''​ is more powerful than ''​more''​ and has a few additional features.
  
 Now, to demonstrate why it's not a good idea to use spaces in file names, try the following: Now, to demonstrate why it's not a good idea to use spaces in file names, try the following:
Line 83: Line 89:
 $ rm -R copy_of_cs580 $ rm -R copy_of_cs580
 </​code>​ </​code>​
-Be very careful with "​rm"​. ​ Linux does not have a way of undoing its action.+Be very careful with "​rm"​. ​ Linux does not have a way of undoing its action. ​ As a way of addressing that, it is not a bad idea to use the -i option of rm, which will ask you to verify each removed file/​directory. ​ It can be combined with other options, e.g.: 
 +<code bash> 
 +$ rm -Ri copy_of_cs580 
 +</​code>​
  
 === Renaming/​moving files/​directories === === Renaming/​moving files/​directories ===
wiki/cpmv.txt · Last modified: 2016/08/02 14:47 (external edit)