View A Text File's Contents

Often we want to look at the contents of some code or configuration file. In Linux, we can do this using the less command.

Create A Text File With Some Contents

echo "Hello World" > hello_world.txt

View Contents Of File

To view the contents of a file we can open it in the nano, a common text editor in Linux systems.

nano hello_world.txt

If we want to leave a file we can press ctrl-x.