User Tools

Site Tools


copy_move_delete

This is an old revision of the document!


Copy Move Delete



To Copy/Delete a file use cp

  To copy a file use:
  cp filename path/filename
  
  To copy the file test.txt to the folder /home/pi/new
  cp test.txt /home/pi/new


Copying Directories (and contained files)

  To copy a directory
  cp -avr source_directory destination_directory
  
  To copy the directory /home/pi/dir1 to the folder /home/pi/test
  cp -avr /home/pi/dir1 /home/pi/test
  
  Now you will have a /home/pi/test/dir directory


The attributes -avr represent

  a   Preserve the specified attributes such as directory and file mode, ownership, timestamps, etc.
  v   Show results
  r   Recursive, action all subfolders and files.



To Move use mv

copy_move_delete.1471775678.txt.gz · Last modified: 2023/03/09 22:35 (external edit)