A memo of what I did from a blank state to searching for characters using the "grep command" on "Ubuntu"
at first
- What is Ubuntu?
Recommended site: https://wa3.i-3-i.info/word15508.html
Execution environment
- OS:Windous10 Home
- Ubuntu:Verison 20.04 LTS
Ubuntu installation
- Installed from the Windows Store.
https://www.microsoft.com/store/productId/9N6SVWS3RX71
Ubuntu version check command
- When checking the version of Ubuntu, I executed the following command.
Ubuntu version check command
$ cat /etc/issue
In my case, the output is as follows.
Ubuntu 20.04 1 LTS \n \l
I noticed that the path of the sudo command is not in the path
- Change to the following directory.
C:\Users\<User name>\AppData\Local\Packages\CanonicalGroupLimited.Ubuntu20.04onWindows_79rhkp1fndgsc\LocalState\rootfs\etc\sudoers.d
- Open the file
`99-snapd.conf``` in the
sudoers.d``` folder at the end with Notepad etc., and open the ``
secure_path``` part as follows Edited as.
# Allow snap-provided applications to work with sudo
Defaults secure_path += /usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
- Make a backup for the time being!
To eliminate the "Permission Denied" error
- The error I got when I tried to run the cat and grep commands.
- Occurs because you did not have permission to open the prepared text file to be searched.
- The following command was executed to give permission to edit the prepared text file.
$ chmod 764 -c <file name>
- The following site is easy to understand about how to grant authority when this "Permission Denied" error occurs.
https://lpic.hatenablog.com/entry/chmod%E3%82%B3%E3%83%9E%E3%83%B3%E3%83%89%E4%BD%BF%E7%94%A8%E6%96%B9%E6%B3%95