I want to find out there is a p4 command that can find cl submitted in a depot branch from a cl submitted in another depot branch.
like -
if CL 123 was submitted to branch //code/v1.0/files/...
and same code changes were also submitted to another branch //code/v5.0/files/...
can i find out cl in 2nd branch from cl 123?
There are a few different methods; which one is easiest will depend on the exact context/requirements of what you're doing.
If you're interested in the specific lines of code rather than the metadata, p4 annotate is the best way.  Use p4 describe 123 to see the lines of code changed in 123, and then p4 annotate -c v5.0/(file) to locate the same lines of code in v5.0 and see which changelist(s) introduced them into that branch.  This method will work even if the changes were copied over manually instead of using Perforce's merge commands.
If you want to track the integration history (i.e. the metadata) rather than the exact lines of code (which may have been edited in the course of being merged between codelines, making the annotate method not work), the easiest method is to use the Revision Graph tool in P4V, which lets you visually inspect a file's branching history; you can select the revision from change 123 and use the "highlight ancestors and descendants" tool to see which revisions/changelists it is connected to in other codelines.  This makes it easy to see the context of how many integration steps were involved, who did them, when they happened, whether there were edits in between, etc.
If you want to use the metadata but you're trying for a more automated solution, changes -i is a good tool.  This will show you which changelists are included in another changelist via integration, so you can do p4 changes -i @123,123 to see the list of all the changes that contributed to change 123.  On the other side (finding changelists in v5.0 that 123 contributed to), you could do this iteratively; run p4 changes -i @N,N for each changelist N in the v5.0 codeline, and see which of them include 123 in the output (it may be more than one).
In P4, how do i check if a change submitted to one branch is also submitted to another branch using command