Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users


UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 02-16-2012
Registered User
 
Join Date: Jan 2012
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
Permission Comparision

Hi,

I need to know how to compare the permissions of files which are in two different directories in Unix..

Experts - can any one help on this..!!!
Sponsored Links
    #2  
Old 02-16-2012
...@...
 
Join Date: Feb 2004
Location: NM
Posts: 9,645
Thanks: 164
Thanked 639 Times in 616 Posts
This is very vague. Do the files in the different directories have all the same names?

If so, this finds differences in permissions :

Code:
ls -l /path/to/dir1 > file1
ls -l /path/to/dir2 > file2
awk ' FILENAME=="file1" {arr[$(NF)]=$1}
        FILENAME=="file2"  { print  $(NF),  (arr[$(NF)] == $1)? "matches": "no match"}

The Following User Says Thank You to jim mcnamara For This Useful Post:
yanis (02-16-2012)
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
awk: string followed by tab comparision ysvsr1 Shell Programming and Scripting 3 01-30-2012 11:34 PM
File comparision with AWK / SED mrpugster Shell Programming and Scripting 1 03-25-2011 07:08 AM
while - comparision sharif Shell Programming and Scripting 2 11-01-2007 05:58 AM
date comparision Hitesh Shah Solaris 1 10-26-2007 07:35 AM
SuSE comparision lungs SuSE 8 02-12-2005 12:36 AM



All times are GMT -4. The time now is 06:57 PM.