Restores a gzipped file to its normal size. The gunzip command also restores files compressed with compress or pack.
Syntax gunzip [-c] [-f] [-r] [-v] filenames
Option or argument |
Function |
-c |
Sends the uncompressed file to standard output (usually the screen) instead of to a new file; the original file is unchanged. (This is the same as using zcat.) |
-f |
Forces uncompression, even if a file with the same name already exists. |
-h |
help |
-r |
Recursive; If any of the file names are directories, gunzip descends into the directory (and any of its subdirectories) and uncompresses all the files it finds there. |
-S |
use suffix .xxx on compressed files |
-v |
Verbose; displays how much each file is being expanded. |
filenames |
Specifies the gzipped files to uncompress. |
Sample:
If you want to see what’s in the compressed file facts, type:
gunzip -h
gunzip –c facts
gunzip -S .zip ctp_bsct006_01_datadict.txt.zip
Compresses one or more files into one gzipped file so that it takes up less space on your disk. The compressed file has the same name as the original, but with the suffix .gz attached. When your want to get your original files back, you use gunzip or gzip –d.
Syntax gunzip [-c] [-d] [-f] [-l] [-r] [-v] filenames
Option or argument |
Function |
-c |
Sends the gzipped file to standard output (usually the screen) instead of to a new file; the original file is unchanged. |
-d |
Decompresses; the same as using gunzip. |
-f |
Forces compression, even if a gzipped file already exists. |
-h |
help |
-l |
Displays how much the gzipped file(s) shrank. |
-r |
Recursive; If any of the file names are directories, gzip descends into the directory (and any of its subdirectories) and compresses all the files it finds there. |
-S |
use suffix .xxx on compressed files |
-v |
Verbose; displays how much each file is being shrunk. |
filenames |
Specifies the file(s) to compress. |
Sample:
You have created a series of very large files and have put them inside a directory called My_Big_Files. Now you want to save all these files in a compressed format to save space. Type
gzip -h
gzip –rv My_Big_Files
gzip -S .zip ctp_bsct006_01_datadict.txt (normally use this one. If "gzip -S .zip xxx.txt" in AIX, can’t unzip the file in windows or MF.)
Show the first part of files. v.s. tail.
e.g. head -5 xxx
Lists the last 20 or so commands you typed. In Korn shell, "alias history=fc -l".
Syntax history
To execute the last command again, type r.
Tells you what your numeric user and group Ids are and, BSD, which groups you’re in. You can use it when you want to know your user and group Ids so that you can tell your wizard what they are when you ask for help.
Syntax id
Lists the jobs that are running in either the foreground or the background or those that are stopped.
Syntax jobs
Cancels a job that you don’t want to continue.
Syntax kill %job
or
kill [-9] pid
Option or argument |
Function |
job |
Specifies the job that you want to kill. You can use the job number listed by the jobs command or a percent sign (%) and the first few letter a of the program that’s running. |
-9 |
Tells kill to show no mercy in killing the program; kill it no matter what. Useful if milder measures failed. |
pid |
Specifies the process ID of the job. You can use the ps command to find out the job’s process ID. |
Samples:
If a program is truly out of control, Ctrl+C may not stop it. In this case, you may have find out it process ID(pid) to kill it. Use the ps command to see its pid(4444, for example) and then type:
kill –9 4444
You begin running a program called big.report and realize that you did something wrong. You stop the job by pressing Ctrl+Z; the message Stopped is displayed. To kill the program, type
kill %big
show using situation of recent users.
Syntax last [-n] [-f file] [-t tty] [-h] [-i IP] [-l] [-y] [ID]
Lists the files in a directory.
Syntax ls [-a] [-l] [r] [R] [pathname]
ls [-acdlrRsStuX] [-size] [-sort=time] [-sort=extension]
Option or argument |
Function |
-1 |
Show files as single-column list. |
-a |
List all files and subdirectories, including hidden files (those with names that begin with a dot). |
-e |
Display number of links, owner, group, size (in bytes), time of last modification, and name of each file. |
-F |
Indicate file types; / = directory, * = executable. |
-g |
Displays the same information as the -l flag, except the -g flag suppresses display of the owner and symbolic link info. |
-l |
Displays detailed information about each file and directory, including permissions, owners, size, and when the file was last modified. |
-m |
Show files as comma-separated list. |
-r |
Displays files in reverse order. |
-s |
Gives size in kilobytes (including indirect blocks) for each entry. |
-R |
Includes the contents of all subdirectories, too. |
-t |
Sorts by time of last modification instead of by name. |
* |
e.g. ls xxx*, like dir xxx* in DOS. |
Samples:
ls –l or
ls –l |more to display the information one page each time.
ls -R *axmh* (but if data is too much, ls -R will not work)
ls [a,b]*
Syntax lsgroup <group name>