Monday, January 30, 2012

Copy, Remove, Tar, Change Owner, Change mod, Clear History

How to check size folder
#du -h
#df -h

tar files
#tar -cjvf sha.tar.bz2 fold1 fold2 fold3 fold4
c- create j-tar.bz2 v-show process f-files
# tar cvzf archive_name.tar.gz dirname/


copy file tar to another server
#scp sha.tar.bz2 shariha@162.12.12.22:
ni dia akan pi ke home shariha di server 162.12.12.22

untar
#tar -xjvf sha.tar.bz2
#tar -zxvf sha.tgz
#tar -xvzf sha.tar.gz

katakan nak move file tuh ke /data/mms
#cd /data/mms
#mv /home/shariha/sha.tar.bz2 ./
./ means current path

Change ownership
#chown -R www-data:www-data fold1 fold2 fold3 fold4

Change mod
#chmod -R 755 fold1 fold2 fold3
| 7 | 5 | 5 |
|rwx|r-x|r-x|
|owner|group|world|

Copy
#cp -rp /home/shariha/sha.tar.bz2 /data/mms

copy name folder start from 3** (30, 300, 301, 321..etc)
#cp -rp /../data/3* ./
so dia akan copy apa2 yang foldername start 3... kepada current path

Clear History
#history -c
kalu laa tertype password.. leh argh nak clearkan.. 

Find / Whereis 
#find /path/want/to/search -name mysong.php (ubuntu)
or
#find /path/want/to/search -name *.php
or
#whereis

No comments:

Post a Comment