"리눅스 shuf"의 두 판 사이의 차이

잔글 (봇: 자동으로 텍스트 교체 (-</source> +</syntaxhighlight>, -<source +<syntaxhighlight ))
 
(다른 사용자 한 명의 중간 판 2개는 보이지 않습니다)
6번째 줄: 6번째 줄:


==예시 1: 숫자==
==예시 1: 숫자==
<source lang='console'>
<syntaxhighlight lang='console'>
[root@localhost ~]# shuf -i 1-6
[root@localhost ~]# shuf -i 1-6
4
4
14번째 줄: 14번째 줄:
5
5
6
6
</source>
</syntaxhighlight>
<source lang='console'>
<syntaxhighlight lang='console'>
[root@localhost ~]# shuf -i 1-6 -n3
[root@localhost ~]# shuf -i 1-6 -n3
1
1
5
5
3
3
</source>
</syntaxhighlight>
<source lang='console'>
<syntaxhighlight lang='console'>
[root@localhost ~]# shuf -i 1-6 -n3 | xargs -n3
[root@localhost ~]# shuf -i 1-6 -n3 | xargs -n3
1 5 4
1 5 4
</source>
</syntaxhighlight>


==예시 2: 문자열==
==예시 2: 문자열==
<source lang='console'>
<syntaxhighlight lang='console'>
[root@localhost ~]# ls /
[root@localhost ~]# ls /
bin  dev  home  lib64      media  opt  root  selinux  sys  usr
bin  dev  home  lib64      media  opt  root  selinux  sys  usr
boot  etc  lib  lost+found  mnt    proc  sbin  srv      tmp  var
boot  etc  lib  lost+found  mnt    proc  sbin  srv      tmp  var
</source>
</syntaxhighlight>
<source lang='console'>
<syntaxhighlight lang='console'>
[root@localhost ~]# ls / | shuf -n3
[root@localhost ~]# ls / | shuf -n3
var
var
proc
proc
selinux
selinux
</source>
</syntaxhighlight>


==같이 보기==
==같이 보기==
*[[복잡한 패스워드 생성]]
* [[Bash $RANDOM]]
*[[로또번호 생성]]
* [[복잡한 패스워드 생성]]
*[[함수 shuffle()]]
* [[로또번호 생성]]
* [[함수 shuffle()]]


[[분류: 랜덤]]
[[분류: /usr/bin]]
[[분류: /usr/bin]]
[[분류: coreutils]]
[[분류: coreutils]]

2021년 5월 7일 (금) 12:45 기준 최신판

1 개요[ | ]

/usr/bin/shuf
리눅스 shuf

2 예시 1: 숫자[ | ]

[root@localhost ~]# shuf -i 1-6
4
3
1
2
5
6
[root@localhost ~]# shuf -i 1-6 -n3
1
5
3
[root@localhost ~]# shuf -i 1-6 -n3 | xargs -n3
1 5 4

3 예시 2: 문자열[ | ]

[root@localhost ~]# ls /
bin   dev  home  lib64       media  opt   root  selinux  sys  usr
boot  etc  lib   lost+found  mnt    proc  sbin  srv      tmp  var
[root@localhost ~]# ls / | shuf -n3
var
proc
selinux

4 같이 보기[ | ]

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