Tuesday, October 2, 2012

Compress/Decompress files and sub directories and ftp files in unix


To compress files and sub directories present in root directory

tar -cvf [Target - Compressed File Name.desired extension] [Source - Directory to compress]

to ftp from [unix.source.server] to [unix.target.server]

Login to [unix.source.server]
cd to sourc dircetory from where you would want to ftp file/s
$ ftp [unix.target.server]
promts to login: enetr user-name
promts for password: eneter valid password
ftp$ binary -- To set the file transfer mode to binary
or
ftp$ ascii -- To set the file transfer mode to ASCII
ftp$ put [filename] or mput [pattern]-- to place one or more files respectively
ftp$ bye -- to come out successfully from ftp mode

Similarly we can use get / mget to get the files from remote server to the currently connected server


To decompress to the desired location

tar -xvf [Source - Compressed File Name.desired extension] [Target - Directory to which you want decompress files]

No comments:

Post a Comment