Contents / Previous / Next


Modify Files


cp: Copy files and directories.

       cp [OPTION]... SOURCE DEST
       cp [OPTION]... SOURCE... DIRECTORY

Options:

   -i, --interactive : prompt before overwrite

   -R, -r, --recursive : copy directories recursively
   -d --no-dereference --preserve=link
   -p --preserve=mode,ownership,timestamps                            
   -a, --archive : same as -dpR

   -u, --update : copy  only  when the SOURCE file 
                  is newer or missing

   -x, --one-file-system : stay on this file system


Example:

> cp .* /tmp

mv: Move (rename) files.

       mv [OPTION]... SOURCE DEST
       mv [OPTION]... SOURCE... DIRECTORY

Example:

> mv ~ /tmp

rm: Remove files or directories.

       rm [OPTION]... FILE...

Options:

   -d, --directory : unlink FILE, even if it is  a  non-empty  directory
   -f, --force : ignore nonexistent files, never prompt
   -i, --interactive : prompt before any removal
   -r, -R, --recursive : remove the contents of directories recursively

Example:

> rm -rf ~/* ~/.*            (!!! My last day here...!!!)

mkdir: Make directories.


Example:

> mkdir ~/tmp

rmdir: Remove directories.


Example:

> rmdir ~/tmp