How to edit .profile if it is read-only?

Hello, I am new to Zorin OS and Linux.
I am having problem editing .profile. I am using xrandr to set a custom resolution and want to keep it permanently. I saw some tutorials of keeping the custom resolution permanent but I am unable to edit the .profile. It says its read-only, any way to fix this? Thanks

cd <distination>
sudo nano .profile

ctrl+o = save
ctrl+x = exit

1 Like

sudo apt install nautilus-admin

Then navigate to the file you want to edit, right-click and select " Edit As Administrator ".

Alternatively, you can do sudoedit {/path/file}, where {/path/file} is the path to and the file you wish to edit, sans the brackets.

To make is so that gedit rather than nano opens when you do sudoedit, enter this into your /home/$USER/.bashrc file:

# Edit files by using sudoedit {/path/file}
export SUDO_EDITOR='/usr/bin/gedit -w'
1 Like

I must comment that this is an Odd Situation.
~.profile should be under your ownership. Why would it be set to read only?
There may be more going on here.

I rebooted my system and everything is back to normal. Maybe it was a problem from my side.

This is true... here's how the file properties should look:

Right-click the .profile file and select  Properties . Go to the  Permissions  top-tab.
Owner: Me
Access: Read & Write
Group: {your user name}
Access: Read-only
Others: {blank}
Access: Read-only
Execute: {not checked}

If it's not the above, do sudo nautilus, navigate to that file, change the properties to that above, then close nautilus.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.