Quantcast
Channel: Bashタグが付けられた新着記事 - Qiita
Viewing all articles
Browse latest Browse all 2820

Linuxコマンド(shell) 基本項目

$
0
0
初めに bashにおいて基本的なコマンド、使えるコマンド、よくみるコマンド、コマンドラインで操作していく上で重要なコマンドをまとめました。軽く紹介しているだけなので、それぞれのオプションなどはurlから飛んで確認してみてください。 ls 現在のディレクトリの中身を確認するコマンド //commandディレクトリの中身確認 command % ls # command.txt mkdir フォルダを作る //mkdirでフォルダを作って中身確認 command % mkdir test command % ls # command.txt test/ cd 現在のディレクトリを移動するコマンド testフォルダに移動 command % ls #command.txt test/ command % cd test test % pwd 現在のディレクトリがどこなのか表示する //pwdでそのときの場所を(絶対パスで)確認 test % pwd #/Users/*/Self-development/qiita/command/test 絶対パス : 最上階のフォルダの場所からそのときの場所まで全てつなげたパス touch ファイルを作る test % touch text.txt test % ls #text.txt vi ファイルを編集できる test % vi text.txt # このコマンドを打つとtextが表示された画面になる。そのままだとコマンドモードであるが、iを押すことによって編集モードとなる。そして、'hello world'と打ち込む。 # 編集モードを保存して閉じるときは # まずescキーを押し、シフトキーを押しながらzを2回押せばコマンドラインに戻る。 cat ファイルの中身を確認する // viで入れたhello worldが入っていることがわかる test % cat text.txt #helloworld cp ファイルをコピーする // コピーされていることがわかる test % cp text.txt copy.txt test % ls # copy.txt text.txt test % cat copy.txt #hello world ps 現在、Linux上で動作しているプロセスを確認する // zshが動いている test % ps PID TTY TIME CMD 60949 ttys001 0:00.43 -zsh ssh リモートマシンにログインし、リモートマシン上でコマンドを実行するコマンド https://webkaru.net/linux/ssh-command/

Viewing all articles
Browse latest Browse all 2820

Trending Articles