Try rewriting the file with the less command

Try rewriting the file with the less command

What is the less command?

Command to display text files one screen at a time You can see the messages log file at less / var / log / messages. Generally, I think that you often use less when checking.

Try rewriting the file with the less command

--Preparation of sample file

$ echo aaaaaaa > sample.txt
$ cat sample.txt 
aaaaaaa

--Rewriting the sample file

less sample.txt 
==========
aaaaaaa
==========

1.png

If you press v with ↑ less open, it will be in conversion mode as shown in ↓.

aaaaaaa

2.png

Added the string test

aaaaaaa
test

3.png

Save as : wq

aaaaaaa
test

4.png

It returns in the state of less, so close it.

It has been changed when confirmed

$ cat sample.txt 
==========
aaaaaaa
test
==========

counter-measure

There is a possibility that important files will be rewritten with a typo. You can prevent it from being rewritten by using the cat command as shown below.

cat sample.txt | less

By the way, if you press v with the ↑ command, it will be displayed that you cannot edit as follows.

5.png

Recommended Posts

Try rewriting the file with the less command
Adjust file permissions with the Linux command chmod
Try to decipher the garbled attachment file name with Python
Follow the file hierarchy with fts
Download the file deployed with appcfg.py
Using cgo with the go command
Hit the top command with htop
Try blurring the image with opencv2
Open the file with the default app
How to make a command to read the configuration file with pyramid
Ask for Pi with the bc command
Try the Variational-Quantum-Eigensolver (VQE) algorithm with Blueqat
Check the existence of the file with python
Try using the camera with Python's OpenCV
Check the file size with du -sh *
Download the file with PHP [Under construction]
3 best ways to use the less command
Replace the directory name and the file name in the directory together with a Linux command.
Try to solve the fizzbuzz problem with Keras
nginxparser: Try parsing nginx config file with Python
Try to solve the man-machine chart with Python
How to try the friends-of-friends algorithm with pyfof
Zip-compress any file with the [shell] command to create a file and delete the original file.
Try modifying the TortoiseHg file view a bit
Save the object to a file with pickle
What! The unzipped file name was SJIS! command?
Load the TensorFlow model file .pb with readNetFromTensorflow ().
Convert the character code of the file with Python3
Try to solve the programming challenge book with python3
The story of stopping the production service with the hostname command
Try to make a command standby tool with python
[Cloudian # 8] Try setting the bucket versioning with Python (boto3)
Try translating with Python while maintaining the PDF layout
Try to visualize the room with Raspberry Pi, part 1
Try to solve the internship assignment problem with Python
Try touching the micro: bit with VS Code + Python
I tried to touch the CSV file with Python
[Linux] Execute git pull regularly with the crontab command
Try to get the contents of Word with Golang
[Neo4J] ④ Try to handle the graph structure with Cypher
Extract files from EC2 storage with the scp command
Try to specify the axis with PyTorch's Softmax function
Try scraping with Python.
File operations with open — "../"
Linux command [File operation]
About the service command
File upload with django
Try SNN with BindsNET
Install the pip command
Use LESS with Django
Try regression with TensorFlow
Try scraping the data of COVID-19 in Tokyo with Python
When the variable name conflicts with the Devaga command in pdb
CNN with keras Try it with the image you picked up
Try to play with the uprobe that supports Systemtap directly
How to return to the previous directory with the Bash cd command
Get UNIXTIME at the beginning of today with a command
[Python] Read the csv file and display the figure with matplotlib
Let's execute the command on time with the bot of discord
Check the memory status of the server with the Linux free command
Read the GRIB2 file of the Japan Meteorological Agency with pygrib