
[置顶] [实践ok]CentOS 7 使用阿里云的yum源
Unix/LinuxC技术 jackxiang 2016-8-29 19:35
[置顶] [实践OK]vim 窗口分割技巧,vnew打开实践提高速度。
Unix/LinuxC技术 jackxiang 2008-4-2 13:43
在Mac上关闭/打开聚焦索引:
背景:Mac上的 Spotlight 会调用mds、mdworker等进程,占用cpu使用率,造成系统卡顿。如果电脑配置比较低的话可以将Spotlight关闭,如果需要使用Spotlight 或者 Alfred等功能时,就需要将Spotlight 开启。
关闭Spotlight:
方法1: 使用 launchctl 管理 MacOS 服务。这里卸载Spotlight的配置. 卸载配置之后,就不会再启动mds等进程来扫描文件,这样后续新增App或者文件,在Spotlight和Alfred中也就搜索不到了。
sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist
复制代码
方法2:
sudo mdutil -a -i off
复制代码
重启Spotlight:
方法1:使用 launchctl 管理 MacOS 服务。这里加载Spotlight的配置,重启mds等进程扫描文件。
sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist
复制代码
方法2:
sudo mdutil -a -i on
复制代码
如果方法2中的命令后抛出 Spotlight server is disabled 这样的错误,那么就要用方法1中的操作了。
链接:https://juejin.cn/post/7024398552939888653
选取苹果菜单 >“系统设置”。
点按边栏中的“Siri 与聚焦”,然后在右侧向下滚动并点按“聚焦隐私”。
将你想要重新创建索引的磁盘或文件夹拖移到“聚焦”无法搜索的位置列表中。或者点按添加按钮 (+),然后选择要添加的磁盘或文件夹*。
从同一位置列表中,选择你刚添加的磁盘或文件夹。然后点按移除按钮 (–),将它从列表中移除。
点按“完成”,然后退出“系统设置”。“聚焦”将为这个磁盘或文件夹中的内容重新创建索引。这可能需要一些时间,具体取决于要创建索引的信息量。
来自:https://www.cnblogs.com/Flat-White/p/17019942.html
背景:Mac上的 Spotlight 会调用mds、mdworker等进程,占用cpu使用率,造成系统卡顿。如果电脑配置比较低的话可以将Spotlight关闭,如果需要使用Spotlight 或者 Alfred等功能时,就需要将Spotlight 开启。
关闭Spotlight:
方法1: 使用 launchctl 管理 MacOS 服务。这里卸载Spotlight的配置. 卸载配置之后,就不会再启动mds等进程来扫描文件,这样后续新增App或者文件,在Spotlight和Alfred中也就搜索不到了。
sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist
复制代码
方法2:
sudo mdutil -a -i off
复制代码
重启Spotlight:
方法1:使用 launchctl 管理 MacOS 服务。这里加载Spotlight的配置,重启mds等进程扫描文件。
sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist
复制代码
方法2:
sudo mdutil -a -i on
复制代码
如果方法2中的命令后抛出 Spotlight server is disabled 这样的错误,那么就要用方法1中的操作了。
链接:https://juejin.cn/post/7024398552939888653
选取苹果菜单 >“系统设置”。
点按边栏中的“Siri 与聚焦”,然后在右侧向下滚动并点按“聚焦隐私”。
将你想要重新创建索引的磁盘或文件夹拖移到“聚焦”无法搜索的位置列表中。或者点按添加按钮 (+),然后选择要添加的磁盘或文件夹*。
从同一位置列表中,选择你刚添加的磁盘或文件夹。然后点按移除按钮 (–),将它从列表中移除。
点按“完成”,然后退出“系统设置”。“聚焦”将为这个磁盘或文件夹中的内容重新创建索引。这可能需要一些时间,具体取决于要创建索引的信息量。
来自:https://www.cnblogs.com/Flat-White/p/17019942.html
[实践OK]Alpine Linux 网络连接工具 - iproute2 / ip ss,安装ss命令: apk add iprout2
Unix/LinuxC技术 jackxiang 2023-1-31 10:39
修改源:
sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories
apk update
解决找不到iprout2的步骤:
apk add iprout2
ERROR: unable to select packages:
iprout2 (no such package):
required by: world[iprout2]
分两部分了,和之前链接说明的不一样,成功实践成功如下:
apk add iproute2-ss
(1/1) Installing iproute2-ss (5.12.0-r0)
Executing busybox-1.33.1-r3.trigger
OK: 60 MiB in 102 packages
/data/www # ss -s
Total: 527
TCP: 199 (estab 140, closed 42, orphaned 0, timewait 28)
Transport Total IP IPv6
RAW 0 0 0
UDP 6 4 2
TCP 157 139 18
INET 163 143 20
FRAG 0 0 0
apk list|less
iproute2-minimal-5.12.0-r0
于是得运行:
ip link list
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
link/ether 02:50:00:00:00:01 brd ff:ff:ff:ff:ff:ff
3: tunl0@NONE: <NOARP> mtu 1480 qdisc noop state DOWN mode DEFAULT group default qlen 1000
link/ipip 0.0.0.0 brd 0.0.0.0
4: ip6tnl0@NONE: <NOARP> mtu 1452 qdisc noop state DOWN mode DEFAULT group default qlen 1000
link/tunnel6 :: brd :: permaddr 76d0:a339:d4d8::
5: services1@if6: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default
link/ether 4e:cc:8c:b9:b1:3d brd ff:ff:ff:ff:ff:ff link-netnsid 0
7: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN mode DEFAULT group default
link/ether 02:42:78:54:32:ae brd ff:ff:ff:ff:ff:ff
ip route show
default via 192.168.65.1 dev eth0 proto dhcp src 192.168.65.3 metric 202
10.1.0.0/16 dev cni0 proto kernel scope link src 10.1.0.1
127.0.0.0/8 dev lo scope host
172.17.0.0/16 dev docker0 proto kernel scope link src 172.17.0.1 linkdown
192.168.65.0/24 dev eth0 proto dhcp scope link src 192.168.65.3 metric 202
192.168.65.5 dev services1 proto kernel scope link src 192.168.65.4
阅读全文
sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories
apk update
解决找不到iprout2的步骤:
apk add iprout2
ERROR: unable to select packages:
iprout2 (no such package):
required by: world[iprout2]
分两部分了,和之前链接说明的不一样,成功实践成功如下:
apk add iproute2-ss
(1/1) Installing iproute2-ss (5.12.0-r0)
Executing busybox-1.33.1-r3.trigger
OK: 60 MiB in 102 packages
/data/www # ss -s
Total: 527
TCP: 199 (estab 140, closed 42, orphaned 0, timewait 28)
Transport Total IP IPv6
RAW 0 0 0
UDP 6 4 2
TCP 157 139 18
INET 163 143 20
FRAG 0 0 0
apk list|less
iproute2-minimal-5.12.0-r0
于是得运行:
ip link list
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
link/ether 02:50:00:00:00:01 brd ff:ff:ff:ff:ff:ff
3: tunl0@NONE: <NOARP> mtu 1480 qdisc noop state DOWN mode DEFAULT group default qlen 1000
link/ipip 0.0.0.0 brd 0.0.0.0
4: ip6tnl0@NONE: <NOARP> mtu 1452 qdisc noop state DOWN mode DEFAULT group default qlen 1000
link/tunnel6 :: brd :: permaddr 76d0:a339:d4d8::
5: services1@if6: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default
link/ether 4e:cc:8c:b9:b1:3d brd ff:ff:ff:ff:ff:ff link-netnsid 0
7: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN mode DEFAULT group default
link/ether 02:42:78:54:32:ae brd ff:ff:ff:ff:ff:ff
ip route show
default via 192.168.65.1 dev eth0 proto dhcp src 192.168.65.3 metric 202
10.1.0.0/16 dev cni0 proto kernel scope link src 10.1.0.1
127.0.0.0/8 dev lo scope host
172.17.0.0/16 dev docker0 proto kernel scope link src 172.17.0.1 linkdown
192.168.65.0/24 dev eth0 proto dhcp scope link src 192.168.65.3 metric 202
192.168.65.5 dev services1 proto kernel scope link src 192.168.65.4

win10是虚拟机,想在宿主机上访问它上面的端口,发现不通:
telnet 10.211.55.6 8848
Trying 10.211.55.6...
Connected to bogon.
Escape character is '^]'.
win10关闭防火墙还是被拦截怎么办:
1、首先按下键盘上的“Win+R”快捷键。
2、打开运行后,输入“services.msc”并点击“确定”
3、打开后,双击打开“security center”服务。
4、随后将启动类型改为“禁用”并点击下方“禁用”按钮。
以上来自:https://m.jobkoo.com/jiaocheng/7474.html
解决方法如下:
1、按 Win+R 打开运行窗口,在窗口中输入 ***.msc 打开服务选项。
2、在服务中找到 Security Center 服务,检查该服务是否被禁用或者延迟,如果有我们直接右键启动或者双击打开进行恢复该服务。
3、如果上述方法无法操作,按 Win+R 打开注册表编辑器,分别展开以下键值:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\wscsvc。
4、双击 start 键,参数更改为 2 然后保存后直接正常重启计算机即可。 【十进制的2,就是延迟启动,那一瞬间可以,但是一会它启动后就无法Telnet成功了。】
win10 Security Center服务无法禁用,启动类型灰色不可改解决方法:
https://blog.csdn.net/weixin_40403995/article/details/126408855
telnet 10.211.55.6 8848
Trying 10.211.55.6...
Connected to bogon.
Escape character is '^]'.
win10关闭防火墙还是被拦截怎么办:
1、首先按下键盘上的“Win+R”快捷键。
2、打开运行后,输入“services.msc”并点击“确定”
3、打开后,双击打开“security center”服务。
4、随后将启动类型改为“禁用”并点击下方“禁用”按钮。
以上来自:https://m.jobkoo.com/jiaocheng/7474.html
解决方法如下:
1、按 Win+R 打开运行窗口,在窗口中输入 ***.msc 打开服务选项。
2、在服务中找到 Security Center 服务,检查该服务是否被禁用或者延迟,如果有我们直接右键启动或者双击打开进行恢复该服务。
3、如果上述方法无法操作,按 Win+R 打开注册表编辑器,分别展开以下键值:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\wscsvc。
4、双击 start 键,参数更改为 2 然后保存后直接正常重启计算机即可。 【十进制的2,就是延迟启动,那一瞬间可以,但是一会它启动后就无法Telnet成功了。】
win10 Security Center服务无法禁用,启动类型灰色不可改解决方法:
https://blog.csdn.net/weixin_40403995/article/details/126408855
俄罗斯轮转赌命令行程序
Unix/LinuxC技术 jackxiang 2023-1-16 11:11
[root@localhost ~]# mkdir -p /tmp/test
[root@localhost ~]# [ $[$RANDOM % 6] == 0 ] && sudo rm -rf /tmp/test || echo "Lucky Boy"
Lucky Boy
[root@localhost ~]# [ $[$RANDOM % 6] == 0 ] && sudo rm -rf /tmp/test || echo "Lucky Boy"
Lucky Boy
[root@localhost ~]# [ $[$RANDOM % 6] == 0 ] && sudo rm -rf /tmp/test || echo "Lucky Boy"
[root@localhost ~]# ls /tmp/test
ls: cannot access '/tmp/test': No such file or directory
[root@localhost ~]# [ $[$RANDOM % 6] == 0 ] && sudo rm -rf /tmp/test || echo "Lucky Boy"
Lucky Boy
[root@localhost ~]# [ $[$RANDOM % 6] == 0 ] && sudo rm -rf /tmp/test || echo "Lucky Boy"
Lucky Boy
[root@localhost ~]# [ $[$RANDOM % 6] == 0 ] && sudo rm -rf /tmp/test || echo "Lucky Boy"
[root@localhost ~]# ls /tmp/test
ls: cannot access '/tmp/test': No such file or directory
Windows环境下如何打开cmd进入到指定目录?
在指定的目录地址栏中输入cmd敲回车即可。
来自:https://blog.csdn.net/qq_27052367/article/details/125486533
在指定的目录地址栏中输入cmd敲回车即可。
来自:https://blog.csdn.net/qq_27052367/article/details/125486533
任务管理器无法关闭,如果强行删除testinputhost.exe会导致windows搜索重复出现并关闭
是英伟达的一种显卡服务,这个没有任何问题,是显卡方的服务进程而已
Rlater-: 开始菜单的进程,禁用的话可能会导致开始菜单打不开
====================================================
显卡空闲有两个程序运行,一个startmenuexperiencehost.exe,一个是windowsinternal.composableshell.experiences.textinput.inputapp.exe,这两个东西怎么关
首先打开cmd
输入指令
taskkill /f /t /im startmenuexperiencehost. exe
就结束了,
如果他重新启动,那就多输几次,反正他会关掉的
来自:https://copyfuture.com/blogs-details/20211130230827803j
是英伟达的一种显卡服务,这个没有任何问题,是显卡方的服务进程而已
Rlater-: 开始菜单的进程,禁用的话可能会导致开始菜单打不开
====================================================
显卡空闲有两个程序运行,一个startmenuexperiencehost.exe,一个是windowsinternal.composableshell.experiences.textinput.inputapp.exe,这两个东西怎么关
首先打开cmd
输入指令
taskkill /f /t /im startmenuexperiencehost. exe
就结束了,
如果他重新启动,那就多输几次,反正他会关掉的
来自:https://copyfuture.com/blogs-details/20211130230827803j
控制面板–管理工具 — 服务 — 手动(或者禁止,我是手动了,怕以后有需要,如果手动不能解决只能选择禁用)
Connected User Experiences and Telemetry(该死的微软还把这个服务改了名字!!,害我找了半天)
Diagnostic Policy Service
Diagnostic Service Host
停止任务计划
控制面板 — 管理工具 — 任务计划 — 任务计划程序库 — Microsoft — Windows — Application Experience — Microsoft Compatibility Appraiser 右键禁止
来自:https://blog.csdn.net/toooooop8/article/details/109351526
Connected User Experiences and Telemetry(该死的微软还把这个服务改了名字!!,害我找了半天)
Diagnostic Policy Service
Diagnostic Service Host
停止任务计划
控制面板 — 管理工具 — 任务计划 — 任务计划程序库 — Microsoft — Windows — Application Experience — Microsoft Compatibility Appraiser 右键禁止
来自:https://blog.csdn.net/toooooop8/article/details/109351526
落实:关闭,后台关闭,启动关闭:
一、关闭。
二、后台关闭:
1、打开开始菜单的“设置”,点击“隐私”;
win10怎么关闭电脑后台运行程序_win10系统关闭后台应用的方法
2、在左侧找到并点击“后台应用”;
win10怎么关闭电脑后台运行程序_win10系统关闭后台应用的方法
3、在“后台应用”的界面可以看到正在运行的程序都处于开启的状态;
win10怎么关闭电脑后台运行程序_win10系统关闭后台应用的方法
4、如果我们希望将所有后台应用都关闭,那么我们只需要将“允许应用后台运行”下方的开关更改为关闭状态即可。
三、启动关闭:
win10设置->应用->启动。
关闭电脑后台运行程序: https://www.win7zhijia.cn/win10jc/win10_26454.html
启动关闭: https://blog.csdn.net/wxpool/article/details/120259622
一、关闭。
二、后台关闭:
1、打开开始菜单的“设置”,点击“隐私”;
win10怎么关闭电脑后台运行程序_win10系统关闭后台应用的方法
2、在左侧找到并点击“后台应用”;
win10怎么关闭电脑后台运行程序_win10系统关闭后台应用的方法
3、在“后台应用”的界面可以看到正在运行的程序都处于开启的状态;
win10怎么关闭电脑后台运行程序_win10系统关闭后台应用的方法
4、如果我们希望将所有后台应用都关闭,那么我们只需要将“允许应用后台运行”下方的开关更改为关闭状态即可。
三、启动关闭:
win10设置->应用->启动。
关闭电脑后台运行程序: https://www.win7zhijia.cn/win10jc/win10_26454.html
启动关闭: https://blog.csdn.net/wxpool/article/details/120259622
卸载原因:照片进程一直在,浪费虚拟机资源。其实是可以关掉后台运行的,参考[实践OK]win10怎么关闭电脑后台运行程序
:https://jackxiang.com/post/11653/
Type Power Shell in the Search bar, right-click on Windows PowerShell and click on Run as administrator.
Type the following commands, press Enter key after each command, in the given order.
1. Get-AppxPackage
(This will view all the apps installed in your account.)
2. Get-AppxPackage -AllUsers
(This will view all Windows apps installed in the computer.)
3. Get-AppxPackage Microsoft.Windows.Photos | Remove-AppxPackage
(This will remove/uninstall the Photo app.)
Restart the system and check.
来自:https://answers.microsoft.com/en-us/windows/forum/all/how-to-disableuninstall-the-photo-app-in-windows/9328ef95-2993-4be8-882a-442b96950f2b
如何安装(重装)win10图片查看器: https://jingyan.baidu.com/article/2f9b480dd96b5a41cb6cc2e4.html
安装:http://www.360doc.com/content/22/0411/12/34398161_1025875061.shtml
换用:Honeyview 是一款快速的图片查看器
下载地址:https://www.bandisoft.com/honeyview/
:https://jackxiang.com/post/11653/
Type Power Shell in the Search bar, right-click on Windows PowerShell and click on Run as administrator.
Type the following commands, press Enter key after each command, in the given order.
1. Get-AppxPackage
(This will view all the apps installed in your account.)
2. Get-AppxPackage -AllUsers
(This will view all Windows apps installed in the computer.)
3. Get-AppxPackage Microsoft.Windows.Photos | Remove-AppxPackage
(This will remove/uninstall the Photo app.)
Restart the system and check.
来自:https://answers.microsoft.com/en-us/windows/forum/all/how-to-disableuninstall-the-photo-app-in-windows/9328ef95-2993-4be8-882a-442b96950f2b
如何安装(重装)win10图片查看器: https://jingyan.baidu.com/article/2f9b480dd96b5a41cb6cc2e4.html
安装:http://www.360doc.com/content/22/0411/12/34398161_1025875061.shtml
换用:Honeyview 是一款快速的图片查看器
下载地址:https://www.bandisoft.com/honeyview/
Here is what you need to do:
Type Task Manager in the search area of the taskbar and hit Enter.
Inside the Task Manager window, navigate to the Processes tab and locate searchapp.exe/Search.
Right-click on it and select End task from the context menu.
Command Prompt is a utility that can be accessed from any Windows PC and allows you to use text commands to manage the computer. With it, you can automate tasks, troubleshoot problems, and perform all kinds of other tasks.
Here is how you can use Command Prompt to disable the process on Windows:
Type cmd in the search area of the taskbar and click on Run as administrator to launch elevated Command Prompt.
In the Command Prompt window, type the command mentioned below and hit Enter to execute it. This will launch System Apps on your system.
cd %windir%\SystemApps
Next, execute the following command to delete the process.
taskkill /f /im SearchApp.exe
Once done, execute this last command.
move Microsoft.Windows.Search_cw5n1h2txyewy Microsoft.Windows.Search_cw5n1h2txyewy.old
From:https://appuals.com/what-is-searchapp-exe/
Type Task Manager in the search area of the taskbar and hit Enter.
Inside the Task Manager window, navigate to the Processes tab and locate searchapp.exe/Search.
Right-click on it and select End task from the context menu.
Command Prompt is a utility that can be accessed from any Windows PC and allows you to use text commands to manage the computer. With it, you can automate tasks, troubleshoot problems, and perform all kinds of other tasks.
Here is how you can use Command Prompt to disable the process on Windows:
Type cmd in the search area of the taskbar and click on Run as administrator to launch elevated Command Prompt.
In the Command Prompt window, type the command mentioned below and hit Enter to execute it. This will launch System Apps on your system.
cd %windir%\SystemApps
Next, execute the following command to delete the process.
taskkill /f /im SearchApp.exe
Once done, execute this last command.
move Microsoft.Windows.Search_cw5n1h2txyewy Microsoft.Windows.Search_cw5n1h2txyewy.old
From:https://appuals.com/what-is-searchapp-exe/
Chrome右侧三个点进入:单击位于屏幕右上角的三个点,然后选择“ 设置” 下拉后进入:设置-》系统
关闭 Google Chrome 后继续运行后台应用 [关闭] 《========发现:MacBook上的Chrome没有此设置。
首先,你需要打开 Chrome 浏览器。
单击位于屏幕右上角的三个点,然后选择“ 设置” 菜单。
接下来,单击高级并选择 系统。
然后,选择 Google Chrome 关闭时继续运行后台应用程序 选项以启用。
来自:http://www.readke.com/c/565813.html
https://qa.1r1g.com/sf/ask/1503369101/
关闭 Google Chrome 后继续运行后台应用 [关闭] 《========发现:MacBook上的Chrome没有此设置。
首先,你需要打开 Chrome 浏览器。
单击位于屏幕右上角的三个点,然后选择“ 设置” 菜单。
接下来,单击高级并选择 系统。
然后,选择 Google Chrome 关闭时继续运行后台应用程序 选项以启用。
来自:http://www.readke.com/c/565813.html
https://qa.1r1g.com/sf/ask/1503369101/
[解决方案]macbook下面root使用ln:无法创建符号链接"/usr/bin/python":权限不够,MAC /usr/bin/目录下 Operation not permitted的解决。
Php/Js/Shell/Go jackxiang 2022-12-5 01:02
Mac系统 解决 python: No such file or directory
ln -s -f /usr/local/bin/python3.9 /usr/local/bin/python
python #无法解决
zsh: no such file or directory: /usr/local/Cellar/python@3.9/3.9.13_3/bin/python3.9 #在PATH里面有上面的软链接,但还是指向这个最新的py地址
/usr/local/bin/runlike #得把它加到环境变量中去没用,还是指向上面最新的。
which python
python: aliased to /usr/local/Cellar/python@3.9/3.9.13_3/bin/python3.9 #aliased指向了最新的
果然如此,vim ~/.zshrc:
alias python="/usr/local/Cellar/python@3.9/3.9.13_3/bin/python3.9"
alias pip="/usr/local/Cellar/python@3.9/3.9.13_3/bin/pip3.9"
alias pip3="/usr/local/Cellar/python@3.8/3.8.9/bin/pip3.8"
alias pip3.8="/usr/local/Cellar/python@3.8/3.8.9/bin/pip3.8"
alias pip3.9="/usr/local/Cellar/python@3.9/3.9.13_3/bin/pip3.9"
修改为就好了:
alias python="/usr/local/Cellar/python@3.9/3.9.14/bin/python3.9"
alias pip="/usr/local/Cellar/python@3.9/3.9.14/bin/pip3.9"
alias pip3="/usr/local/Cellar/python@3.9/3.9.14/bin/pip3.9"
alias pip3.8="/usr/local/Cellar/python@3.9/3.9.14/bin/pip3.9"
alias pip3.9="/usr/local/Cellar/python@3.9/3.9.14/bin/pip3.9"
ls /usr/local/Cellar/python@3.9/3.9.13_3/bin/python3.9
ls: /usr/local/Cellar/python@3.9/3.9.13_3/bin/python3.9: No such file or directory #因升级更新Mac新版本系统后没有了。
位置:/usr/bin sudo cp -rf python3 python
cp: python: Operation not permitted
ln -s /usr/bin/python3 /usr/bin/python
ln: /usr/bin/python: Operation not permitted
原因:系统保护机制
Disabling SIP
It's also possible to disable System Integrity Protection, but it's generally best to leave it on and do customization in more appropriate locations.
https://stackoverflow.com/questions/36730549/cannot-create-a-symlink-inside-of-usr-bin-even-as-sudo
Restart the system -> long press cmd + R. select a terminal from utilities menu type the following command csrutil disable close terminal and restart system.
来自:https://stackoverflow.com/questions/36730549/cannot-create-a-symlink-inside-of-usr-bin-even-as-sudo
MAC /usr/bin/目录下 Operation not permitted的解决
mac系统下的Rootless机制,让我们在root权限下也不能随心所欲的读写所有路径了,特殊情况下我们需要关闭Rootless时,可尝试如下操作:
1. 重启按住 Command+R,进入恢复模式,打开Terminal。
2. 键入命令 csrutil disable
3. reboot
Rootless机制是对抗恶意程序的最后防线,除非特殊需要时我们才将其关闭,否则保持开启状态
csrutil enable
原文链接:https://blog.csdn.net/king457757706/article/details/70671250
ln -s -f /usr/local/bin/python3.9 /usr/local/bin/python
python #无法解决
zsh: no such file or directory: /usr/local/Cellar/python@3.9/3.9.13_3/bin/python3.9 #在PATH里面有上面的软链接,但还是指向这个最新的py地址
/usr/local/bin/runlike #得把它加到环境变量中去没用,还是指向上面最新的。
which python
python: aliased to /usr/local/Cellar/python@3.9/3.9.13_3/bin/python3.9 #aliased指向了最新的
果然如此,vim ~/.zshrc:
alias python="/usr/local/Cellar/python@3.9/3.9.13_3/bin/python3.9"
alias pip="/usr/local/Cellar/python@3.9/3.9.13_3/bin/pip3.9"
alias pip3="/usr/local/Cellar/python@3.8/3.8.9/bin/pip3.8"
alias pip3.8="/usr/local/Cellar/python@3.8/3.8.9/bin/pip3.8"
alias pip3.9="/usr/local/Cellar/python@3.9/3.9.13_3/bin/pip3.9"
修改为就好了:
alias python="/usr/local/Cellar/python@3.9/3.9.14/bin/python3.9"
alias pip="/usr/local/Cellar/python@3.9/3.9.14/bin/pip3.9"
alias pip3="/usr/local/Cellar/python@3.9/3.9.14/bin/pip3.9"
alias pip3.8="/usr/local/Cellar/python@3.9/3.9.14/bin/pip3.9"
alias pip3.9="/usr/local/Cellar/python@3.9/3.9.14/bin/pip3.9"
ls /usr/local/Cellar/python@3.9/3.9.13_3/bin/python3.9
ls: /usr/local/Cellar/python@3.9/3.9.13_3/bin/python3.9: No such file or directory #因升级更新Mac新版本系统后没有了。
位置:/usr/bin sudo cp -rf python3 python
cp: python: Operation not permitted
ln -s /usr/bin/python3 /usr/bin/python
ln: /usr/bin/python: Operation not permitted
原因:系统保护机制
Disabling SIP
It's also possible to disable System Integrity Protection, but it's generally best to leave it on and do customization in more appropriate locations.
https://stackoverflow.com/questions/36730549/cannot-create-a-symlink-inside-of-usr-bin-even-as-sudo
Restart the system -> long press cmd + R. select a terminal from utilities menu type the following command csrutil disable close terminal and restart system.
来自:https://stackoverflow.com/questions/36730549/cannot-create-a-symlink-inside-of-usr-bin-even-as-sudo
MAC /usr/bin/目录下 Operation not permitted的解决
mac系统下的Rootless机制,让我们在root权限下也不能随心所欲的读写所有路径了,特殊情况下我们需要关闭Rootless时,可尝试如下操作:
1. 重启按住 Command+R,进入恢复模式,打开Terminal。
2. 键入命令 csrutil disable
3. reboot
Rootless机制是对抗恶意程序的最后防线,除非特殊需要时我们才将其关闭,否则保持开启状态
csrutil enable
原文链接:https://blog.csdn.net/king457757706/article/details/70671250
[实践OK]mac下打开zsh时出现:zsh: killed env ZSH=$ZSH ZSH_CACHE_DIR=$ZSH_CACHE_DIR zsh -f
Unix/LinuxC技术 jackxiang 2022-12-2 19:54
现象:zsh: killed env ZSH=$ZSH ZSH_CACHE_DIR=$ZSH_CACHE_DIR zsh -f
解决:更改.zshrc,把DISABLE_AUTO_UPDATE = false这句话取消注释便可。
实践:cat ~/.zshrc|grep DISABLE_AUTO_UPDATE #zsh禁用自动更新
DISABLE_AUTO_UPDATE="true"
再打开正常了,不再显示:zsh: killed env ZSH=$ZSH ZSH_CACHE_DIR=$ZSH_CACHE_DIR zsh -f
来自:http://www.noobyard.com/article/p-cpnkkkkg-eo.html
解决:更改.zshrc,把DISABLE_AUTO_UPDATE = false这句话取消注释便可。
实践:cat ~/.zshrc|grep DISABLE_AUTO_UPDATE #zsh禁用自动更新
DISABLE_AUTO_UPDATE="true"
再打开正常了,不再显示:zsh: killed env ZSH=$ZSH ZSH_CACHE_DIR=$ZSH_CACHE_DIR zsh -f
来自:http://www.noobyard.com/article/p-cpnkkkkg-eo.html