「Kotlin」exists()でフォルダの存在を確認するサンプル
書式
public static boolean exists(Path path,LinkOption… options)
public static boolean notExists(Path pat ...
Ubuntu20.04にerror: could not load the swift standard libraryの対策
エラー現象
<unknown>:0: error: could not load the swift standard library
対策
# sudo apt-get install cla ...
「PHP」is_int()で変数が整数型かどうかをチェックするサンプル
説明
bool is_int ( mixed $var )
使用例
Ubuntu20.04にswift: error while loading shared libraries: libatomic.so.1の解決対策
エラー現象
swift: error while loading shared libraries: libatomic.so.1: cannot open shared object file: No such file o ...
Ubuntu20.04にswift: error while loading shared libraries: libtinfo.so.5の解決対策
エラー現象
# swift –version
swift: error while loading shared libraries: libtinfo.so.5: cannot open shared o ...
Ubuntu20.04にrootユーザのパスワードを設定する方法
現象
$ su – root
Password:
su: Authentication failure
原因
Ubuntuのデフォルトでrootユーザのパスワードが設定されていな ...
[Linux]grepで指定文字[#]で始まるコメント行を表示しない方法
書式
grep -v 正規表現 ファイル名|less
-v, –invert-match
一致しない行を選択する
使用例1
ファイルにで始まるコメント行は表示
# gr ...
「Linux」findコマンドで検索したファイルを削除する方法
書式
find ディレクトリ -type f -size サイズ -exec ls -l {} \;
使用例
1.サイズが110M以上のファイルを検索
# find/usr/local/src -t ...
「Linux」killコマンドでプロセスを終了する方法
書式
kill -9 プロセスID
kill -KILL プロセスID
kill -SIGKILL プロセスID
使用例
1.プロセスの状態を確認
# ps aux | grep htt ...
「Linux」reniceでプロセスの優先度を変更する
書式
renice オプション 優先度
オプション
-g グループ名
-p プロセスID
-u ユーザー名
使用例
1.プロセスIDのnice値を確認
# top p ...
「Linux」catコマンドとsedコマンドでファイルの行頭に引用符を付ける方法
1.書式
cat ファイル名| sed/^/’>’/
2.使用例
# cat 200.txt
AA
BB
11
22
3.行頭に引用 ...
「Linux」grepとcutコマンドを使ってファイルの特定内容を取得する方法
書式
grep 正規表現式 ファイル名 | cut -d: -f2
cutコマンドのオプション
-f, –fields=LIST select only these fields; also pr ...
「Linux」joinコマンドでテキストファイルを同じ項目同士で結合する方法
書式
join オプション ファイルA ファイルB > ファイルC
オプション一覧
Windows10にRust言語をインストールする方法
1.ダウンロード
2.「rustup-init.exe」を実行する
3.インストール画面
「jQuery」prop()でチェックボックスの項目を全てに選択するサンプル
書式
$(‘input:checkbox’).prop(‘checked’,true)
使用例
「Linux」lspciコマンドでPCIデバイスを表示する方法
書式
lspci
1.デバイスの詳細情報を表示
# lspci -v
2.詳細情報を表示
# lspci -vv
3.バスブリッジデバイスをツリー構造で表示
# ls ...
「jQuery」セレクタにeq()を使うサンプル
書式
$(“p:eq(インデックス番号)”)
$(“#id名”)
$(“.クラス名”)
使用例
「CentOS 8」 uniqコマンドで重複した行を抽出する方法
書式
uniq オプション 入力ファイル
-c 重複数
-u 重複しない行
使用例
1.重複行を確認
# cat sample.txt
test
aaaa
bbb ...