-
Table of Contents
- Copyright
- About the Author
- Acknowledgments
- Tell Us What You Think!
- Introduction
- Part I: Introduction to Mac OS X
- Chapter 1. Mac OS X Component Architecture
- Chapter 2. Installing Mac OS X
- Chapter 3. Mac OS X Basics
- Chapter 4. The Finder: Working with Files and Applications
- Chapter 5. Running Classic Mac OS Applications
- Part II: Inside Mac OS X
- Chapter 6. Native Utilities and Applications
- Chapter 7. Internet Communications
- Chapter 8. Installing Third-Party Applications
- Part III: User-Level OS X Configuration
- Chapter 9. Network Setup
- Chapter 10. Printer and Font Management
- Chapter 11. Additional System Components
- Part IV: Introduction to BSD Applications
- Chapter 12. Introducing the BSD Subsystem
- Chapter 13. Common Unix Shell Commands: File Operations
- Part V: Advanced Command-Line Concepts
- Chapter 14. Advanced Shell Concepts and Commands
- Chapter 15. Command-Line Applications and Application Suites
- Chapter 16. Command-Line Software Installation
- Chapter 17. Troubleshooting Software Installs, and Compiling and Debugging Manually
- Chapter 18. Advanced Unix Shell Use: Configuration and Programming (Shell Scripting)
- Part VI: Server/Network Administration
- Chapter 19. X Window System Applications
- Chapter 20. Command-Line Configuration and Administration
- Chapter 21. AppleScript
- Chapter 22. Perl Scripting and SQL Connectivity
- Chapter 23. File and Resource Sharing with NetInfo
- Chapter 24. User Management and Machine Clustering
- Chapter 25. FTP Serving
- Chapter 26. Remote Access and Administration
- Chapter 27. Web Serving
- Part VII: Server Health
- Chapter 28. Web Programming
- Chapter 29. Creating a Mail Server
- Chapter 30. Accessing and Serving a Windows Network
- Chapter 31. Server Security and Advanced Network Configuration
- Chapter 32. System Maintenance
-
Appendix A. Command-Line Reference
- apropos
- at, atq, atrm, batch
- atrun
- automount
- biff
- bg
- bsdmake
- cat
- catman
- cd
- chflags
- chgrp
- chmod
- chown
- cmp
- compress
- cp
- crontab
- defaults
- diff
- df
- du
- dump
- dumpfs
- emacs
- exports
- fetchmail
- fg
- find
- from
- fsck
- fstab
- ftp
- ftpd
- gnumake, make
- grep
- gzip, gunzip, zcat
- halt, reboot
- head
- id
- ifconfig
- ipfw
- jobs
- kill
- last
- cat
- locate
- ln
- lpq
- lpr
- lprm
- ls
- man
- mkdir
- more, page
- mount
- mountd
- mount_nfs
- mv
- natd
- netinfo
- netstat
- newfs
- nfsiod
- nfsd
- nidump
- niload
- niutil
- nohup
- passwd
- pico
- ping
- popd
- printcap
- ps
- pushd
- pwd
- restore
- rm
- rmdir
- scp
- sed
- showmount
- ssh-agent
- ssh-keygen
- sort
- strings
- su
- tail
- tar
- top
- traceroute
- tunefs
- umount
- uptime
- uuencode
- vi, ex, view
- w
- wget
- whatis
- which
- who
- whoami
- Appendix B. Administration Reference
gzip, gunzip, zcat
| gzip | |
| gunzip | |
| zcat | Compresses or expands files. |
gzip [-acdfhlLnNrtvV19] [-S <suffix>] <file1> <file2> …
gunzip [-acfhlLnNrtvV] [-S <suffix>] <file1><file2> …
zcat [-fhLV] <file1>
<file2> …
|
|
| gzip reduces the size of a file and renames the file by adding the .gz extension. It keeps the same ownership modes, and access and modification times. If no files are specified, or if the filename - is specified, standard input is compressed to standard output. gzip compresses regular files, but ignores symbolic links. | |
| Compressed files can be restored to their original form by using gunzip, gzip -d, or zcat. | |
| gunzip takes a list of files from the command line, whose names end in .gz, -gz, .z, -z, _z, or .Z, and which also begin with the correct magic number, and replaces them with expanded files without the original extension. gunzip also recognizes the extensions .tgz and .taz as short versions of .tar.gz and .tar.Z, respectively. If necessary, gzip uses the .tgz extension to compress a .tar file. | |
| zcat is equivalent to gunzip -c. It uncompresses either a list of files on the command line or from standard input and writes uncompressed data to standard output. zcat uncompresses files that have the right magic number, whether or not they end in .gz. | |
| Compression is always formed, even if the compressed file is slightly larger than the original file. | |
| -a | ASCII text mode. Converts end-of-lines using local conventions. Supported only on some non-Unix systems. |
| —ascii | Same as -a. |
| -c | Writes output to standard output and keeps the original files unchanged. |
| —stdout | Same as -c. |
| —to-stdout | Same as -c. |
| -d | Decompresses. |
| —decompress | Same as -d. |
| —uncompress | Same as -d. |
| -f | Forces compression or decompression, even if the file has multiples links or if the corresponding file already exists, or if the compressed data is read from or written to a terminal. If -f is not used, and gzip is not working in the background, the user is prompted before a file is overwritten. |
| -h | Displays a help screen and quits. |
| —help | Same as -h. |
| -l |
Lists the following fields for each compressed file: compressed (compressed size) uncompressed (uncompressed size) ratio (compression ratio; 0.0% if unknown) uncompressed_name (name of uncompressed file) Uncompressed size is -1 for files not in gzip format. To get an uncompressed size for such files, use zcat <file1.Z> | wc -c Combined with -verbose, it also displays method (compression method) crc (32-bit CRC of the uncompressed data) date and time (time stamp of the uncompressed file) Compression methods supported are deflate, compress, lzh, and pack. crc is listed as ffffffff when the file is not in gzip format. |
| —list | Same as -l. |
| -L | Displays the gzip license and quits. |
| —license | Same as -L |
| -n |
When compressing, does not save the original filename and time stamp by default. (Always saves the original name if it has to be truncated.) When decompressing, it does not restore the original name (only removes .gz) and time stamp (only copies it from compressed file), if present. This is the default. |
| —no-name | Same as -n. |
| -N |
When compressing, always saves the original filename and time stamp. This is the default. When decompressing, it restores the original time stamp and filename if present. |
| —name | Same as -N. |
| -q | Suppresses all warnings. |
| —quiet | Same as -q. |
| -r |
Traverses the directory structure recursively. If a filename specified on the command line is a directory, gzip/gunzip descends into the directory and compresses/decompresses the files in that directory. |
| —recursive | Same as -r. |
| -S <suffix> |
Uses <suffix> instead of .gz. Any suffix can be used, but it is recommended that suffixes other than .z or .gz be avoided to avoid confusion when transferring them to other systems. A null suffix (-S "") forces gunzip to try decompression on all listed files, regardless of suffix. |
| —suffix <suffix> | Same as -S <suffix>. |
| -t | Test. Checks the integrity of the compressed file. |
| —test | Same as —test. |
| -v | Verbose. Displays the name and percentage reduction for each file compressed or decompressed. |
| —verbose | Same as -v. |
| -V | Version. Displays the version number and compilation options and quits. |
| —version | Same as -V. |
| -<n> | |
| —fast | |
| —best | Regulates the speed of compression as specified by -<n>, where -1 (or —fast) is the fastest compression method (least compression) and -9 (or —best) is the slowest compression method (most compression). Default compression option is -6. |
halt, reboot | Next Section