How to create and edit a new text file in Bash?

To create a new text file in Bash, you can use the touch command followed by the name of the file you want to create. For example, to create a file named "example.txt", you would run:

touch example.txt

To edit the file, you can use a text editor such as nano or vi. For instance, to edit the "example.txt" file using nano, you would run:

nano example.txt

This will open the file in the nano text editor, where you can make and save changes to the text file.