"리눅스 계정 목록 보기"의 두 판 사이의 차이

70번째 줄: 70번째 줄:
root:x:0:0:root:/root:/bin/bash
root:x:0:0:root:/root:/bin/bash
mysql:x:27:27:MySQL Server:/var/lib/mysql:/bin/bash
mysql:x:27:27:MySQL Server:/var/lib/mysql:/bin/bash
</source>
<source lang='dos'>
[root@jmnote ~]# grep /bin/bash /etc/passwd | cut -f1 -d:
[root@jmnote ~]# grep /bin/bash /etc/passwd | cut -f1 -d:
root
root

2012년 8월 16일 (목) 12:36 판

리눅스 계정 목록 보기
리눅스 계정 목록 확인
리눅스 계정 확인

1 전체 목록

명령어
cat /etc/passwd
cut -f1 -d: /etc/passwd
예시
[root@jmnote ~]# cat /etc/passwd
root:x:0:0:root:/root:/bin/bash
bin:x:1:1:bin:/bin:/sbin/nologin
daemon:x:2:2:daemon:/sbin:/sbin/nologin
.. (생략)
mysql:x:27:27:MySQL Server:/var/lib/mysql:/bin/bash
oprofile:x:16:16:Special user account to be used by OProfile:/home/oprofile:/sbin/nologin
named:x:25:25:Named:/var/named:/sbin/nologin
[root@jmnote ~]# cut -f1 -d: /etc/passwd
root
bin
daemon
adm
sync
shutdown
halt
mail
news
operator
games
gopher
ftp
nobody
dbus
nscd
avahi
mailnull
smmsp
apache
vcsa
rpc
ntp
sshd
pcap
haldaemon
rpm
hsqldb
xfs
gdm
mysql
oprofile
named

2 셸 사용 계정 목록

명령어
grep /bin/bash /etc/passwd
grep /bin/bash /etc/passwd | cut -f1 -d:
예시
[root@jmnote ~]# grep /bin/bash /etc/passwd
root:x:0:0:root:/root:/bin/bash
mysql:x:27:27:MySQL Server:/var/lib/mysql:/bin/bash
[root@jmnote ~]# grep /bin/bash /etc/passwd | cut -f1 -d:
root
mysql

3 같이 보기

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