Difference between revisions of "Viewing and editing configuration files"

m
Template inserted
(Marked this version for translation)
m (Template inserted)
(2 intermediate revisions by the same user not shown)
Line 15: Line 15:
<!--T:5-->
<!--T:5-->
You can use the command cat to dump the contents of a file to the screen by typing cat <filename>.  For example to view the contents of your fstab you could use:
You can use the command cat to dump the contents of a file to the screen by typing cat <filename>.  For example to view the contents of your fstab you could use:
   cat /etc/fstab
   {{UserCmd|command=cat /etc/fstab}}


<!--T:6-->
<!--T:6-->
For larger files where it would be better to navigate around you can use less.  For example, to view the contents of your pacman.conf you could type:
For larger files where it would be better to navigate around you can use less.  For example, to view the contents of your pacman.conf you could type:
   less /etc/pacman.conf
   {{UserCmd|command=less /etc/pacman.conf}}


== Editing files from the terminal == <!--T:7-->
== Editing files from the terminal == <!--T:7-->
Line 26: Line 26:
<!--T:8-->
<!--T:8-->
To open a configuration file with nano simply type nano <filename>.  For example, to edit your .profile file you could type:
To open a configuration file with nano simply type nano <filename>.  For example, to edit your .profile file you could type:
   nano ~/.profile
   {{UserCmd|command=nano ~/.profile}}


<!--T:9-->
<!--T:9-->
Line 36: Line 36:
<!--T:11-->
<!--T:11-->
The first is to use sudo to run the text editor.  For example, to edit your fstab file you could type:
The first is to use sudo to run the text editor.  For example, to edit your fstab file you could type:
   sudo nano /etc/fstab
   {{UserCmd|command=sudo nano /etc/fstab}}


<!--T:12-->
<!--T:12-->
An alternative, and arguably safer method, would be to save a copy of the file somewhere you can write and then use sudo to move it.  For example, if you used nano to edit your fstab and then saved a copy to your home folder, you could then move it to the proper location with sudo:
An alternative, and arguably safer method, would be to save a copy of the file somewhere you can write and then use sudo to move it.  For example, if you used nano to edit your fstab and then saved a copy to your home folder, you could then move it to the proper location with sudo:
   sudo mv ~/fstab /etc/fstab
   {{UserCmd|command=sudo mv ~/fstab /etc/fstab}}


= Desktop Environment = <!--T:13-->
= Desktop Environment = <!--T:13-->
Line 47: Line 47:
<!--T:14-->
<!--T:14-->
To edit or view a file you can open it directly from the command line.  Reference the list below to find the appropriate editor installed with your edition.  For example to open your pacman.conf from the XFCE edition you could type:
To edit or view a file you can open it directly from the command line.  Reference the list below to find the appropriate editor installed with your edition.  For example to open your pacman.conf from the XFCE edition you could type:
   mousepad /etc/pacman.conf
   {{UserCmd|command=mousepad /etc/pacman.conf}}


<!--T:15-->
<!--T:15-->
Line 79: Line 79:
<!--T:21-->
<!--T:21-->
If they don't, you can save a copy of the file to your home folder and move it into place using sudo.  For example, if you edit your fstab and then saved a copy to your home folder, you could then move it to the proper location with sudo:
If they don't, you can save a copy of the file to your home folder and move it into place using sudo.  For example, if you edit your fstab and then saved a copy to your home folder, you could then move it to the proper location with sudo:
   sudo mv ~/fstab /etc/fstab
   {{UserCmd|command=sudo mv ~/fstab /etc/fstab}}
</translate>
</translate>


[[Category:Contents Page{{#translation:}}]]
[[Category:Contents Page{{#translation:}}]]
translator
995

edits