you can use dcmdump. Option +L makes sure all tags (i.e. also those with very long tag values) will be dumped.
In general you can send dcmdump output to a file (dcmdump DICOMFILE > output.txt).
If you want to extract only selected tags, you can additionally use dcmdump's +P option to select the tag of interest, e.g.
dcmdump +L +P "(0029,1030)" DICOMFILE. You can also repeat +P multiple times to select more than one tag.
I don't see another way to extract the private data using the commandline tools.