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 1 year has passed since last update.

linuxで使用するコマンド一覧

Last updated at Posted at 2023-06-03

linuxで使うコマンド一覧

階層の移動や位置の確認

cd
オプションなしの場合、ホームディレクトリに戻る
cd/folder/file.txtのように一気に移動することもできる

cd ..
階層を上がる

cd -
一つ前の作業ディレクトリに戻る

pwd
現在のディレクトリのパスを表示する

tree
階層をツリー形式で表示

ファイルやフォルダの作成、移動、削除など

touch
ファイルを作成

mkdir
ディレクトリ(フォルダ)作成

cat
ファイルを表示

mv
ファイルやディレクトリの移動、名前を変える
{移動させたいファイル(ディレクトリ)}{移動先のファイル(ディレクトリ)}で移動
{名前を変えたいファイル(ディレクトリ)}{新しいファイル(ディレクトリ)}リネームも可能

cp
ファイルをコピーする
{コピーするファイル}{新しいファイル}でコピーができる
ディレクトリは cp -r でコピー可能

rm
ファイルを削除
ディレクトリは rm -r でコピー可能

rm
ファイルを削除
ディレクトリは rm -r でコピー可能

gzip
ファイルを圧縮

gunzip
ファイルを解凍(自動的に圧縮したファイルはさくじょされる)

その他、覚えておくと便利な機能

clear
入力を全てクリアにする

less
ファイルを1画面ずつ表示。長い内容に使うと良い

shutdown
シャットダウン(使用できるのは本来rootユーザーのみ)
shutdown -r now ただちにシステムを再起動
shutdown -h now  ただちにシステムを停止
shutdown -r 22:30 22時30分に再起動

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?