Where Online Learning is simpler!



$ whatis cp

cp cp (1) - copy files and directories

cp cp (1) - copy files

Examples:

Please see the following examples for 'cp' command:

# ls -l toc.html

-rw-rw-r-- 1 root root 3049 2011-04-07 23:48 toc.html

# file toc.html

toc.html: html document

# cp toc.html.bak

# ls -l toc.html toc.html.bak

-rw-rw-r-- 1 root root 3049 2011-04-07 23:48 toc.html -rwxr-xr-x 1 root root 3049 2011-04-08 01:52 toc.html.bak

# du -sh toc.html*

4.0K toc.html

3.5K toc.html.bak

# du -sh toc.html toc.html.bak

4.0K toc.html

3.5K toc.html.bak

# diff toc.html toc.html.bak

# cmp toc.html toc.html.bak

# ls -l toc.html toc.html.bak

-rw-rw-r-- 1 root root 3049 2011-04-07 23:48 toc.html -rwxr-xr-x 1 root root 3049 2011-04-08 01:52 toc.html.bak

# cp -p toc.html toc.html.newbak

# ls -l toc.html toc.html.bak toc.html.newbak

-rw-rw-r-- 1 root root 3049 2011-04-07 23:48 toc.html -rwxr-xr-x 1 root root 3049 2011-04-08 01:52 toc.html.bak -rw-rw-r-- 1 root root 3049 2011-04-07 23:48 toc.html.newbak

# ls -ld TOC

drwxr-xr-x+ 5 root root 8 2011-02-26 13:55 TOC

# file TOC

TOC: directory

# ls -ld TOC TOC.bak

drwxr-xr-x+ 5 root root 8 2011-02-26 13:55 TOC drwxr-xr-x+ 5 root root 8 2011-02-26 13:55 TOC.bak

# du -sh TOCC TOC.bak

343K TOC 343K TOC.bak

# diff TOC.html TOC.bak

diff: TOC.html: No such file or directory

# diff TOC TOC.bak

Common subdirectories: TOC/Media and TOC.bak/Media Common subdirectories: TOC/Scripts and TOC.bak/Scripts Common subdirectories: TOC/Table_of_Contents_files and TOC.bak/Table_of_Contents_files

# diff TOC TOC.bak-TOC TOC.bakrTOC TOC.bak TOC TOC.bak

# ls -l TOC

total 17 -rw-r--r-- 1 501 501 679 2011-02-15 00:04 feed.xml -rw-r--r-- 1 501 501 319 2011-02-15 00:04 index.html drwxr-xr-x+ 2 501 501 3 2011-02-15 00:04 Media drwxr-xr-x+ 3 501 501 4 2011-02-15 00:04 Scripts drwxr-xr-x+ 2 501 501 14 2011-02-15 00:04 Table_of_Contents_files -rw-r--r-- 1 root root 9529 2011-02-26 13:55 Table_of_Contents.html

# ls -l TOC.bak

total 17 -rw-r--r-- 1 501 501 679 2011-02-15 00:04 feed.xml -rw-r--r-- 1 501 501 319 2011-02-15 00:04 index.html drwxr-xr-x+ 2 501 501 3 2011-02-15 00:04 Media drwxr-xr-x+ 3 501 501 4 2011-02-15 00:04 Scripts drwxr-xr-x+ 2 501 501 14 2011-02-15 00:04 Table_of_Contents_files -rw-r--r-- 1 root root 9529 2011-02-26 13:55 Table_of_Contents.html

Please click on " man cp " to see the Manual Page for this command.


Previous Home Page Next



Contact us     |      About us     |      Term of use      |      Copyright © 2000-2025 MyWebUniversity.com ™