0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

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

Posted at

初めに

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/
0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?