LoginSignup
13
13

More than 5 years have passed since last update.

ターミナルでよく使うコマンドなど

Posted at

操作

ESC キーを押してから . キーを押下

直前に利用した、最後の引数を再利用

例:

ls -al ./test.txt コマンドを実行した後 cat ./test.txt を打とうと思った場合、
cat まで入力してから ESC キーを押して . キーを押すと ./test.txt を入力してくれます。

コマンド

Macのターミナルでよく使うコマンドのメモ書きです。

一つ前のディレクトリに移動
cd -
日時順にファイル一覧を見る
ls -alrt

r オプションが降順 t オプションがタイムスタンプでソート。
降順にしないと最新のファイルが一番上に行って見難いので r オプションを利用。
a オプションは好み。( . で始まるファイルを表示)

ファイルの行数確認
wc -l ./textfile.txt
ユニークソート
uniq ./target.txt | sort > ./saved_file.txt
# 行数確認と組み合わせ
uniq ./target.txt | sort | wc -l
メモリ解放
du -sx /
フォルダ内の容量確認
cd /User/
du -d 1 -h ./
SVNフォルダの削除
cd /User/workspace/
find ./ -name ".svn" -print -exec rm -rf {} ";"
13
13
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
13
13