The field lines of a solenoid and bar magnet appear same in many ways.
similarities:
1 ) In both the cases the magnetic lines inside the body is strong and uniform.
2 ) In both the cases there exists stronger field at the poles compared to the middle parts.
3 ) In both cases magnetism is cause by flow of electric current in circular loops,
in bar magnet this occurs in the atomic scale.
Dissimilarities:
1 ) The people of the bar magnet do not lie exactly on the end of the magnet but is somewhat inside.
In solenoid poles can be considered to be lying at the edge.
2 ) The magnetism retains in the bar magnet naturally but in solenoid the magnetism is there so
long current flows through it.