리눅스마스터2급
[리눅스마스터 2급] cut , /etc/shadow
xemaker
2025. 6. 5. 10:48
cut -d: -f 1,3 /etc/shadow
명령어 cut으로 필드 구분자는 ':'으로 해서 /etc/shadow의 첫 번째와 세 번째 필드를 출력하는 방법
옵션 -d 필드 구분 문자를 지정하며, 옵션 -f는 잘라낼 필드 범위를 지정. 단절된 필드를 표시할 때는 쉼표(,)를 사용하고, 연속된 필드를 표시할 때는 하이픈(-)을 사용한다.
-d, --delimiter=DELIM
use DELIM instread of TAB for field delimiter
-f, --fields=LIST
select only these fields; also print any line that contains no delimiter character, unless the -s option is specified