cp command GNU bash

commandline session

$> 1
$echo hello > 2
$cat 1
$
$cat 2
hello
$cp -b 2
cp: missing destination file operand after ‘2’
Try 'cp --help' for more information.
$cp -b 2 2b
$ls
1  2  2b
$cat 2b
hello
$cp -x 2b 2c
$ls
1  2  2b  2c
$cat 2c
hello
$cp -x 2b /proc/
cp: cannot create regular file ‘/proc/2b’: Permission denied
$sudo cp -x 2b /proc/
cp: cannot create regular file ‘/proc/2b’: Permission denied
$cp -s 2c 2d
$ls -l
total 12
-rw-r--r-- 1 jeffrin jeffrin 0 Jun  1 22:28 1
-rw-r--r-- 1 jeffrin jeffrin 6 Jun  1 22:28 2
-rw-r--r-- 1 jeffrin jeffrin 6 Jun  1 22:28 2b
-rw-r--r-- 1 jeffrin jeffrin 6 Jun  1 22:29 2c
lrwxrwxrwx 1 jeffrin jeffrin 2 Jun  1 22:31 2d -> 2c
$

http://pluto.infoclub.in/wp-content/uploads/2013/06/cp.c
http://stackoverflow.com/questions/5740042/enum-use-in-a-c-program

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s