Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to use diff with -y to get side-by-side output, but my output gets messed up after about 18 lines. Here is an example, any clue why? (Check from *.java_pool_size=134217728) :

*._unnest_subquery=FALSE                    *._unnest_subquery=FALSE
*.archive_lag_target=1800                   *.archive_lag_target=1800
*.audit_file_dest='/u01/app/oracle/admin/xxxxxxx/adump'       <
*.audit_sys_operations=TRUE                 *.audit_sys_operations=TRUE
*.audit_trail='DB_EXTENDED'                 *.audit_trail='DB_EXTENDED'
*.compatible=''                   *.compatible=''
*.control_files='/u01/app/oracle/oradata/xxxxxxx/control01.ct | *.control_files='/u01/app/oracle/oradata/xxxxxxx/control01.ct
*.cursor_sharing='EXACT'                      | *.cursor_sharing='SIMILAR'
                                  > *.cursor_space_for_time=TRUE
*.db_block_size=8192                        *.db_block_size=8192
*.db_domain='xxxxxxxxxx.com'                      | *.db_domain=''
*.db_file_multiblock_read_count=8                 | *.db_file_multiblock_read_count=32
*.db_name='xxxxxxx'                     *.db_name='xxxxxxx'
*.db_writer_processes=8                     *.db_writer_processes=8
*.diagnostic_dest='/u01/app/oracle'             *.diagnostic_dest='/u01/app/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=xxxxxxxXDB)'     *.dispatchers='(PROTOCOL=TCP) (SERVICE=xxxxxxxXDB)'
                                  > *.EVENT='1652 TRACE NAME ERRORSTACK LEVEL 3'
*.fast_start_mttr_target=300                    *.fast_start_mttr_target=300
*.java_pool_size=134217728                    | *.instance_name='xxxxxx'
*.job_queue_processes=10                      | *.log_archive_dest_1='LOCATION=/xxxxxxx-05/oradata/arch'
*.large_pool_size=167772160                   | *.log_archive_dest_state_1='enable'
*.log_archive_dest_1='LOCATION=/xxxxxxx-04/oradata/arch'      <
*.log_archive_format='arch_%t_%s_%r.arc'            *.log_archive_format='arch_%t_%s_%r.arc'
*.log_checkpoint_timeout=0                    | *.log_buffer=1048576
*.log_checkpoint_to_alert=TRUE                    | *.log_checkpoint_interval=0
*.log_buffer=14289920                         | *.log_checkpoints_to_alert=TRUE
*.open_cursors=4000                       | *.open_cursors=1500
*.parallel_adaptive_multi_user=FALSE                  | *.optimizer_features_enable=''
*.pga_aggregate_target=2500M                      | *.optimizer_mode='ALL_ROWS'
*.processes=3000                          | *.pga_aggregate_target=527433728
*.query_rewrite_integrity='TRUSTED'               | *.processes=800
                                  > *.query_rewrite_enabled='TRUE'
                                  > *.query_rewrite_integrity='Trusted'
*.recyclebin='OFF'                      *.recyclebin='OFF'
*.remote_login_passwordfile='EXCLUSIVE'             *.remote_login_passwordfile='EXCLUSIVE'
*.sec_case_sensitive_logon=FALSE                  | *.SEC_CASE_SENSITIVE_LOGON=FALSE
*.session_cached_cursors=1000                     | *.session_cached_cursors=1200
*.session_max_open_files=30                   | *.session_max_open_files=20
*.sga_target=4G                           | *.sessions=2000
*.standby_file_management='AUTO'                  | *.sga_max_size=2600M
                                  > *.sga_target=2600M
                                  > *.sort_area_size=524288
                                  > *.star_transformation_enabled='FALSE'
*.streams_pool_size=50331648                    *.streams_pool_size=50331648
                                  > *.timed_statistics=TRUE
*.undo_management='AUTO'                    *.undo_management='AUTO'
*.undo_retention=18000                        | *.undo_retention=21600
*.undo_tablespace='UNDOTBS1'                    *.undo_tablespace='UNDOTBS1'
share|improve this question
Can you post sample input files that demonstrate the problem? – Gilles Jan 23 '13 at 22:31

Your files are sufficiently different to confuse diff's lookahead and matching algorithms e.g. the lack of an "s" on checkpoint in log_checkpoint_to_alert will prevent the following block from tying up:

*.log_archive_format='arch_%t_%s_%r.arc'        *.log_archive_format='arch_%t_%s_%r.arc'
*.log_checkpoint_timeout=0                    | *.log_buffer=1048576
*.log_checkpoint_to_alert=TRUE                    | *.log_checkpoint_interval=0
*.log_buffer=14289920                         | *.log_checkpoints_to_alert=TRUE
*.open_cursors=4000                       | *.open_cursors=1500

Have you considered using the likes of Diffuse or Meld, as they offer alternative and / or manual intervention in the matching?

share|improve this answer

its jumbled because of line wrapping

to avoid this: play with the -W switch to force the width in columns

   -W columns
        Use an output width of columns in side by side format.
share|improve this answer
I will play around and will get back.. – Nirmal Arri Jan 23 '13 at 19:16
Doesn't budge an inch. – Nirmal Arri Jan 23 '13 at 19:20
Guys any clue why diff -y would do this. – Nirmal Arri Jan 24 '13 at 19:37
This question is also for the gentleman who wrote diff??? – Nirmal Arri Jan 24 '13 at 19:38

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.