풀이
rcity18@9947d876f6e5:~$ ls -l
total 4
-rw-r--r-- 1 root root 918 Mar 6 08:04 rcity19
rcity18@9947d876f6e5:~$ head rcity19
Flag components:
adding one by one
adding one by one
adding one by one
adding one by one
adding one by one
adding one by one
adding one by one
adding one by one
adding one by one
뭔가 엄청나게 많은 것같다
rcity18@9947d876f6e5:~$ git log
commit 7599ad53e055ece5b61ef8b81f149940187bd35f (HEAD -> master)
Author: rcity18 <rcity18@saveme.com>
Date: Wed Mar 6 08:04:14 2024 +0000
Add flag character . by User
commit b6d2e1be0743693fa9ba1c18a229bb700582b4e6
Author: rcity18 <rcity18@saveme.com>
Date: Wed Mar 6 08:04:14 2024 +0000
Add flag character . by User
commit e2f65eb849534807b5803fe2a28aaa845461e497
Author: rcity18 <rcity18@saveme.com>
Date: Wed Mar 6 08:04:14 2024 +0000
Add flag character . by User
commit 7deb44d949d93313729fbb2645e91e45a3037207
Author: rcity18 <rcity18@saveme.com>
Date: Wed Mar 6 08:04:14 2024 +0000
Add flag character E by User
commit b3cf549616d3adf1c5e9d9b152f8afeaa11c4daf
Author: rcity18 <rcity18@saveme.com>
Date: Wed Mar 6 08:04:14 2024 +0000
Add flag character M by User
commit b18a70b04a328b2e7cef33e5394f002176a5dc9c
Author: rcity18 <rcity18@saveme.com>
Date: Wed Mar 6 08:04:14 2024 +0000
Add flag character O by User
commit b351f30377736da3f56f4af9b600a47ca9551116
Author: rcity18 <rcity18@saveme.com>
Date: Wed Mar 6 08:04:14 2024 +0000
Add flag character C by User
페이지가 연결될 만큼 길다
rcity18@9947d876f6e5:~$ git log | grep -iw "add"
Add flag character . by User
Add flag character . by User
Add flag character . by User
Add flag character E by User
Add flag character M by User
Add flag character O by User
Add flag character C by User
Add flag character L by User
Add flag character E by User
Add flag character W by User
Add flag character } by User
Add flag character 9 by User
Add flag character i by User
Add flag character 8 by User
Add flag character h by User
Add flag character 7 by User
Add flag character g by User
Add flag character 6 by User
Add flag character f by User
Add flag character 5 by User
Add flag character e by User
Add flag character 4 by User
Add flag character d by User
Add flag character 3 by User
Add flag character c by User
Add flag character 2 by User
Add flag character b by User
Add flag character 1 by User
Add flag character a by User
Add flag character { by User
Add flag character 9 by User
Add flag character 1 by User
Add flag character y by User
Add flag character t by User
Add flag character i by User
Add flag character c by User
Add flag character r by User
Add flag character . by User
Add flag character . by User
Add flag character . by User
Add flag character Y by User
Add flag character T by User
Add flag character I by User
Add flag character C by User
Add flag character N by User
Add flag character O by User
Add flag character C by User
Add flag character C by User
Add flag character A by User
Add flag character R by User
뭔가 문자가 보인다!!! 더 잘보이게 하기 위해서 추가적으로 명령어를 찾아서 많은 시행 착오를 겪었다
rcity18@9947d876f6e5:~$ git log | grep -iw "add" | awk '{print $4}' | paste -s -d ''
...EMOCLEW}9i8h7g6f5e4d3c2b1a{91yticr...YTICNOCCAR
rcity18@9947d876f6e5:~$ git log | grep -iw "add" | awk '{print $4}' | paste -s -d '' | rev
RACCONCITY...rcity19{a1b2c3d4e5f6g7h8i9}WELCOME...
grep
awk
paste
rev
등등 다양한 명령어를 활용하여 Add flag ~~ 이렇게 되어있는 문자를 단 한줄로 flag가 나올수 있게 출력 성공!!
grep
-i : 대소문자 구문 해제
-w : 해당 문자열 줄 출력
awk '{print $4}'
awk는 파일에서 레코드를 선택하고, 선택된 레코드에 포함된 레코드 값을 핸들링하거나 데이터화 하는 것
특정 필드, 이번에는 4번째 열을 출력해야하기 때문에 인자값 $4를 주면 된다
paste
처음에 tr 명령어를 사용하려 했는데 공백 제거가 안되길래 구글링해서 paste 라는 명령어로 진행
-s : 여러줄을 하나의 줄로 결합해라
-d : 각 줄을 결합할 때 사용할 구분자를 지정 이번 경우 ''를 사용해서 아무런 구분자 없이 줄을 결합하라는 의미
rev
정렬한 문자를 reverse 거꾸로 하기 위해서 사용
리눅스 명령어를 잘 활용하자
'rcity' 카테고리의 다른 글
rcity17 Write-Up (0) | 2024.04.02 |
---|---|
rcity16 Write-Up (0) | 2024.04.02 |
rcity15 Write-Up (0) | 2024.04.02 |
rcity14 Write-Up (0) | 2024.04.01 |
rcity13 Write-Up (0) | 2024.04.01 |