UNIXコマンド


  • cd :ディレクトリ移動
  • ls :階層のファイル一覧
  • ls -la:階層のファイル一覧を日付とかパーミッションを表示しつつ、隠しファイルとかも表示する
  • rmdir:空ディレクトリを削除
  • rm :ファイル削除
  • rm -r :ファイル完全削除
  • mkdir hoge:hogeというディレクトリを作る
  • touch hoge.text:hoge.textをつくる
  • pwd:今いる場所のパスを表示
  • vi hoge.text:hoge.textをviで編集
  • tail hoge.text:hoge.textをよみこんで後ろの数行を表示
  • mv hoge.text hoge2.text hoge :ほげディレクトリにhoge.text とhoge2.textをいれる
  • cp hoge.text hoge2.text :ほげてきすとをほげてきすと2って名前でコピーする
  • find / -name "hoge":hogeって名前のファイルをrootからさがす。
  • man find:findのヘルプがでてくる。
  • ping google.com:ぐーぐるにつないでみるよ!
  • su -:ユーザーからるーと権限でターミナルいじれるようになるよー
  • su:ユーザーからルートに切り替えるけど、パスはかわらないよー
  • ifconfig:自分のインターフェイス状況とかネットワーク情報とかでてきてカオス
  • ps -ax | grep vi:今うごかしているネットワークからviを検索するのがgrep
  • cat hoge.text:hoge.textの中身がみれる。
  • reboot:OS再起動
  • hostname:ほすとねーむがわかるよ!!
  • lsof -i:システムの使っているポートをずらずら出力
  • mv index2.html index.html:ファイルの名前をindex2.htmlからindex.htmlに変える
  • open -a /Applications/CotEditor.app/Contents/MacOS/CotEditor .git/config :CotEditorで.gitのconfigを開く。
  • open -a /Applications/Espresso.app/Contents/MacOS/Espresso index.html :Espressoでindex.htmlを開く。
  • open -a espresso index.html:これでもえすぷれっそでindex.htmlをひらくよ。
  • chkconfig httpd on:OSの起動時にhttpdを自動でonにする
  • netstat -ln:使用されているポート番号を確認
  • /etc/init.d/crond status:cronがうごいているか確認
  • cat ファイル | pbcopy:コピーする。コマンドvで貼付けられます。
  • ls -la ファイル:よくつかう。よくわかんないけど。いろんな情報リストでだす。
  • /sbin/service vsftpd start:FTPサーバを起動する
  • scp -r 送るファイル ユーザー名@IPアドレス: :ディレクトリを送信
  • scp 送るファイル ユーザー名@IPアドレス: :ファイルを送信
  • whereis chkconfig:chkconfigコマンドまでのパスを知る
  • chown ikezawaayaka /var/www/html/:/var/www/html/のユーザーをikezawaayakaに。
  • ll /var/www/:/var/wwwの管理ユーザー確認

3 件のコメント: