Stanford University School of Engineering offers free online courses (October-December, 2011) for the following topics:
* Artifical Intelligence: http://www.ai-class.com/
* Databases: http://www.db-class.com/
* Machine Learning: http://www.ml-class.com/
Welcome to my programming blog. This Blog contains my research and notes pertaining to programming. You are free to use any information on this site however you must make a comment on the blog, and put credit in your code that you obtained it from here. You can contact me directly at rob @at@ robsprogrammingjunk.com.
Thursday, August 18, 2011
Comparing files across linux or unix boxes
I recently had the problem of needing to compare files across linux boxes. The problem was that I wanted to diff them easily. After some trial and error I found out how to easily diff two files on two different boxes.
ssh user@myserver.com "cat /var/www/html/myfile.php" |diff - myfile.php
What this does is SSH into the box, then cat the output of the file. This is piped into diff and then compared to the local file.
I used the -b option as well (though not shown) to ignore white space changes since they were html files.
This saved a lot of time comparing files vs copying them to a local filesystem and doing a diff there.
ssh user@myserver.com "cat /var/www/html/myfile.php" |diff - myfile.php
What this does is SSH into the box, then cat the output of the file. This is piped into diff and then compared to the local file.
I used the -b option as well (though not shown) to ignore white space changes since they were html files.
This saved a lot of time comparing files vs copying them to a local filesystem and doing a diff there.
Subscribe to:
Posts (Atom)