XFSファイルシステムでのディスク容量の拡張

使用しているクラウドで、ディスクの空きが少なくなってきたので、ディスク容量拡張する事にしました。
クラウドのサポートページにディスク容量を拡張する下記のような手順がありましたが、ファイルシステムがext4だったので、xfs ...
CUI環境でネット速度を測定する方法【speedtest-cli】

CentOSのCUI環境で高負荷の状態ではないのにコンソール操作の反応が遅いので回線速度が遅くなっているかも思って、回線速度を調べようと思ったのですが、GUIのブ ...
「新しいBing」でプロセスを監視するシェルスクリプトを作成

前回はChatGPTでプロセス監視の記事(ChatGPTでプロセスを監視するシェルスクリプトを作成)を書きましたが、マイクロソフトの「新しいBing」も使用できるようになったので、こちらでもプロセス監視のシェルスクリプトを作って貰いま ...
cronでS3のファイルをダウンロードするシェルスクリプトを実行するとダウンロードできない

AWS CLIで、s3からファイルをダウンロードするシェルスクリプトがあって、シェルスクリプトを実行すると問題なく実行できてCron経由だとエラーになる状況でした
s3からダウンロードするスクリプトは下記のようになっています ...
シェルスクリプトで引数でループする処理する方法(for文)

シェルスクリプトで全ての引数だけfor文でループ処理するには、下記のようなコードになります
#!/bin/bashfor i in "${@}"; do echo $idonefor文の構文は以下のようになります
f .../bin/bash^M: bad interpreter: No such file or directory の時の対処法

いつもは、LinuxにSSHログインしてvim コマンドでシェルスクリプトを作るのですが、Windowsでテキストエディタでシェルスクリプトで作ると改行コードが「\r\n」で保存されて、シェルスクリプトを実行すると下記のようなエラーに ...
sshd が起動しない(sshd: no hostkeys available — exiting.)

サーバーの管理は、Cockpitで管理していてサービスのメニューを確認すると「cloud-init」が起動に失敗していたので、手動で起動するとSSHのパスワード認証でログインできなくなった。
複数のサーバーも作らないので「 ...
nohupで実行した出力結果を、nohup.out以外のファイルに保存する

nohupを実行すると、コマンド実行時の標準出力・標準エラーは「nohup.out」のファイルに追加されます。
ファイルが肥大したり、以前の ...
SSHログインでログイン失敗を確認する方法

CentOSでは、SSHログイン・コンソール操作に関するログは「/var/log/secure」に保存されています
Debian, Ubuntuでは、SSHログイン・コンソール操作に関するログは「/var/log/auth ...
ディレクトリ内のファイルをzipで圧縮する

ディレクトリ内のファイルをzipファイルに圧縮するには「zip」コマンドを圧縮できます
書式は「zip -r 」になります。「-r」でサブディレクトリを含めて圧縮できます
zip -r example_com.zi ...javaのバージョンを確認する方法

LinuxでJavaのバージョンを確認するには「java -version」のコマンドで確認できます。但し、Javaがインストールされている場合です
$ java -versionopenjdk version "11.0.17 ...サーバーをシャットダウン時に「A stop job is running for …」と表示されサーバーが停止しない

Zabbixを運用しているクラウドのサーバーで、仮想マシンを停止時に「A stop job is running for Zabbix Server」と表示され永遠と停止されなくなります。停止できなくなるので「強制的に停止する」のオプ ...
userdel でユーザー削除時にホームディレクトリも削除する

Linuxでユーザーを削除するときは、「userdel」のコマンドを削除しますがこのコマンドで何もオプションを使用しない場合は、ホームディレクトリやメールスプールのディレクトリが残ってしまいます
# testユーザーを作成します ...「exiv2」jpegのExif情報を削除・編集するコマンド

CentOS Stream 9 をインストールしてからSSH接続した時に「exit」コマンドで抜けるですが、いつもは「exi」+「tab」でタブ補完を利用して「exit」コマンドを入力していましたが、CentOS Stream 9 で ...
シェルスクリプトで「integer expression expected」のエラー

昔作ったシェルスクリプトで久しぶりに実行してみたら、下記のように「integer expression expected」とエラーが上がって処理ができていませんでした
sh test.sh: line 6: ; then ec ...