Copyright(c) by Galaxy CD – http://www.galaxycd.com
19
Baøi 4: Sao cheùp, chuyeån, lieân keát vaø tìm kieám file.
Noäi dung: caùc thao taùc, caùc leänh thöôøng duøng vôùi file
4.1 Sao cheùp file
Leänh
cp
(copy) cho pheùp ta sao cheùp moät hoaëc nhieàu file:
-
sao cheùp moät file:
$
cp
file_nguoàn
file_ñích
-
sao cheùp nhieàu file vaøo moät thö muïc:
$
cp
file1 file2… thö_muïc
-
sao taát caû caùc file vaøo moät thö muïc:
$
cp
*
thö_muïc
Thí duï:
$
pwd
/users/user2
$
ls
-l
total 2
drwxrwxr-x 2
user2 stagiair
32
Apr
5
16:31 copie
drwxrwxr-x 2
user2 stagiair
96
Apr
5
16:31 source
$
cd
source
$
ls
-l
total 3
-rw-rw-r-- 1 user2 stagiair
16
Apr
5
16:25 original1
-rw-rw-r-- 1 user2 stagiair
17
Apr
5
16:26 original2
-rw-rw-r-- 1 user2 stagiair
18
Apr
5
16:27 original3
$
ls
-l
../copie
total 0
$
cp
original1
../copie/original1.copie
$
ls
-l
../copie
total 1
-rw-rw-r-- 1 user2 stagiair 16
Apr
5
16:25 original1.copie
$
cp
*
../copie