AIX 5L Basics (Unit 14) – AIX Utilities – Part 2

Differential File Comparator:
—————————————-
diff – compares text files (character by character)
cmp – compares any file type (byte by byte)

dif [-options] file1 file2
Uses the following codes to make suggestions on how to make the files the same.
a=add, c=change, d=delete

dircmp -d – compare files in directories -d(using diff)
dircmp -d /home/team01 /home/team02 | pg

1. Lists files unique to each directory.
2. List files with identical names
3. Display differeneces for common files.

Compress/Uncompress:
———————————–
ls -l file1 (note original size)
compress -v file1 –> file1.Z (uppercase Z)
uncompress file1.Z
zcat file1.Z – displays the contents of a compressed file

Pack/Unpack:
——————–
pack file1 –> file1.z (lowercase z)

cat myfile
cat -vte myfile – Displays non-printable characters in files
-v – display non-printable char
-t – Display tab character as ^I
-e – Dispaly $ at end of each line

Assigning unique file names:
——————————————
touch myfile$$ – Appends the process id: $$
myfile 1288

Append the date to a command:
———————————————-
touch myfile.$(date+ ‘%m%d’) or (date + ‘%m%d%H%M%S)
myfile.0214

Note: This uses command substitution.

Leave a Reply

Your email address will not be published. Required fields are marked *

*