리눅스 콜론 앞부분만 얻기

1 개요[ | ]

리눅스 콜론 앞부분만 얻기
출력명령어 | cut -d: -f1

2 예시[ | ]

root@wsl:~# cat /etc/passwd | head -3
root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
bin:x:2:2:bin:/bin:/usr/sbin/nologin
root@wsl:~# file /etc/dpkg/*
/etc/dpkg/dpkg.cfg:   ASCII text
/etc/dpkg/dpkg.cfg.d: directory
/etc/dpkg/origins:    directory

3 cut[ | ]

root@wsl:~# file /etc/dpkg/* | cut -d: -f1
/etc/dpkg/dpkg.cfg
/etc/dpkg/dpkg.cfg.d
/etc/dpkg/origins

4 sed[ | ]

root@wsl:~# file /etc/dpkg/* | sed 's|:.*||'
/etc/dpkg/dpkg.cfg
/etc/dpkg/dpkg.cfg.d
/etc/dpkg/origins

5 같이 보기[ | ]

6 참고[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}