csvファイルをsortコマンドで並び替えする

sortコマンドを利用して、CSVファイルなどの ○列目 の数字をキーにして並び替えしたい場合があります。
昇順に並び替えする場合は、下記のようにします。
書式:s ...
ファイルの文字コードを変換する【iconv】

Linuxでファイルの文字コードを変換するには「iconv」,「nkf」コマンドを利用すればできますが、この記事では「iconv」コマンドでファイルの文字コードを変換する方法を紹介します。
「iconv」はオプション等は「 ...
wcコマンドでファイルの行数を取得する

Linuxでファイルの行数を取得したい場合は、「wc -l ファイル名」のコマンドで取得できます。「-l, –lines」のオプションは、ファイルの改行数を出力します
$ cat aaa.txt 12345$ wc ...Linuxでファイルの文字コード・改行コードを確認する

「nkf」コマンドを利用してファイルの文字コード・改行コードを確認する方法を説明します。
「nkf」がインストールされていない場合は、yumコマンドでインストールして下さい。 ...
WordPress ヘルスチェックエラー対応 (imagickがインストールされていないか無効化)

久しぶりにWordpressでヘルスチェックをおこなうと下記のようjに、「オプションのモジュール imagickがインストールされていないか、無効化されています。」と表示されています。
imagick は以前の記事「Wor ...
シェルスクリプトで件名に空白が含まれる場合、メールする宛先がおかしくなる

シェルスクリプトでメールを送信する際に件名に空白が含まれる場合、送付する宛先がおかしくなるケースがありました
#!/bin/bashSUBJECT="test1 test2 test3"echo "test mail" | ma ...LinuxからGmailにメールを送るとnonameという添付される

Linuxのサーバーから下記のようなシェルスクリプトでechoコマンドで内容をメール本文に出力して、Gmailにメールすると出力した内容の「noname」というファイルが添付されメールされるケースがありました
#!/bin/ba ...mailx コマンドで添付ファイルをつけてメールを送る

mailxコマンドで添付ファイルを送る場合ですが「-a <添付ファイル>」とすれば添付ファイルをつけてメールを送信することができます
「mailx」コマンドがインストールされていない場合は、yum, dnfコマ ...
diff で改行・空白を無視して比較する

diffコマンドは、ファイルを比較する時によく使うコマンドですが、空白や改行も比較対象として比較されます。
その場合は、「-w」、「-B」のオプションを利用すると、空白を無視したり、空行の ...
tinydnsで逆引きレコードを設定する

使用していたドメインが解約になり、それに紐づいていたIPアドレスを違うドメインに設定したのですが、逆引きが設定がうまくいかず苦労していました。
DNSは、tinydnsを使用している環境で、tinydnsに逆引きレコードを ...
Let’s Encrypt証明書発行を「acme.sh」で発行する (マルチドメイン)

「www.example.com」, 「example.com」 等のサブドメインの異なるドメインを1枚の証明書で発行できるマルチドメイン証明書を、無償の証明書のLet’s Enc ...
tinydnsでSPFレコードを設定する

tinydnsは、小さく、信頼性の高いDNS権威サーバ/キャッシュサーバですは、開発がとまっているようで使っている人は少ないと思いますが、古いサーバーでこのDNSサーバーを利用している環境があって、そのサーバーに送信ドメイン認証のひと ...
Nextcloud の警告「メモリキャッシュが設定されていません。」

Nextcloud で「概要」→「セキュリティ&セットアップ警告」を確認すると、警告メッセージが表示されてました。
メモリキャッシュが有効になっていない場合や ...
Nextcloud の警告「データベースにいくつかのインデックスがありません。」

Nextcloud で「概要」→「セキュリティ&セットアップ警告」を確認すると、下記のような警告メッセージが表示されてました。
データベースにいくつかのインデックスがありません。 大きなテーブルにインデックスを追加すると、自動的 ...mod_rewrite クエリー文字列でパーセントがあるエンコードされるのを避ける

「example.com/test.php?id=ID%2id1234」のようなクエリー付きのパラメータでmod_rewrite でリダイレクトをするときに「%」を含む場合に、「%2」が「%253」のように変更される場合があります