Skip to content

Instantly share code, notes, and snippets.

@trmtsy
Created November 1, 2012 08:14
Show Gist options
  • Save trmtsy/3992434 to your computer and use it in GitHub Desktop.
Save trmtsy/3992434 to your computer and use it in GitHub Desktop.
Linuxでよく使うコマンドをメモ
ファイルを送る
scp ファイル名 ユーザ@接続先ホスト:保存先
# scp ./localfile.txt user@192.168.56.110:~/
ファイルを取得する
scp ユーザ@接続先ホスト:ファイル名 保存先
# scp user@192.168.56.110:~/serverfile.txt ~/
シャットダウン
# shutdown -h now
再起動
# reboot
ユーザー情報の表示
id ユーザー名
# id rn064
uid=500(rn064) gid=500(rn064) 所属グループ=500(rn064)
ユーザーの追加
useradd ユーザー名
# useradd -u 501 -g 500 -G wheel admin
-u ユーザID
-g 主グループID
-G 所属グループ(カンマ区切りで複数指定可)
ディレクトリの容量を表示
# du -m directory/
-m メガバイト単位で表示する
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment