how to open a file and edit in linux comand code example Example 1: edit text file bash sudo nano file.text Example 2: linux edit file sudo nano filename.ext