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?

clearコマンドとは

clearコマンドとは、実行結果を削除するためのコマンドです。

実行例

以下のようなコマンドラインがあるとします。

image.png

これに対して、clearコマンドを実行すると、表示がリセットされ、画面が綺麗になります。

image.png

画面を綺麗にしたい時に使う感じですね。

主なオプション

-x:削除せずにスクロールする

通常のclearコマンドは画面の表示を全て削除するのに対し、-xコマンドは完全には消しません。その代わり、画面外までスクロールを行うことで見た目のみすっきりさせます。

例えば、以下のような画面でclear-xを実行するとしましょう。
image.png

すると、画面から表示が消え、綺麗になったかのように思えます。
image.png

が、上にスクロールすると内容が残っていることが分かります。

Animation.gif

内容は残しておきたいけど表示だけすっきりさせたい場合はこちらを使うのがよさそうですね。

最後に

今回はclearコマンドについて覚書きしました。
linuxコマンドを覚えていきたいので、知り次第こまめにアウトプットしていきます。

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?