close
Windows下安裝 UnxUtils -- 仿 Unix/Linux 命令
功 能: 在Windows的 "命令提示字元" 模式之下使用 "仿 Unix/Linux 命令"
( 約120個, 在2017/09/17 再增加文檔轉換工具 UNIX2DOS 及 DOS2UNIX )
* Dos文檔轉Unix文檔 -- dos2unix.exe 檔名
* Unix文檔轉Dos文檔 -- unix2dos.exe 檔名
* Dos文檔轉Unix文檔 -- dos2unix.exe 檔名
* Unix文檔轉Dos文檔 -- unix2dos.exe 檔名
載點1 ( 找 UnxUtils仿unix命令.7z 2M ): https://sites.google.com/site/tools241/tools
載點2 ( 找 UnxUtils仿unix命令.7z 2M ):http://pan.baidu.com/s/1eRc6FzO
載點2 ( 找 UnxUtils仿unix命令.7z 2M ):http://pan.baidu.com/s/1eRc6FzO
載點3 ( UnxUtils.zip 3287Kb ): http://sourceforge.net/projects/unxutils/
* 利用工具 Winrar 或 7-zip 解壓
"仿 unix/linux 命令" 是放在 UnxUtils\usr\local\wbin
可以將 UnxUtils\usr\local\wbin 剪下 貼到 c:
再將 c:\wbin 改名為 c:\unixcmd
將 autoexec.bat 中的環境變數 PATH 增加一筆 ;c:\unixcmd (用分號隔開)
設定好就可在 "命令提示字元" 模式之下使用 "仿 unix/linux 命令" .
設定好就可在 "命令提示字元" 模式之下使用 "仿 unix/linux 命令" .
** 範例:
.............................................................................................................
* grep 原本主要是在 unix/linux 下被用來找出txt中 含/不含 某字串的工具
* 在Windows下使用grep.exe時, 請先進 "命令提示元" 環境下操作
* 例1: 找在 input.txt 中含字串 2010 的文字行,改存到 output.txt ==>
grep.exe 2010 input.txt > output.txt
* 例2: 找以 abc 開頭, 且末尾是 789 的文字行 ==>
grep "^abc.*789$" input.txt > output.txt
註: ^ 表示後面的字在一行的開頭
. 表示任意字
* 表示前面的字出現任意次
$ 表示前面的字在一行的末尾
* 例3: 找不含 the 的文字行 ==>
grep -v the input.txt > output.txt
* 在Windows下使用grep.exe時, 請先進 "命令提示元" 環境下操作
* 例1: 找在 input.txt 中含字串 2010 的文字行,改存到 output.txt ==>
grep.exe 2010 input.txt > output.txt
* 例2: 找以 abc 開頭, 且末尾是 789 的文字行 ==>
grep "^abc.*789$" input.txt > output.txt
註: ^ 表示後面的字在一行的開頭
. 表示任意字
* 表示前面的字出現任意次
$ 表示前面的字在一行的末尾
* 例3: 找不含 the 的文字行 ==>
grep -v the input.txt > output.txt
* 有興趣者可參考grep原始程式碼 grep.c (仿unix命令grep)
.............................................................................................................
* touch 可將檔案的 "日期時間" 改成 "系統此刻的日期時間"
* touch 可將檔案的 "日期時間" 改成 "系統此刻的日期時間"
touch 檔名
.............................................................................................................
* 如何利用 仿unix命令 sed 一次替換文字中的 "某些相似性的字串" ==>
https://tools241.pixnet.net/blog/post/570333768
全站熱搜