When using the touch, nano, echo, or cat commands, you can specify the desired file extension as part of the file name. Ensure that you include the dot (".") character before the extension.