<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>round-rand</author_name>
  <author_url>https://blog.hatena.ne.jp/round-rand/</author_url>
  <blog_title>ランドML</blog_title>
  <blog_url>https://ml-rand-note.hatenablog.com/</blog_url>
  <categories>
    <anon>Linux</anon>
  </categories>
  <description>if文の基本的な使い方 testコマンドとは？ 基本構文 []との違い if文による条件分岐 ファイル・ディレクトリの判定オプション 数値比較のオプション AND・OR条件 参考 if文の基本的な使い方 testコマンドとは？ testコマンドは、指定した条件が真(True)か偽(False)かを判定するコマンドです。 判定結果は画面に表示されず、終了ステータスとして返されます。 条件が真：終了ステータス 0 条件が偽：終了ステータス 1 testコマンドの結果を画面表示したい場合は、echo $?を使います。 主にif文の分岐条件を書くために使用されます。 # sample.txtがあること…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fml-rand-note.hatenablog.com%2Fentry%2Flinux%2Fif-test-command&quot; title=&quot;【Linux】if文(testコマンド)の使い方｜ファイルやディレクトリの存在確認・条件分岐 - ランドML&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2026-08-12 00:00:00</published>
  <title>【Linux】if文(testコマンド)の使い方｜ファイルやディレクトリの存在確認・条件分岐</title>
  <type>rich</type>
  <url>https://ml-rand-note.hatenablog.com/entry/linux/if-test-command</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
