Skip to content

Instantly share code, notes, and snippets.

@mamor
Last active December 12, 2015 09:39
Show Gist options
  • Save mamor/4753084 to your computer and use it in GitHub Desktop.
Save mamor/4753084 to your computer and use it in GitHub Desktop.
linuxコマンドのメモ
# ディレクトリ容量1GB以上を表示
$ du -h | grep [0-9]G
# ディレクトリ容量100MB以上を表示
$ du -h | grep [0-9][0-9][0-9]M
# gemのアップデート
$ sudo gem update --system
$ sudo gem update
# Gitで他所で削除されたremoteのブランチ情報を消す
$ git fetch --prune
# ファイル検索
$ find ./ -name "[filename]"
# ファイル内検索
$ find ./ -type f -print | xargs grep "[search string]" /dev/null
# LDAP検索
$ ldapsearch -B -h [host|ipaddress] -p [port] -D "[user dn]" -w [password] "[filter]"
# history削除
$ history -c
# シンボリックリンク作成
$ ln -s [シンボリックリンク先] [作成するシンボリックリンク名]
# データを除いたmysqldump
$ mysqldump -u xxx -pyyy schema --no-data > outputfile
# ツリーコマンド例
$ tree -ifpug > outputfile
# scpでローカルのファイルをリモートに転送
$ scp [ローカルのファイル名] xxx@yyy.zzz:[リモートのパス]
# シャットダウン
$ sudo shutdown -h 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment