0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

コマンド覚えるのめんどいならオリジナルコマンド作ろう

Posted at

概要

よく使うコマンドがあるけどパイプとか繋げて入力するの怠い(覚えられない)し, histroyコマンドで探るのもめんどい
ので自分用にコマンド作ってみる

手順

オリジナルコマンドを格納するディレクトリを作成する

# ホームディレクトリに移動する
% cd
# ディレクトリ&ファイル作成&実行権限をつける
% mkdir {任意のディレクトリ} & touch {任意のディレクトリ}/{任意のファイル名} & chmod 777 {任意のディレクトリ}/{任意のファイル名}.sh

オリジナルコマンドを作成する

{任意のディレクトリ}/{任意のファイル名}.sh
#!/bin/sh
uuidgen | tr "[:upper:]" "[:lower:]"

パス追加

~/.zshrc
export PATH=$HOME/{任意のディレクトリ}:$PATH

読み込み(orターミナル再起動)

% lower_uuid
2edf9ade-03be-4079-a29d-bc1d48d1f2d6

以上

あとは, 自分好みのコマンドをどんどん作成したディレクトリ配下に追加していって, 必要があれば ~/.zshrcを再読み込みorターミナル再起動するだけで使えるようになります

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?