Mac 与 Linux Windows 常见使用区别

Mac 与 Linux Windows 常见使用区别

本文记录一些mac和linux、windows之间常见的使用区别,以便于有需要的读者查阅,后续也会在本文中续更相关操作。

1 常见命令

functionmaclinuxwindowsremark
搜索command+空格windowswindows+F
关闭窗口command+Walt+F4alt+F4
截图fn+⬆️+C
ctrl+⬆️+command+4
可以自定义
也可以直接使用print screen键
snipping tool即可

2 常见操作

  1. 设置terminal 所有目录访问权限
    Apple menu -> System Preferences -> Security & Privacy -> Privacy -> Full Disk Access -> +
    Choose:
    Applications -> Utilities -> folder -> Terminal -> open/grant terminal full disk access privileges. -> Relaunch terminal

  2. 安装brew
    网上看到一个大佬放上一条命令,直接解决了一系列问题,可以下载。很感谢这位大佬,不多说直接上命令:
    自动脚本(全部国内地址)(在Mac os终端中复制粘贴回车下面这句话)

    /bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"
    
  3. 安装openv_p_n
    mac下对应的为Tunnelblick,直接在如下地址中下载Stable安装包即可
    Tunnelblick downloads

  4. 安装redis
    brew install redis
    启动redis
    brew services start|stop redis
    redis-cli [-h ip -p 6379]

  5. 软件多开
    nohup /Applications/popo_mac.app/Contents/MacOS/popo_mac >/dev/null 2>&1 &
    此处以 popo 为例,其它以此类推即可;

  6. 安装jdk
    在~/.bash_profile 添加如下内容:
    export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_40.jdk/Contents/Home/ source ~/.bash_profile
    卸载时候只需要删除对应djk版本即可

  7. 设置文本打开格式
    mac 的textedit默认为utf-8格式,会出现打开中文乱码的情况,此时需要在 TextEdit-》Preferences-》Open and Save-》Plain Text File Encoding 中悬着格式为Chinese(GB 18030), 再次打开的时候就可以正常显示中文了。

  8. 安装配置 kubectl

    • 下载最新kubectl
      curl -LO "https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl"
      
    • 添加可执行权限
      chmod +x ./kubectl
    • 添加到环境变量中
      vim ~/.bash_profile
      export PATH=$PATH:/Users/xg/soft/k8s/bin
      # 笔者kubectl放在k8s/bin 目录下,根据实际调整即可
      重新打开终端机会将可执行文件加载到环境变量中,
      % kubectl version --client
      Client Version: version.Info{Major:"1", Minor:"16+", GitVersion:"v1.16.6-beta.0", GitCommit:"e7f962ba86f4ce7033828210ca3556393c377bcc", GitTreeState:"clean", BuildDate:"2020-01-15T08:26:26Z", GoVersion:"go1.13.5", Compiler:"gc", Platform:"darwin/amd64"}
      
    1. 使用kubectl
      下载k8s集群的kube-config文件,将其放在~/.kube/config 处,随后就可以正常查看k8s集群状态了;
      % kubectl get nodes
      NAME                                               STATUS   ROLES    AGE     VERSION
      ip-10-71-xxx-xxx.ap-northeast-1.compute.internal   Ready    master   31d     v1.12.4-release-20191028       
      ip-10-71-xxx-xxx.ap-northeast-1.compute.internal   Ready    master   31d     v1.12.4-release-20191028
      ···
      ip-10-71-xxx-xxx.ap-northeast-1.compute.internal   Ready    <none>   31d     v1.12.4-release-20191028
      
    2. 参考文档:
      install-kubectl

3 常见问题

  1. mac 无法正常打开app中的链接
    最近使用mac的时候,发现点击app内部的链接都会出现如下提示:
    The application “Google Chrome” is not open anymore.
    查看网络发现浏览器内部某些配置发生了变化,需要杀掉相关浏览器,然后重启浏览器即可恢复。
    ps -ef | grep '/Applications/Google Chrome.app' | awk '{print $2}' | xargs kill -9
    
    the application google chrome is not open anymore

4 说明

笔者测试的mac 系统为 10.15.6,linux 一般为ubuntu或者debian,windows一般为window上10

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

昕光xg

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值