edit file linux command code example

Example 1: rename a file in linux

mv oldfile.txt newfile.txt

Example 2: command to edit in terminal linux

type nano followed by the file name

Example 3: linux edit file

sudo nano filename.ext

Example 4: edit a file linux

vi filename.extension

//press i to insert into file
//press ESC to enter menu
//Type :wq to save data

Example 5: edit files from terminal linux

nano FileName.Extension

// nano MyWork.txt
// nano MyScript.py

Example 6: rename file linux

mv (option) filename1.ext filename2.ext