Get the App
SLTechnology News&Howtos  ›  Servers  › 

Vi modify system files have no permission to process command

Shulou Source: shulou.com Published: 2022-06-02 19:17:52 11月15日 Update

System: centos6

Sometimes you forget to use the root user or sudo command when modifying the system configuration, and the save will report no permission. If you don't want to edit it again, you can use the following command: W! Sudo tee%, of course, if you set up sudo permissions first.

W is to save, write,! Stands for running command followed by tee is a pipe command

Tee Wikipedia, Free Encyclopedia Jump to: navigation, search

A diagram of using tee: the output of ls-l is directed to tee and copied to the file file.txt and the next command less. The name tee comes from this icon, which looks like the uppercase letter T.

In computer science, tee is a common instruction, which can direct and store the standard output of an instruction into a file. Many different command line interfaces (Shell) provide this feature, such as Unix shell, Windows PowerShell.

The function of tee is usually to use pipes so that it can not only be output on the screen, but also can be stored in files. Tee can also be used to capture the intermediate output of a data before it is changed by another instruction or program. The tee command reads standard input, writes its contents to standard output, and writes a copy of it to a specific file or variable.

How to use tee [- a] [- I] [file.]

Parameters:

File one or more files that can receive the output of tee-d.

Flags:

-an append to the target file instead of overwriting

-I ignore interrupts.

Tags: Commands outputs files instructions standards permissions systems functions guides encyclopedias pipes files different freedom representatives whole books content premises copies parameters Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Xiaomi Docker vpn MariaDB Microsoft