
제거 방법[
에서 "[19/Mar/2020:05:57:09
"를 사용 sed
하거나 awk
?
[
로그 파일의 날짜 및 시간에서 " "을(를) 제거해야 합니다 .
답변1
여기에 몇 가지 해결책이 있습니다:
# Remove with tr and write changes to second file
tr -d '[' < file > file_edited
# Remove with sed and write changes to second file
sed 's/\[//' file > file_edited
# Remove with sed and edit the file inplace!
sed -i 's/\[//' file
솔루션 은 파일의 tr
모든 내용을 제거 하고 솔루션은 각 줄의 첫 번째 항목을 삭제합니다 . 이것이 정확히 원하는 내용이 아닌 경우 질문을 편집하고 자세한 내용을 제공해야 합니다.[
sed
[