Any unix gurus around? Need some help.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Just Alex
    Liv Benson to You, Bitch
    • Aug 2007
    • 6060

    #1

    Any unix gurus around? Need some help.

    So I have a list of file names in txt format that should be in directory A. Turns out that some files are missing and I need to find out which ones. Is there way to run thru the list of required files from files.txt and spool list of missing files to missing.txt ?

    so I have ---> xargs -a files.txt ......

    Help brother out.
  • raymor
    Confirmed User
    • Oct 2002
    • 3745

    #2
    ls -1 a/ >have.txt
    diff -Bb have.txt want.txt
    For historical display only. This information is not current:
    support@bettercgi.com ICQ 7208627
    Strongbox - The next generation in site security
    Throttlebox - The next generation in bandwidth control
    Clonebox - Backup and disaster recovery on steroids

    Comment

    • raymor
      Confirmed User
      • Oct 2002
      • 3745

      #3
      Ps you may need to sort your list first:
      sort want.txt > sorted.txt

      diff sorted.txt have.txt


      diff is also great for figuring out what changed between two versions of a file:
      diff -Bb file.bak file.html
      Last edited by raymor; 12-22-2011, 06:21 PM.
      For historical display only. This information is not current:
      support@bettercgi.com ICQ 7208627
      Strongbox - The next generation in site security
      Throttlebox - The next generation in bandwidth control
      Clonebox - Backup and disaster recovery on steroids

      Comment

      • Just Alex
        Liv Benson to You, Bitch
        • Aug 2007
        • 6060

        #4
        Originally posted by raymor
        ls -1 a/ >have.txt
        diff -Bb have.txt want.txt
        Thank you man. I didn't even think that way.
        Thinking more of a programer with loops and ifs.
        Happy holidays to you !!!

        Comment

        Working...