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

잔글 (봇: 자동으로 텍스트 교체 (-</source> +</syntaxhighlight>, -<source +<syntaxhighlight ))
 
(사용자 2명의 중간 판 7개는 보이지 않습니다)
3번째 줄: 3번째 줄:
;리눅스 shuf
;리눅스 shuf
*랜덤 순열 생성 리눅스 명령어
*랜덤 순열 생성 리눅스 명령어
*[[GNU 코어유틸]]


==실행 예시==
==예시 1: 숫자==
<source lang='dos'>
<syntaxhighlight lang='console'>
[root@localhost ~]# shuf -i 1-6
[root@localhost ~]# shuf -i 1-6
4
4
13번째 줄: 14번째 줄:
5
5
6
6
</source>
</syntaxhighlight>
<source lang='dos'>
<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='dos'>
<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: 문자열==
<syntaxhighlight lang='console'>
[root@localhost ~]# ls /
bin  dev  home  lib64      media  opt  root  selinux  sys  usr
boot  etc  lib  lost+found  mnt    proc  sbin  srv      tmp  var
</syntaxhighlight>
<syntaxhighlight lang='console'>
[root@localhost ~]# ls / | shuf -n3
var
proc
selinux
</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 }}