0% found this document useful (0 votes)
59 views

Unix

The zcat command expands compressed files to standard output without decompressing them. It writes the expanded output to standard output and does not rename the file or remove the file extension. Examples show how to view the contents of a .z file or get its uncompressed size by piping the output. The compress command compresses files and renames them with a .z extension. It can write the compression percentage to standard error. The uncompress command uncompresses .z files and renames them without the extension.

Uploaded by

Faisal Mustaq
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as RTF, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
59 views

Unix

The zcat command expands compressed files to standard output without decompressing them. It writes the expanded output to standard output and does not rename the file or remove the file extension. Examples show how to view the contents of a .z file or get its uncompressed size by piping the output. The compress command compresses files and renames them with a .z extension. It can write the compression percentage to standard error. The uncompress command uncompresses .z files and renames them without the extension.

Uploaded by

Faisal Mustaq
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as RTF, PDF, TXT or read online on Scribd
You are on page 1/ 3

ZCAT COMMAND PURPOSE EXPANDS A COMPRESSED FILE TO STANDARD OUTPUT. SYNTAX ZCAT [ -N ] [ -V ] [ FILE ...

] DESCRIPTION THE ZCAT COMMAND ALLOWS THE USER TO EXPAND AND VIEW A COMPRESSED FILE WITHOUT UNCOMPRESSING THAT FILE. THE ZCAT COMMAND DOES NOT RENAME THE EXPANDED FILE OR REMOVE THE .Z EXTENSION. THE ZCAT COMMAND WRITES THE EXPANDED OUTPUT TO STANDARD OUTPUT. EXAMPLES TO VIEW THE FOO.Z FILE WITHOUT UNCOMPRESSING IT, ENTER: ZCAT FOO.Z THE UNCOMPRESSED CONTENTS OF THE FOO.Z FILE ARE WRITTEN TO STANDARD OUTPUT. THE FILE IS NOT RENAMED.

TO GET THE UNCOMPRESSED SIZE FOR SUCH A FILE, YOU CAN USE: ZCAT FILE.Z | WC -C
--------------------------------------------------------------------------------------------------------------------------------

GZIP -C TEST.TXT > TEST.GZ IN THE ABOVE EXAMPLE COMMAND THIS WOULD COMPRESS THE TEST.TXT FILE AS TEST.GZ IN THE CURRENT DIRECTORY. GUNZIP -C TEST.GZ IN THE ABOVE EXAMPLE COMMAND YOU WOULD BE ABLE TO SEE THE CONTENTS OF THE TEST.GZ FILE. IF YOU WANTED TO EXTRACT THE CONTENTS OF THAT FILE INTO ANOTHER FILE YOU WOULD USE THE BELOW COMMAND TO EXTRACT THE CONTENTS INTO THE TEST.TXT FILE. GUNZIP -C TEST.GZ > TEST.TXT --------------------------------------------------------------------------------------------------------------------------------------------------------COMPRESS:

TO COMPRESS THE FOO FILE AND WRITE THE PERCENTAGE OF COMPRESSION TO STANDARD ERROR, ENTER: COMPRESS -V FOO THE FOO FILE IS COMPRESSED AND RENAMED FOO.Z. -D CAUSES THE COMPRESS COMMAND TO FUNCTION EXACTLY LIKE THE UNCOMPRESS COMMAND. -F OR -F FORCES COMPRESSION. THE -F AND -F FLAGS ARE INTERCHANGEABLE. OVERWRITES THE FILE.Z FILE IF IT ALREADY EXISTS.

AFTER THE VALUE OF THE BITS VARIABLE IS ATTAINED, THE COMPRESS COMMAND PERIODICALLY CHECKS THE COMPRESSION RATIO. IF IT IS INCREASING, THE COMPRESS COMMAND CONTINUES TO USE THE EXISTING CODE DICTIONARY. HOWEVER, IF THE COMPRESSION RATIO DECREASES, THE COMPRESS COMMAND DISCARDS THE TABLE OF SUBSTRINGS AND REBUILDS IT. REBUILDING THE TABLE ALLOWS THE ALGORITHM TO ADAPT TO THE NEXT BLOCK OF THE FILE. WHEN THE .Z FILE ALREADY EXIST, IF THE -F FLAG IS NOT GIVEN, AND THE PROCESS IS NOT RUNNING IN THE BACKGROUND, IT PROMPTS TO VERIFY WHETHER TO OVERWRITE THE EXISTING .Z FILE. UNCOMPRESS: TO UNCOMPRESS THE FOO.Z FILE, ENTER: UNCOMPRESS FOO.Z THE FOO.Z FILE IS UNCOMPRESSED AND RENAMED FOO.

To transfer a file in binary mode, enter the binary command before the get command:
ftp> binary ftp> get foo.zip

For example, if you want to remove the files older than 30 days means , find . -mtime +30 -exec rm {}\; the above command will search for the files in current directory and removes the one which is older than 30 days.

This find outs the string in set of files in current and sub directories find <directoryname> -type f -exec grep "<string>" {} \; -print | more > results.txt Ex: find /appl/ifx1/etldata/scripts -type f -exec grep "pmcmd" {} \; -print | more > results.txt find . -name \*ddnorth\* -ls

To find occurance of word in directory and subdirectories: find . -type f -exec grep -il mprdbprd08 {} \; egrep -l 'mprdbprd08' * - in only current directory cat s_cdw_afs_avb_param_file.prm | grep 'RECOVERY_FLAG'

select sys_context('USERENV','CURRENT_USER') || '@' || sys_context('USERENV','DB_NAME') || '.' || sys_context('USERENV','DB_DOMAIN') || ' (Schema: ' || sys_context('USERENV','CURRENT_SCHEMA') || ')' "ID" from dual;

You might also like