MX on Linux: Difference between revisions

88 bytes added ,  16:29, 31 August 2020
m
Line 43: Line 43:
There are various text editors available on a Pi, '''nano''' is a simple one. Like other text editors this can create a file when a file does not exist and edit (subject to file permissions) an existing file. The sudo gives you access to any file, it does not change the actual file access, so you might find you can read a file, but not save it after you have done your edit.   
There are various text editors available on a Pi, '''nano''' is a simple one. Like other text editors this can create a file when a file does not exist and edit (subject to file permissions) an existing file. The sudo gives you access to any file, it does not change the actual file access, so you might find you can read a file, but not save it after you have done your edit.   


The full syntax is <tt>sudo nano -B Path_file_name</tt> where the '''-B''' means it will create a backup of how the file was before. Alternatively use '''-C''' which stores each version in a back-up directory.  If you want to edit from a particular line and column you can use '''+line.column''', and also optionally use '''-l''' (lower-case "L") to display line numbers which might be useful when trying to correct a problem with a log file like [[dayfile.txt]].  If you don't specify a file name, then nano will create a new file and you will need to specify where to save it before exit.
The full syntax is <tt>sudo nano -B Path_file_name</tt> where the '''-B''' means it will create a backup of how the file was before (this can be enabled while in the editor by pressing the control key down and typing B). Alternatively use '''-C''' which stores each version in a back-up directory.  If you want to edit from a particular line and column you can use '''+line.column''', and also optionally use '''-l''' (lower-case "L") to display line numbers which might be useful when trying to correct a problem with a log file like [[dayfile.txt]].  If you don't specify a file name, then nano will create a new file and you will need to specify where to save it before exit.




5,838

edits