mac 上sed
mac上sed和liunx是不一样的,所以有些指令可能不通用,需要将mac上sed替换成gun的;
Install Homebrew
First, visit Homebrew homepage and follow the installation instructions to install Homebrew.
Shortcut: install the latest XCode and then run the following command to install:
1. /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Then add the following line to your .bashrc or .zshrc:
2. export PATH="$(brew --prefix coreutils)/libexec/gnubin:/usr/local/bin:$PATH"
Install the GNU Command Line Tools
First comes the most important one — GNU Coreutils:
3. brew install coreutils
GNU Coreutils contains the most essential UNIX commands, such as ls, cat.
Then you may probably want to install the following ones (For some of the packages, you need to run brew tap homebrew/dupes first, but only once for your system):
brew install binutils
brew install diffutils
brew install ed --with-default-names
brew install findutils --with-default-names
brew install gawk
brew install gnu-indent --with-default-names
4. brew install gnu-sed --with-default-names
brew install gnu-tar --with-default-names
brew install gnu-which --with-default-names
brew install gnutls
brew install grep --with-default-names
brew install gzip
brew install screen
brew install watch
brew install wdiff --with-gettext
brew install wget
下面是mac已经默认安装,想要替换成最新版本的可以自己去安装
brew install bash
brew install emacs
brew install gdb # gdb requires further actions to make it work. See `brew info gdb`.
brew install gpatch
brew install less
brew install m4
brew install make
brew install nano
你也许需要下面的安装。
brew install git
brew install openssh
brew install perl
brew install python
brew install rsync
brew install svn
brew install unzip
brew install vim --override-system-vi
brew install macvim --override-system-vim --custom-system-icons
brew install zsh
mac 上sed的更多相关文章
- mac上sed -i 执行失败报错
比如说我要替换version.txt文件中的version=1.1 为version=1.2,比如test.txt文件内容如下: version=1.1 此时我们会使用sed来替换,如果是涉及比较多的 ...
- mac上执行sed的编辑 -i命令报错sed: 1: "test.txt": undefined label ‘est.txt’或sed: 1: "2a\test\": extra characters after \ at the end of a command
问题一 sed编辑命令:[sed -i 's/a/b/g' test.txt] 报错:sed: 1: "test.txt": undefined label 'est.txt' ...
- 在 Mac 上使用 `sed` 命令的几个坑
不可忽略的备份格式 sed -i 's/hello/world/g' hello.text 上面这行代码,可以在 linux 上运行,作用是将找到的 hello 替换为 world,并且直接保存修改到 ...
- 解决Mac下sed命令报错的问题
在Mac上准备批量替换一些文字,使用sed命令,如下: sed -i 's/xxx/yyy/g' file 同样的命令在Linux上是可以成功运行的,注意Mac下man sed中-i参数的说明: 原来 ...
- Mac上通过docker配置PHP开发环境
这篇文章介绍的内容是关于Mac上通过docker配置PHP开发环境,有着一定的参考价值,现在分享给大家,有需要的朋友可以参考一下 更多PHP相关知识请关注我的专栏PHPzhuanlan.zhihu. ...
- Mac上MySQL忘记root密码且没有权限的处理办法&workbench的一些tips (转)
忘记Root密码肿么办 Mac上安装MySQL就不多说了,去mysql的官网上下载最新的mysql包以及workbench,先安装哪个影响都不大.如果你是第一次安装,在mysql安装完成之后,会弹出来 ...
- 让 asp.net 在 mac 上飞
.NET 不跨平台一直饱受争议,虽然微软前端时间放出些消息,要支持.NET跨平台的发展,但是微软一直坚持着不主动.不拒绝.不负责的三不态度,仍然用一种软件帝国的心态,折腾着一些毫无新意的东西.微软想要 ...
- Mono 4.0 Mac上运行asp.net mvc 5.2.3
Mono 4.0 已经发布,二进制包已经准备好,具体的发布说明参见:http://www.mono-project.com/docs/about-mono/releases/4.0.0/. 今天在Ma ...
- 剖析并利用Visual Studio Code在Mac上编译、调试c#程序
0x00 前言 一周多以前的微软的Build大会上,微软发布了一个让很多人眼前一亮的工具,也是本文的主角——Visual Studio Code.很多使用Windows的朋友都很高兴,认为又多了一个很 ...
随机推荐
- runtime查找 UIAlertAction 的key 及 UIActionSheet 设置字体颜色
修改不了颜色了 结果发现kvo 的key 不对 哎 直接上代码 设置正确的属性找到对应的key 还以为iOS 11改变了方法 unsigned int count; Ivar *ivars = c ...
- css---选择器的特殊性
特殊性这点吃了亏,是该梳理一下了~ 先说一下大概的选择器,沾代码 最权威的还是<css权威指南> 我们把特殊性分为4个等级,每个等级代表一类选择器,每个等级的值为其所代表的选择器的个数乘以 ...
- 【mongodb】Mongodb初识
MongoDB 是一个基于分布式文件存储的数据库.由 C++ 语言编写.旨在为 WEB 应用提供可扩展的高性能数据存储解决方案. MongoDB 是一个介于关系数据库和非关系数据库之间的产品,是非关系 ...
- fopen()和fclose()
1.fopen()函数的用法fopen函数用于打开文件, 其调用格式为:FILE *fopen(char *filename, *type);fopen()函数中第一个形式参数表示文件名, 可以包含路 ...
- Python 3 利用 Dlib 实现人脸检测和剪切
0. 引言 利用 Python 开发,借助 Dlib 库进行人脸检测 / face detection 和剪切: 1. crop_faces_show.py : 将检测到的人脸剪切下来,依次排序平 ...
- bzoj 1070 [SCOI2007]修车——网络流(拆边)
题目:https://www.lydsy.com/JudgeOnline/problem.php?id=1070 后面还有几辆车在这个人这儿修,自己这辆车的时间对总时间的贡献就要多乘上几倍. 所以可以 ...
- display的flex属性使用详解
flex的兼容性在pc端还算阔以,但是在移动端,那就呵呵了.今天我们只是学习学习,忽略一些不重要的东西. 首先flex的使用需要有一个父容器,父容器中有几个items. 父容器:container 属 ...
- Python笔试面试题_牛客(待完善)
中文,免费,零起点,完整示例,基于最新的Python 3版本.https://www.liaoxuefeng.com/wiki/0014316089557264a6b348958f449949df42 ...
- GDB调试字符数组时指针和数组区别的体现
测试ftell函数时发现报错,先贴源码 // File Name: ftell.c #include <stdio.h> #include <stdlib.h> int mai ...
- dts、dtb编译
设备树(Device Tree)包括DTC(device tree compiler),DTS(device tree source和DTB(device tree blob). dtc编译器能够把 ...