[LINUX] The file edited with vim was readonly but I want to save it

Domo is Fugito. This time, "** The file edited with vim was readonly, but I want to save my edits ** "About the problem.

Edit without any thought

(Fugito-kun, a new engineer. It looks like I edited the file with vim today. )

"** Oh, I can save the edited content **"

E45: 'readonly' option is set (add ! to override)

Consult with seniors

"Senior, I can't save the edited content." "Ah Fugi and you, this is a read-only file The principle can be edited and it is a specification. " "Is it true? It's a rewrite ... ??" "No, no peace of mind" "Are you saying'** Principle **'?" "Read the above message carefully" "Well ..." ** add! To override ** "?" "Oh, something"! "Do you mean you can change the settings if you put a mark?" "Seya, that street" "Forcibly save (overwrite) the edited contents even in the readonly file There is a command. "

Forced saving of edited contents

"This is the command"

:w !sudo tee %

"It's very simple." "Seyaro" "**" sudo tee "for the file (%) to be opened now Forcibly overwrite the edited contents ** "Hey, is that so?" "Oh, that would require sudo privileges." "Seyana" "It's not the only thing" "If you force save, exit with **: q! **" "Kondeya" "In a blink of an eye" "Thank you very much ('ω`)"

Park ... Articles that I referred to

→https://hacknote.jp/archives/12412/ →http://tm.root-n.com/unix:command:vim:readlonly_write

That's all for today. See you soon.

Recommended Posts

The file edited with vim was readonly but I want to save it
I want to do it with Python lambda Django, but I will stop
I want to tweet on Twitter with Python, but I'm addicted to it
I tried to save the data with discord
Save the object to a file with pickle
I want to write to a file with Python
I want to write an element to a file with numpy and check it.
I want to see the file name from DataLoader
I want to scroll the Django shift table, but ...
I tried to touch the CSV file with Python
I want to inherit to the back with python dataclass
I want to save a file with "Do not compress images in file" set in OpenPyXL
I want to replace the variables in the python template file and mass-produce it in another file.
What I did when I was angry to put it in with the enable-shared option
[IOS] GIF animation with Pythonista3. I was addicted to it.
I want to save the photos sent by LINE to S3
I want to change the Japanese flag to the Palau flag with Numpy
[Python] I want to use the -h option with argparse
I want to know the legend of the IT technology world
I tried to divide the file into folders with Python
It was great to edit the Python file in the Raspberry Pi with Atom's remote function
I want to cut out only the face from a person image with Python and save it ~ Face detection and trimming with face_recognition ~
I want to do ○○ with Pandas
I want to debug with Python
I want to know the weather with LINE bot feat.Heroku + Python
I want to output the beginning of the next month with Python
For the time being, I want to convert files with ffmpeg !!
I want to check the position of my face with OpenCV!
I want to specify a file that is not a character string for logrotate, but is it impossible?
I want to pin Spyder to the taskbar
I want to detect objects with OpenCV
I want to output to the console coolly
When I tried to run Python, it was skipped to the Microsoft Store
I want to handle the rhyme part1
I don't want to admit it ... The dynamical representation of Neural Networks
I want to blog with Jupyter Notebook
If you just want to get the dump file of the server, it was convenient to build an http server
I want to handle the rhyme part3
Even if I converted jpg to png, I managed to do it because the transparency was not tampered with
Edit and save read-only files with vim
I want to pip install with PythonAnywhere
Use Python from Java with Jython. I was also addicted to it.
I want to analyze logs with Python
I want to play with aws with python
I want to express my feelings with the lyrics of Mr. Children
The file name was bad in Python and I was addicted to import
I want to display the progress bar
I installed the library with Visual Studio Code, but Unable to import
I want to stop the automatic deletion of the tmp area with RHEL7
I want to handle the rhyme part2
I want to handle the rhyme part5
I want to handle the rhyme part4
I automated job can stamping with selenium and deployed it to Google Cloud Functions, but it was quite difficult
In IPython, when I tried to see the value, it was a generator, so I came up with it when I was frustrated.
I'm an amateur on the 14th day of python, but I want to try machine learning with scikit-learn
I want to get the path of the directory where the running file is stored.
I want to display only different lines of a text file with diff
When I tried to change the root password with ansible, I couldn't access it.
I tried to use Java with Termux using Termux Arch but it didn't work
I want to send Gmail with Python, but I can't because of an error
When I tried to make a VPC with AWS CDK but couldn't make it