16.12.2012 Views

z/OS V1R9.0 UNIX System Services Command ... - Christian Grothoff

z/OS V1R9.0 UNIX System Services Command ... - Christian Grothoff

z/OS V1R9.0 UNIX System Services Command ... - Christian Grothoff

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Examples<br />

Localization<br />

Exit values<br />

1. The following command takes a directory and places it in an archive in<br />

compressed format:<br />

tar –cvzf archive directory<br />

2. To identify all files that have been changed in the last week (7 days), and to<br />

archive them to the /tmp/posix/testpgm file, enter:<br />

find /tmp/posix/testpgm –type f –mtime –7 | tar –cvf testpgm.tar –<br />

–type –f tells find to select only files. This avoids duplicate input to tar.<br />

3. In the following examples, archive acidata.tar contains file1, file2, and dir1. file1<br />

has no ACL data, file2 has an access ACL, and dir1 contains a file default, a<br />

directory default, and an access ACL. If you only specify option –f, your output<br />

will be:<br />

> tar -f acldata.tar<br />

file1<br />

file2<br />

dir1<br />

If you also specify –L A, ACL information will be displayed:<br />

> tar -L A -f acldata.tar<br />

file1<br />

file2<br />

user:WELLIE2:rw-<br />

group:SYS1:rwx<br />

Finally, if you add the verbose option, –v, you will see the chmod settings<br />

associated with the file:<br />

> tar -L A -vf acldata.tar<br />

-rwx------ 1 STIERT SHUT 294912 Nov 9 09:57 file1<br />

-rwx------+ 1 STIERT SHUT 294912 Nov 9 09:57 file2<br />

user:WELLIE2:rw-<br />

group:SYS1:rwx<br />

drwxr-xr-x+ 2 STIERT SHUT 8192 Mar 20 2000 dir1/<br />

user:RRAND:rwx<br />

user:WELLIE2:rw-<br />

group:SHUT:rwx<br />

fdefault:user:RRAND:rwx<br />

fdefault:group:SHUT:r-x<br />

default:user:ANGIEH:rwx<br />

default:group:SYS1:r--<br />

tar uses the following localization environment variables:<br />

v LANG<br />

v LC_ALL<br />

v LC_MESSAGES<br />

v NLSPATH<br />

See Appendix F for more information.<br />

0 Successful completion<br />

1 Failure due to any of the following:<br />

v Incorrect option<br />

v Incorrect command-line arguments<br />

v Out of memory<br />

tar<br />

Chapter 2. Shell command descriptions 625

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!