In this work, we study the time evolution of the entanglement hamiltonian during the process of thermalization in a (1+1)-dimensional conformal field theory (CFT) after a quantum quench from a special class of initial states. In particular, we focus on a subsystem which is a finite interval at the end of a semi-infinite line. Based on conformal mappings, the exact forms of both entanglement hamiltonian and entanglement spectrum of the subsystem can be obtained. Aside from various interesting features, it is found that in the infinite time limit the entanglement hamiltonian and entanglement spectrum are exactly the same as those in the thermal ensemble. The entanglement spectrum approaches the steady state spectrum exponentially in time. We also study the modular flows generated by the entanglement hamiltonian in Minkowski spacetime, which provides us with an intuitive picture of how the entanglement propagates and how the subsystem is thermalized. Furthermore, the effect of a generic initial state is also discussed. arXiv:1807.04440v2 [cond-mat.str-el]