lsコマンドで、容量が大きいサイズ順にソートする方法

容量関係でついでですが、lsコマンドで容量が大きい順にソートするのは「-S」オプションを使用します
この「-S」コマンドは、ファイルやディレクトリを容量の大きい順にリ ...
CentOS 9 でmailコマンドを使う

CentOS Stream 9 でmailコマンドを使おうと「mailx」をインストールしてみようと思ったけど下記のエラーになりました
$ sudo dnf install mailxLast metadata expirati ...dnf update後にサービスの再起動が必要か確認する

「dnf update」、「yum update」でパッケージのアップデートをおこなっても、起動しているプロセスが古いままで実行されています。「needs-restarting」コマンドでは、 ...
systemctl mask 解除する方法

「systemctl mask 」で、指定のサービスを無効化できます。「systemctl disable 」では指定したサービスの自動起動はしなくなりましたが、「systemctl start ...
Nextcloudでサーバー移行したらエラーでアクセスできない

Nextcloudをインストールしているサーバーを違うサーバーに移設して初期設定を済ませてブラウザでアクセスすると「Internal Server Error」でアクセスできなくなりました
Internal Server Err ...csvファイルをsortコマンドで並び替えする

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

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

ファイルの文字コードを調べたいので「nkf」コマンドを実行したら、下記のように nkf は入っていなかったので、dnfでインストールしたら、インストールできませんでした
$ nkf -g test.txt -bash: nkf: ...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」のオプションを利用すると、空白を無視したり、空行の ...
「mod_rewrite」で、「.htaccess」と「httpd.conf」の違い

「mod_rewrite」を利用して、 のようなURLで、test.doへのアクセスでパラメータにuid=xxxxが含む場合は、uidのパラメータを削除したURLを渡すようにしたいので、下記のような「.htaccess」を作成してテス ...
Nextcloud の警告「メモリキャッシュが設定されていません。」

Nextcloud で「概要」→「セキュリティ&セットアップ警告」を確認すると、警告メッセージが表示されてました。
メモリキャッシュが有効になっていない場合や ...