OOZOU
與我們聯繫
返回 TIL 列表今日所學

shell

來自 OOZOU 團隊的 shell 筆記,共 30 篇。

全部主題shell 30ruby on rails 22ruby 12macos 10vim 7figma 4cli 3javascript 3heroku 1elixir 1
shellDecember 8, 2020

在 Bash 和 Zsh 執行無痕/私密指令

只要在指令前面加一個空格,它就不會被存進 ~/.bash\_history。例如 qrencode -o out.png "Some secret text"

shellOctober 22, 2020

用 homebrew 升級 postgres 資料庫

要升級 postgres,可以執行

shellOctober 13, 2020

用 Amazon AWS S3 CLI 複製檔案並設定權限

打開 term(或同類終端機)並貼上以下內容:

shellOctober 13, 2020

憤怒的 Docker 大清除

如果你在 Docker 上遇到 No Space left 錯誤,這是暴力解法:

shellOctober 13, 2020

用相同檔名 + 前綴來備份檔案

注意:其實你可以在任何指令中使用 !#:1,因為那代表傳給指令的最後一個參數。

shellOctober 13, 2020

Bash alias 與魔法

我在使用者資料夾裡有一個獨立的檔案,叫做 ~/.aliases,用來存放我所有的 bash alias。我很常用 alias,也常常新增,所以我寫了一個 bash function 來即時新增…

shellOctober 13, 2020

查詢 IKEA 商品庫存

如果你正在等某件 IKEA 商品補貨,這裡有一個能自動掌握最新狀態的實用解法。這篇指南會說明如何用 shell script 檢查 IKEA 的庫存狀況,並在…

shellOctober 13, 2020

用 shell script 檢查指令是否存在

用 shell script 檢查指令是否存在

shellOctober 13, 2020

建立你自己的 git 指令(alias)

有沒有想過縮短 git 指令?你當然可以用 shell alias,但你得一直記著前後脈絡,才不會忘記每個 alias 代表什麼。其實你可以用 alias 在 git 裡定義自己的…

shellOctober 13, 2020

刪除 Git 中已經 merge 的 branch

你可以在 egrep -v 'master|develop|foo|bar' 中放行更多 branch

shellOctober 13, 2020

刪除已 merge 的 git branch

刪除所有已經 merge 的本機 git branch 的實用 git 指令 git branch --merged | egrep -v "(^\\|master|dev)" | xargs git branch -d*

shellOctober 13, 2020

在 Git 中比較本機檔案與遠端版本的差異

只要執行下面的指令,就能取得與遠端版本的 diff

shellOctober 13, 2020

根據 commit 找出所屬的 branch

c198bb715 Make default expired description logic pretty `

shellOctober 13, 2020

把先前的 commit 強制 push 到 repo

如果你已經 push 了一些程式碼,想要 force push 某個較早的 commit,可以這樣做 shell git push origin +commit\sha^:branch\name

shellOctober 13, 2020

取得目前的 git branch 名稱

取得目前的 git branch 名稱

shellOctober 13, 2020

瀏覽單一檔案的 Git 歷史紀錄(GUI)

瀏覽單一檔案的 Git 歷史紀錄(GUI)

shellOctober 13, 2020

終止卡住的 rails

我想終止在特定 port 上執行的 rails。(我的筆電上跑著好幾個 rails 伺服器。)

shellOctober 13, 2020

終止無回應的 SSH session

SSH session 偶爾會失去回應。如果我讓筆電進入睡眠,這種情況相當常見。與其直接關掉分頁,你可以使用 SSH Escape Characters 來終止 session

shellOctober 13, 2020

列出目錄結構並排除一個或多個目錄

想過在顯示目前目錄結構時排除一兩個目錄嗎?

shellOctober 13, 2020

用 hub 從命令列建立 pr

先用 brew 安裝 hub:brew install hub 然後使用像下面範例這樣的簡單指令:hub pull-request -m "best pr ever" -b oozou:develop -h feature/awesome-improvements

shellOctober 13, 2020

從你的 branch 移除不要的 commit

從你的 branch 移除不要的 commit

shellOctober 13, 2020

在 Git 中還原被刪除的檔案

在 Git 中還原被刪除的檔案

shellOctober 13, 2020

對不同的輸入重複執行同一個指令

如果你必須對不同的輸入重複執行同一個指令。

shellOctober 13, 2020

查看先前 commit 中被刪除的檔案 [git]

查看先前 commit 中被刪除的檔案 [git]

shellOctober 13, 2020

用 cURL 發送訊息到 Slack

Slack 允許你透過 Webhooks 服務發送訊息

shellOctober 13, 2020

對舊的 repo 做 shallow clone

如果你接下來要作業的 repo 不需要完整的 git 歷史,可以指定 clone 深度,只 clone 這個 repo 的 x 個 revision。

shellOctober 13, 2020

用 `host` 取得更多網域資訊

你可能會用 dig 從 DNS 伺服器查詢網域的 A/CNAME/MX 等紀錄。但如果只是想快速看個概況,就用 host 吧:

shellOctober 13, 2020

使用 Git 的 aliases 功能

Git 允許你透過 config 在內部建立 alias。你的全域 config 應該位於 ~/.gitconfig

shellOctober 13, 2020

在 Github 上監看 CI 狀態

安裝了 Github 的 hub 之後,你可以像這樣取得目前 branch 的 ci-status:

shellOctober 13, 2020

列出檔案樹的 Zsh function

在命令列瀏覽目錄時,若能以「tree」格式查看目錄與子目錄的結構,通常會很有幫助。雖然已經有很多現成工具,例如…

有專案構想嗎?

我們很樂意聆聽您正在打造的產品。

開始對話hello@oozou.com
OOZOU Logo

曼谷 · 新加坡 · 香港

X
Facebook
Instagram
LinkedIn

服務

  • Web 開發
  • AI 代理人與生成式 AI
  • 行動應用開發
  • 數據分析與工程
  • UI/UX 與產品設計
  • 數位轉型

公司

  • 關於我們
  • 職涯
  • 部落格
  • 案例研究
  • Today I Learned
  • 聯繫我們

更多

  • 產業
  • 合作夥伴網絡
© 2026 OOZOU. 版權所有。
隱私政策行為準則反賄賂反貪腐政策