read simply reads the value(s) of the specified device node(s). Type read <device name><.><node name> to print the value of the node in the console. You can tab-complete the read command to list all the available devices and nodes that can be read.
You can read as many device nodes as you want at once. Just keep listing them after the command: read <device name 1><.><node name> <device name 2><.><node name>
For example, typing read <motor name><.>softPosition will print the software position of the motor specified to the console. Alternately, typing read <motor name><.>hardPosition or read <motor name><.>rawPosition will print the hardware or raw positions to the console. More on software, hardware, and raw positions in the Motors section.
It’s important to note that by not specifying a node, the read command will default to reading the value of the primary node. A primary node is simply the default device property that a command affects when none has been chosen. Most devices contain primary nodes. In the case of motor devices, the primary node is the software position. So, typing read <motor name> will do the same thing as typing read <motor name><.>softPosition.
If you cannot remember a node name, then type read <motor name><.> and hit Tab to list all the device nodes.
Another point to note is that read fetches the latest value from the hardware’s memory by default. You can turn this setting off by setting the passive flag. This is done by typing read -p or read --passive.
display is identical to read except in that it fetches the most recently cached value in the server’s memory. In other words, display does not fetch values from the hardware’s memory by default. The main reason this difference between read and display matters is speed: if you read many device nodes at once, then the command will run slower than if you tried to display many device nodes at once.
To see this difference, you can simply type read on the command line with no arguments. This will read every node value on every device from the hardware and take a long time to complete. Running display with no arguments will be faster.