-
C#樹林
[C#] Proper Handling of Base64 Conversion and Encoding for Text Data
Overview To convert text data into Base64 format, you must first convert the text into a byte array. This article explains the implementation pattern for correctly converting between strings and Base64 by combining System.Text.Encoding a... -
C#樹林
【C#】テキストデータのBase64変換処理とEncodingの正しい扱い方
概要 テキストデータをBase64形式に変換するためには、一度バイト配列を経由する必要があります。 本記事では、System.Text.Encoding と System.Convert を組み合わせ、文字列とBase64を正しく相互変換する実装パターンを解説します。 仕様(入出力) 入力... -
C#樹林
[C#] Converting Between Byte Arrays and Base64 Strings
Overview This article explains how to implement Base64 encoding, which is essential for handling binary data (such as images, PDFs, or encrypted keys) in text formats like JSON or HTTP headers. By using the standard System.Convert class,... -
C#樹林
【C#】byte配列とBase64文字列を相互に変換する
概要 バイナリデータ(画像、PDF、暗号化されたキーなど)をJSONやHTTPヘッダーなどのテキスト形式で扱う際に必須となる、Base64エンコーディング処理の実装方法です。 標準ライブラリの System.Convert クラスを使用し、バイト配列とBase64文字列の相互変... -
Linux樹林
[Linux] Bundle and Encrypt Files with the zip Command
Overview The zip command is used to compress and archive files into the ZIP format. This format is highly compatible and is the standard for exchanging data with Windows environments. It allows you to combine multiple files into one whil... -
Linux樹林
【Linux】zipコマンドで複数のファイルをまとめて圧縮・暗号化する
概要 Windows環境などとのデータ受け渡しにおいて、最も互換性が高く標準的に利用される「ZIP形式」でファイルを圧縮・アーカイブするためのコマンドです。 ディレクトリ構造を保ったまま複数のファイルを一つにまとめたり、パスワードをかけて簡易的なセ... -
Linux樹林
[Linux] High Compression and Extraction with the bzip2 and bunzip2 Commands
Overview The bzip2 command uses the "Burrows-Wheeler Transform" algorithm to compress (encode) and decompress (decode) files. While it is slower than the standard gzip command, it offers a higher compression ratio. Compressed files typic... -
Linux樹林
【Linux】bzip2/bunzip2コマンドでファイルを高圧縮・展開する
概要 ファイルを「Burrows-Wheeler変換」というアルゴリズムを用いて圧縮(エンコード)・展開(デコード)するコマンドです。 Linux標準の圧縮形式としては、gzipよりも処理速度は劣りますが、より高い圧縮率を実現できるのが特徴です。拡張子には一般的... -
Linux樹林
[Linux] Compress and Decompress Files with the gzip and gunzip Commands
Overview The gzip and gunzip commands are the standard tools for handling the .gz file format in Linux. gzip is used to compress files, and gunzip is used to decompress (extract) them. It is important to note that unlike the ZIP format i... -
Linux樹林
【Linux】gzip/gunzipコマンドでファイルを圧縮・展開する
概要 Linuxで最も標準的に利用されるファイル圧縮形式「.gz」を作成、および展開するためのコマンドです。 gzip はファイルを圧縮し、gunzip は展開(解凍)を行います。 注意点として、WindowsのZIP形式などとは異なり、このコマンド単体では「複数のファ... -
Linux樹林
[Linux] Create, Compress, and Extract Archives with the tar Command
Overview The tar command is used to bundle multiple files or directories into a single file called an "archive," or to extract files from such an archive. The name comes from "Tape ARchive," but today it is the standard tool in Linux for... -
Linux樹林
【Linux】tarコマンドでアーカイブの作成・圧縮・展開を行う
概要 複数のファイルやディレクトリを1つのファイル(アーカイブ)にまとめたり、そこから元のファイルを取り出したりするためのコマンドです。 「Tape ARchive」に由来しますが、現在はテープだけでなくバックアップファイルの作成や、ソースコードの配布... -
Linux樹林
[Linux] Encode and Decode Data with the base64 Command
Overview The base64 command is used to convert binary or text data into Base64 format—a string consisting of only 64 types of alphanumeric characters and symbols—and to decode that data back to its original form. This command is the stan... -
Linux樹林
【Linux】base64コマンドでデータをエンコード・デコードする
概要 バイナリデータやテキストデータを、Base64形式(64種類の英数字と記号のみで構成される文字列)に変換(エンコード)したり、逆に元のデータに戻したり(デコード)するためのコマンドです。 メールへのファイル添付、Web APIでのデータ送受信、Basi... -
Linux樹林
[Linux] Convert Binary Files to Text and Back with uuencode/uudecode
Overview These commands allow you to convert binary files (such as images, executables, or compressed archives) into an "ASCII text format" that can be pasted into email bodies or text-based forums. You can then use the corresponding com... -
Linux樹林
【Linux】uuencode/uudecodeでバイナリファイルをテキスト変換・復元する
概要 バイナリファイル(画像、実行ファイル、圧縮アーカイブなど)を、メール本文やテキスト掲示板などに貼り付けられる「ASCIIテキスト形式」に変換(エンコード)し、それを元のバイナリに戻す(デコード)ためのコマンド群です。 現在では base64 コマ... -
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コマンドで実行ファイルのフルパスを確認する
概要 実行しようとしているコマンドが、システム上の「どこにあるファイルなのか(フルパス)」を表示するコマンドです。 同じ名前のコマンドが複数インストールされている場合に、実際に実行されるのがどれかを確認したり、スクリプト内で絶対パスを指定...