The g command is the junk drawer of commands, but the basics of it is that it can take you to specific spots and in a file.
The g command by itself won't do anything, it requires a motion.
This will take you to the first line in a file.
This will take you to the last line in the file.
You can also move to a specific line in a text file by prefixing it the number of the line.
Note: If you don't see lines in the file it means that the number line options is turn off. To turn them on you type:
There are many other things you can do with the g command like
This will give you more detailed info on the specific line in that file.