1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

テストでよく使用するLinux コマンド

Last updated at Posted at 2023-10-21

異常系試験時に使用するコマンド

chmod: 権限変更
ex) chmod 000 .tsv
rm:ディレクトリ削除
ex)rm -rf file1
オプション
-r: ディレクトリの中身ごと削除する
-f:確認を飛ばす
mkdir:ディレクトリ作成
ex)mkdir file1

vi:テキストエディタを操作する

ex) vi シェルスクリプト名
i:入力可能な状態に遷移
escキー:ノーマルモードに遷移
:q!保存せず終了
:wq 保存して終了
exit:強制終了
ex)exit 1 終了ステータス1を返して終了

テーブル一斉入れ替え

指定したサイズ以上のファイルのサイズを0にする

xxx = find . -type f -name '*.tsv' -size +1c
truncate $xxx --size 0

用意したデータに入れ替える

copy 用意したファイル $xxx

## 希望の文字列が含まれているファイルを見つける
find . type f -name '*txt' | xargs grep '検索文字列'

階層ディレクトリ作成

mkdir -p ふぁいるめ

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?