How to use Commands & Command Blocks
To enter normal console commands, you need to open the command line with Forward slash [/] then enter a command, and press [enter] to perform the function.
To get a command block (they aren't directly accessible) type the following command into the console:
/give @p command_block
Only players in creative mode can open command block's command line to enter commands. You can do this with right-clicking on said block.
When some command block machines are set up, you may see gray text spammed in the chat continuously. This is just MC's way to show updated blocks, etc. To make this not appear, you can use the following command in the console:
/gamerule commandBlockOutput false
In short, when starting a new world or using Command blocks for the first time, put the above two commands into your console.
You can copy and paste commands to/from/between blocks and textfiles. You just need to know basic keyboard shortcuts:
Ctrl + [A] Selects all text in a field/command line.
Ctrl + [C] Copies selected text.
Ctrl + [V] Pastes copied text.