GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Any unix gurus around? Need some help. (https://gfy.com/showthread.php?t=1051027)

Just Alex 12-22-2011 08:15 PM

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. :helpme

raymor 12-22-2011 08:18 PM

ls -1 a/ >have.txt
diff -Bb have.txt want.txt

raymor 12-22-2011 08:20 PM

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

Just Alex 12-22-2011 08:23 PM

Quote:

Originally Posted by raymor (Post 18648070)
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 !!!


All times are GMT -7. The time now is 12:46 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123