mori– Author –
-
Linux樹林
[Linux] Calculate and Verify File Hash Values with md5sum and sha1sum
Overview The md5sum and sha1sum commands calculate "hash values" (message digests) to confirm if a file was transferred correctly or if it has been tampered with. These are frequently used to check for corruption after downloading ISO im... -
Linux樹林
【Linux】md5sum/sha1sumコマンドでファイルのハッシュ値を計算・検証する
概要 ファイルの「ハッシュ値(メッセージダイジェスト)」を計算し、ファイルが正しく転送されたか、あるいは改ざんされていないかを確認するためのコマンドです。 ISOイメージのダウンロード後の破損チェックや、バックアップデータの整合性確認で頻繁に... -
Linux樹林
[Linux] Instantly Resize and Adjust Files with the truncate Command
Overview The truncate command allows you to "shrink" or "expand" a file to a specific byte size without actually reading or writing its contents. It is commonly used to create huge test files that consume minimal disk space (sparse files... -
Linux樹林
【Linux】truncateコマンドでファイルサイズを瞬時に変更・調整する
概要 ファイルの内容を読み書きすることなく、指定したバイトサイズに「切り詰め(縮小)」たり「拡張(拡大)」したりするコマンドです。 ディスクの消費を抑えた巨大なテスト用ファイルの作成(スパースファイル)や、ログファイルの内容を一瞬で0バイト... -
Linux樹林
[Linux] Split and Restore Large Files with the split Command
Overview The split command is used to break a single large file into multiple smaller files based on a specific number of lines or a specific file size. This is very helpful when you need to bypass email attachment size limits or store h... -
Linux樹林
【Linux】splitコマンドで巨大なファイルを分割・復元する
概要 1つの大きなファイルを、指定した行数やサイズごとの複数の小さなファイルに分割するコマンドです。 メールの添付ファイル容量制限を回避したり、FAT32などのファイルサイズ制限(4GB)があるメディアに巨大なデータを保存したりする際に役立ちます。... -
Linux樹林
[Linux] Extract the Directory Path from a File Path with the dirname Command
Overview The dirname command removes the filename from the end of a specified file path (string) and displays only the directory portion (parent path). It is the counterpart to the basename command. In shell scripts, it is an essential t... -
Linux樹林
【Linux】dirnameコマンドでパスからディレクトリ部分を抽出する
概要 指定されたファイルパス(文字列)から、末尾のファイル名を取り除き、ディレクトリ部分(親パス)だけを表示するコマンドです。 basename コマンドの対となる存在で、主にシェルスクリプトにおいて「対象ファイルが置かれているディレクトリに移動し... -
Linux樹林
[Linux] Extract Only the Filename from a Path with the basename Command
Overview The basename command extracts just the "filename" from a file path (a string including directories) by removing the directory portion. It is primarily used in shell scripts to get filenames from log paths or to generate new file... -
Linux樹林
【Linux】basenameコマンドでパスからファイル名部分のみを抽出する
概要 ファイルパス(ディレクトリを含む文字列)から、ディレクトリ部分を取り除き、最後の「ファイル名」だけを抽出して表示するコマンドです。 主にシェルスクリプトにおいて、ログファイルのパスからファイル名だけを取得したり、バックアップ処理でフ... -
Linux樹林
[Linux] Perform Fast File Searches with the locate Command
Overview The locate command is used to search for files and directories across the entire Linux system using keywords. While the find command scans the disk in real-time, locate refers to a pre-built "filename database." This makes its s... -
Linux樹林
【Linux】locateコマンドでファイルを高速検索する
概要 Linuxシステム全体から、ファイル名やディレクトリ名をキーワードにしてファイルを検索するコマンドです。 find コマンドがディスクを都度スキャンするのに対し、locate はあらかじめ作成された「ファイル名データベース」を参照するため、検索速度が... -
Linux樹林
[Linux] Locate the Full Path of Executable Files with the which Command
Overview The which command displays the "full path" of the file that runs when you type a command. It is used to confirm which version of a command is being executed when multiple versions are installed. It is also helpful for identifyin... -
Linux樹林
【Linux】whichコマンドで実行ファイルのフルパスを確認する
概要 実行しようとしているコマンドが、システム上の「どこにあるファイルなのか(フルパス)」を表示するコマンドです。 同じ名前のコマンドが複数インストールされている場合に、実際に実行されるのがどれかを確認したり、スクリプト内で絶対パスを指定... -
Linux樹林
[Linux] Execute Commands in Bulk with Standard Input Using the xargs Command
Overview The xargs command takes a list of data from standard input (such as a pipeline) and converts it into "arguments" for a specific command. It is a key tool for pipeline processing and automation. For example, you can use it to del... -
Linux樹林
【Linux】xargsコマンドで標準入力を引数にしてコマンドを一括実行する
概要 標準入力(パイプラインなど)から渡されたデータリストを、指定したコマンドの「引数」として変換し、実行するためのコマンドです。 find コマンドで検索した大量のファイルを一括で削除したり、テキストリストを読み込んで複数のディレクトリを作成... -
Linux樹林
[Linux] Search and Manipulate Files with the find Command
Overview The find command is a powerful tool used to search for files within a system based on various conditions such as filename, modification time, size, permissions, and ownership. It does more than just locate files; it can also per... -
Linux樹林
【Linux】findコマンドで条件を絞ってファイルを検索・操作する
概要 システム内に存在する膨大なファイルの中から、ファイル名、更新日時、サイズ、権限、所有者など、あらゆる条件を組み合わせてファイルを検索する強力なコマンドです。 単に場所を探すだけでなく、検索したファイルに対して「削除する」「移動する」... -
Linux樹林
[Linux] Set Default Permissions for New Files with the umask Command
Overview The umask command controls the default access permissions (permissions) assigned to files and directories when they are newly created. Unlike commands that specify which permissions to give, umask works by specifying which permi... -
Linux樹林
[Linux] Change File Attributes and Prevent Deletion with the chattr Command
Overview The chattr command is used to set and change "special attributes" (extended attributes) in Linux file systems like ext2, ext3, ext4, and XFS. These attributes are different from standard permissions (read, write, execute). It is... -
Linux樹林
【Linux】umaskコマンドでファイル作成時の初期権限(マスク値)を設定する
概要 Linuxにおいて、ファイルやディレクトリを新規作成した際に、デフォルトで付与されるアクセス権限(パーミッション)を制御するためのコマンドです。 「どの権限を与えるか」ではなく「どの権限を禁止するか(マスクするか)」という引き算の考え方で... -
Linux樹林
【Linux】chattrコマンドでファイルの属性変更・削除禁止設定を行う
概要 Linuxの標準的なファイルシステム(ext2/ext3/ext4)やXFSなどにおいて、通常のパーミッション(読み書き実行)とは異なる「特殊属性(拡張属性)」を設定・変更するためのコマンドです。 特に、rootユーザーであっても削除や変更ができなくなる「不... -
Linux樹林
[Linux] Display Special File Attributes with the lsattr Command
Overview The lsattr command is used in standard Linux file systems (such as ext2, ext3, and ext4) to check "special attributes" (extended attributes) that are separate from normal permissions (rwx). This command allows you to identify fi... -
Linux樹林
【Linux】lsattrコマンドでファイルの特殊属性(拡張属性)を表示する
概要 Linuxの標準的なファイルシステム(ext2/ext3/ext4など)において、通常のパーミッション(rwx)とは別の「特殊属性(拡張属性)」を確認するためのコマンドです。 「root権限があっても削除できないファイル」や「追記しかできないログファイル」な... -
Linux樹林
[Linux] Change Group Ownership with the chgrp Command
Overview The chgrp command is specifically designed to change the "owning group" of files and directories. While you can also change groups with the chown command, chgrp has a simpler syntax. It is frequently used when you want to manage... -
Linux樹林
【Linux】chgrpコマンドでファイルのグループ所有権を変更する
概要 ファイルやディレクトリの「所有グループ」を変更することに特化したコマンドです。 chown コマンドでもグループの変更は可能ですが、chgrp は構文がシンプルで、特に「プロジェクトメンバー内での共有設定」や「Webサーバーの書き込み権限設定」など... -
Linux樹林
[Linux] Change File and Directory Owner and Group with the chown Command
Overview The chown command is used to change the "owner" and "group" of files and directories in Linux. By default, the user who creates a file becomes its owner. However, you often need to change ownership when deploying web servers or ... -
Linux樹林
【Linux】chownコマンドでファイル・ディレクトリの所有者とグループを変更する
概要 Linuxにおけるファイルやディレクトリの「所有者(オーナー)」および「所有グループ」を変更するためのコマンドです。 通常、ファイルを作成したユーザーがその所有者となりますが、Webサーバーのデプロイ時や、バックアップファイルを別ユーザーに... -
Linux樹林
[Linux] Change File and Directory Permissions with the chmod Command
Overview The chmod command is a fundamental tool for security management in Linux. It sets access permissions—"who" (owner, group, others) can do "what" (read, write, execute)—for files and directories. You will use this command frequent... -
Linux樹林
【Linux】chmodコマンドでファイル・ディレクトリの権限(パーミッション)を変更する
概要 Linuxにおけるセキュリティ管理の基本となるコマンドで、ファイルやディレクトリに対する「誰が(所有者・グループ・その他)」「何をできるか(読み・書き・実行)」というアクセス権限(パーミッション)を設定します。 Webサーバーの公開設定や、...