Linux14 리눅스 11일차(4) - diffText # cat > diffText Hi! Nice to meet you. How are you? # cat -n diffText // 열 라벨을 추가해서 출력 1 Hi! 2 Nice to meet you. 3 How are you? # head -2 diffText > catText // 위에 두 줄만 catText에 넣기 # cat -n catText 1 Hi! 2 Nice to meet you. # diff catText diffText // diff [파일] [파일] ... : 파일끼리 다른 점을 알려줌 // 오른쪽에 파일에만 How are you?라는 문구가 있기 때문에 그 부분만 출력해준다. 2a3 // catText 은 2줄 diffText은 3줄 > How are you? // 다른 줄 2024. 3. 20. 리눅스 11일차(3) - Split Command ### string scope... echo "s{str:offset:length}" // 옵션 순서 str:첫 시작:길이 ## string1.sh // str에서 0에서 5개 출력 #!/bin/bash str="Hello, World, Linux!" echo "${str:0:5}" # chmod +x *.sh # ./string1.sh Hello ##string2.sh // 7번째에서 끝까지(옵션을 안 주었기 때문에) 출력 #!/bin/bash str="Hello, World, Linux!" echo "${str:7}" # ./string2.sh World, Linux ## string3.sh // 뒤에서 7번쨰부터 끝까지 #!/bin/bash str="Hello, World, Linux!" echo .. 2024. 3. 19. 리눅스 11일차(2) - Paste command ### paste command ## names Mark Smith Bobby Brown Sue Miller Jenny Logtit ## numbers 555-1234 555-9876 555-6743 867-5309 # paste names numbers // 열로 붙이기 Mark Smith 555-1234 Bobby Brown 555-9876 Sue Miller 555-6743 Jenny Logtit 867-5309 # paste -s names numbers // 행으로 붙이기 Mark Smith Bobby Brown Sue Miller Jenny Logtit 555-1234 555-9876 555-6743 867-5309 # paste -d., names numbers Mark Smith.555-1.. 2024. 3. 18. 리눅스 11일차(1) - Cut command ### cut command cut 옵션 -c -character -b -bytes -d - delimeter(tab) -f -fields -z -zero-termiated ## test-data UNIX is great os. UNIX is opensource. UNIX is free os. learn operating system. UNIX LINUX which one you choose. User is easy to learn. UNIX is a multiuser os. Learn UNIX. UNIX is powerful. # cut -c 2-4 test-data // test-file에 2번째부터 4번째까지의 chracter를 출력 # cut -c 10- test-data // test-file에.. 2024. 3. 18. 이전 1 2 3 4 다음