2
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 5 years have passed since last update.

業務でよく使うコマンドをまとめてみた

Posted at

はじめに

業務でログ調査を行うので、その際よく使うコマンドをまとめてみました。

grepコマンド

ファイル中の文字列を検索するコマンドです。

基本的な使い方

grep オプション "検索文字列" ファイル名 

オプション

オプション名 説明
-v 一致しないものを検索する
-e 一致処理に指定した正規表現を使う

cutコマンド

テキストファイルを横方向に分割するコマンドです。

基本的な使い方

必要なバイト数で指定したり、区切り文字でファイルの内容を取得することができます。

cut オプション ファイル名  

オプション

オプション名 説明
-v 区切り文字を指定できる
-e 必要な項目を項目数で指定できる

sortコマンド

データを昇順で並べ替えできるコマンドです。

基本的な使い方

sort ファイル名

uniqコマンド

sortであらかじめ並べ替えされた状態で重複行を削除できるコマンドです。

基本的な使い方

uniq ファイル名

scpコマンド

リモートマシンとローカルマシン、またはリモートマシン間でファイルをコピーする際に使用するコマンドです。

基本的な使い方

scp ユーザ名@リモートのホスト名:コピーしたいリモートのファイル ローカルのコピー先
2
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
2
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?