opening lammps data file with vmd from the terminal directly.

Hi All,

This is not a lammps question and not important. I’m just asking if anyone has a solution to it …

We can open a pdb file with vmd using a single command “vmd filename.pdb” in the terminal. I’m trying to do the similar thing with a lammps data file.

I tried - echo “topo readlammpsdata filename.data” | vmd

This opens the lammps data file filename.data in vmd, but the window is closing immediately.

Does any one has a hack for this ?

Thank you.

Try this:

echo "topo readlammpsdata filename.data" > vmd_vizlammps.tcl
vmd -e vmd_vizlammps.tcl

You can make it a one-liner by putting a semicolon between the two commands.

Andrew

Thanks Andrew,

One can make it even shorter/simpler.

Paste this line in your .bashrc or the relevant file.

vmdlmp() { echo “topo readlammpsdata $1” > tmp.tcl; vmd -e tmp.tcl; rm -f tmp.tcl; }

Then one can open the lammps data fine by simply

vmdlmp filename.data

Best,