<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>shell commands Archives - 어제와 내일의 나 그 사이의 이야기</title>
	<atom:link href="https://lycos7560.com/tag/shell-commands/feed/" rel="self" type="application/rss+xml" />
	<link></link>
	<description>생각의 흐름을 타고 다니며 만드는 블로그</description>
	<lastBuildDate>Mon, 02 Dec 2024 10:23:22 +0000</lastBuildDate>
	<language>ko-KR</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://lycos7560.com/wp-content/uploads/2022/11/cropped-cropped-cropped-log-1-150x150-1-80x80.png</url>
	<title>shell commands Archives - 어제와 내일의 나 그 사이의 이야기</title>
	<link></link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Ubuntu – 파이프(Pipe)/필터(filter)/리다이렉션(redirection)</title>
		<link>https://lycos7560.com/ubuntu/ubuntu-%ed%8c%8c%ec%9d%b4%ed%94%84pipe-%ed%95%84%ed%84%b0filter-%eb%a6%ac%eb%8b%a4%ec%9d%b4%eb%a0%89%ec%85%98redirection/38877/</link>
					<comments>https://lycos7560.com/ubuntu/ubuntu-%ed%8c%8c%ec%9d%b4%ed%94%84pipe-%ed%95%84%ed%84%b0filter-%eb%a6%ac%eb%8b%a4%ec%9d%b4%eb%a0%89%ec%85%98redirection/38877/#respond</comments>
		
		<dc:creator><![CDATA[lycos7560]]></dc:creator>
		<pubDate>Mon, 02 Dec 2024 10:23:17 +0000</pubDate>
				<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[awk]]></category>
		<category><![CDATA[command]]></category>
		<category><![CDATA[command chaining]]></category>
		<category><![CDATA[command filtering]]></category>
		<category><![CDATA[cut]]></category>
		<category><![CDATA[data processing]]></category>
		<category><![CDATA[data sorting]]></category>
		<category><![CDATA[error log]]></category>
		<category><![CDATA[error redirection]]></category>
		<category><![CDATA[file input]]></category>
		<category><![CDATA[file saving]]></category>
		<category><![CDATA[file sorting]]></category>
		<category><![CDATA[filter]]></category>
		<category><![CDATA[filter commands]]></category>
		<category><![CDATA[grep]]></category>
		<category><![CDATA[input redirection]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Linux basic commands]]></category>
		<category><![CDATA[Linux shell]]></category>
		<category><![CDATA[Linux shell commands]]></category>
		<category><![CDATA[Log Analysis]]></category>
		<category><![CDATA[log file]]></category>
		<category><![CDATA[log filtering]]></category>
		<category><![CDATA[output file]]></category>
		<category><![CDATA[output redirection]]></category>
		<category><![CDATA[pipe]]></category>
		<category><![CDATA[pipe usage]]></category>
		<category><![CDATA[pipeline]]></category>
		<category><![CDATA[pipeline usage]]></category>
		<category><![CDATA[Process Management]]></category>
		<category><![CDATA[real-time monitoring]]></category>
		<category><![CDATA[redirection]]></category>
		<category><![CDATA[redirection examples]]></category>
		<category><![CDATA[redirection usage]]></category>
		<category><![CDATA[sed]]></category>
		<category><![CDATA[shell commands]]></category>
		<category><![CDATA[shell scripting]]></category>
		<category><![CDATA[sort]]></category>
		<category><![CDATA[standard error]]></category>
		<category><![CDATA[standard output]]></category>
		<category><![CDATA[System Administration]]></category>
		<category><![CDATA[system automation]]></category>
		<category><![CDATA[System Monitoring]]></category>
		<category><![CDATA[system tuning]]></category>
		<category><![CDATA[tail]]></category>
		<category><![CDATA[text filtering]]></category>
		<category><![CDATA[text processing]]></category>
		<category><![CDATA[text transformation]]></category>
		<category><![CDATA[wc]]></category>
		<category><![CDATA[데이터 정렬]]></category>
		<category><![CDATA[데이터 처리]]></category>
		<category><![CDATA[로그 분석]]></category>
		<category><![CDATA[로그 파일]]></category>
		<category><![CDATA[로그 필터링]]></category>
		<category><![CDATA[리눅스]]></category>
		<category><![CDATA[리눅스 기본 명령어]]></category>
		<category><![CDATA[리눅스 셸]]></category>
		<category><![CDATA[리눅스 쉘]]></category>
		<category><![CDATA[리디렉션]]></category>
		<category><![CDATA[리디렉션 사용법]]></category>
		<category><![CDATA[리디렉션 연습]]></category>
		<category><![CDATA[리디렉션 예시]]></category>
		<category><![CDATA[명령어]]></category>
		<category><![CDATA[명령어 결합]]></category>
		<category><![CDATA[명령어 체인]]></category>
		<category><![CDATA[명령어 필터링]]></category>
		<category><![CDATA[쉘 명령어]]></category>
		<category><![CDATA[쉘 스크립팅]]></category>
		<category><![CDATA[시스템 관리]]></category>
		<category><![CDATA[시스템 모니터링]]></category>
		<category><![CDATA[시스템 자동화]]></category>
		<category><![CDATA[시스템 튜닝]]></category>
		<category><![CDATA[실시간 모니터링]]></category>
		<category><![CDATA[오류 로그]]></category>
		<category><![CDATA[오류 리디렉션]]></category>
		<category><![CDATA[우분투]]></category>
		<category><![CDATA[입력 리디렉션]]></category>
		<category><![CDATA[출력 리디렉션]]></category>
		<category><![CDATA[출력 파일]]></category>
		<category><![CDATA[텍스트 변환]]></category>
		<category><![CDATA[텍스트 처리]]></category>
		<category><![CDATA[텍스트 필터링]]></category>
		<category><![CDATA[파이프]]></category>
		<category><![CDATA[파이프 사용법]]></category>
		<category><![CDATA[파이프라인]]></category>
		<category><![CDATA[파이프라인 사용법]]></category>
		<category><![CDATA[파일 입력]]></category>
		<category><![CDATA[파일 저장]]></category>
		<category><![CDATA[파일 정렬]]></category>
		<category><![CDATA[표준 오류]]></category>
		<category><![CDATA[표준 출력]]></category>
		<category><![CDATA[프로세스 관리]]></category>
		<category><![CDATA[필터]]></category>
		<category><![CDATA[필터 명령어]]></category>
		<guid isPermaLink="false">https://lycos7560.com/?p=38877</guid>

					<description><![CDATA[<p>파이프(Pipe) 파이프(&#124;)는 하나의 명령어 출력을 다른 명령어의 입력으로 전달하는 역할 파이프는 명령어의 출력을 다른 명령어로 전달하는데 매우 유용하며, 이로 인해 복잡한 작업을 단순화할 수 있음 사용법 필터(Filter) 필터는 파이프와 함께 사용되며, 데이터를 수정하거나 변환하는 명령어 보통 출력된 데이터를 필터링하거나 변경할 때 사용 grep, awk, sed, sort, cut, tail, wc 등의 명령어가 필터에 해당 사용법 리디렉션(Redirection) 리디렉션은 명령어의 출력을 파일로 저장하거나, [&#8230;]</p>
<p>The post <a href="https://lycos7560.com/ubuntu/ubuntu-%ed%8c%8c%ec%9d%b4%ed%94%84pipe-%ed%95%84%ed%84%b0filter-%eb%a6%ac%eb%8b%a4%ec%9d%b4%eb%a0%89%ec%85%98redirection/38877/">Ubuntu – 파이프(Pipe)/필터(filter)/리다이렉션(redirection)</a> appeared first on <a href="https://lycos7560.com">어제와 내일의 나 그 사이의 이야기</a>.</p>
]]></description>
										<content:encoded><![CDATA[				<div class="wp-block-uagb-table-of-contents uagb-toc__align-left uagb-toc__columns-1  uagb-block-05896234      "
					data-scroll= "1"
					data-offset= "30"
					style=""
				>
				<div class="uagb-toc__wrap">
						<div class="uagb-toc__title">
							목차						</div>
																						<div class="uagb-toc__list-wrap ">
						<ol class="uagb-toc__list"><li class="uagb-toc__list"><a href="#파이프pipe" class="uagb-toc-link__trigger">파이프(Pipe)</a><ul class="uagb-toc__list"><li class="uagb-toc__list"><a href="#사용법" class="uagb-toc-link__trigger">사용법</a></li></ul></li><li class="uagb-toc__list"><a href="#필터filter" class="uagb-toc-link__trigger">필터(Filter)</a><ul class="uagb-toc__list"><li class="uagb-toc__list"><a href="#사용법" class="uagb-toc-link__trigger">사용법</a></li></ul></li></ul></li><li class="uagb-toc__list"><a href="#리디렉션redirection" class="uagb-toc-link__trigger">리디렉션(Redirection)</a><ul class="uagb-toc__list"><li class="uagb-toc__list"><a href="#출력-리디렉션" class="uagb-toc-link__trigger">출력 리디렉션</a><li class="uagb-toc__list"><li class="uagb-toc__list"><a href="#입력-리디렉션" class="uagb-toc-link__trigger">입력 리디렉션</a><li class="uagb-toc__list"><li class="uagb-toc__list"><a href="#표준-오류-리디렉션" class="uagb-toc-link__trigger">표준 오류 리디렉션</a><li class="uagb-toc__list"><li class="uagb-toc__list"><a href="#출력과-오류-모두-리디렉션" class="uagb-toc-link__trigger">출력과 오류 모두 리디렉션</a><li class="uagb-toc__list"><li class="uagb-toc__list"><a href="#파이프-필터-리디렉션을-결합-예시" class="uagb-toc-link__trigger">파이프, 필터, 리디렉션을 결합 예시</a></ul></ul></ul></ol>					</div>
									</div>
				</div>
			


<div style="height:50px" aria-hidden="true" class="wp-block-spacer"></div>



<h3 class="wp-block-heading"><strong>파이프(Pipe)</strong></h3>



<p>파이프(<code>|</code>)는 하나의 명령어 출력을 다른 명령어의 입력으로 전달하는 역할</p>



<p>파이프는 명령어의 출력을 다른 명령어로 전달하는데 매우 유용하며, 이로 인해 복잡한 작업을 단순화할 수 있음</p>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<h4 class="wp-block-heading"><strong>사용법</strong></h4>



<pre class="EnlighterJSRAW" data-enlighter-language="bash" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">
# command1은 먼저 실행되어 출력을 생성하고, 이 출력이 command2로 전달
command1 | command2
</pre>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<pre class="EnlighterJSRAW" data-enlighter-language="bash" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">
# ls 명령어로 디렉토리 목록을 출력하고, 그 결과를 less 명령어로 페이지 단위로 스크롤할 수 있게 만듬
ls -al | less
ls -al /etc | less</pre>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<pre class="EnlighterJSRAW" data-enlighter-language="bash" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">
# ps aux로 실행 중인 프로세스를 나열하고, 그 중에서 apache라는 단어가 포함된 항목만 필터링하여 출력
ps aux | grep apache
</pre>



<div style="height:50px" aria-hidden="true" class="wp-block-spacer"></div>



<h3 class="wp-block-heading"><strong><strong>필터(Filter)</strong></strong></h3>



<p>필터는 파이프와 함께 사용되며, 데이터를 수정하거나 변환하는 명령어</p>



<p>보통 출력된 데이터를 필터링하거나 변경할 때 사용</p>



<p><code>grep</code>, <code>awk</code>, <code>sed</code>, <code>sort</code>, <code>cut, tail, wc</code> 등의 명령어가 필터에 해당</p>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<h4 class="wp-block-heading">사용법</h4>



<ul class="wp-block-list">
<li><strong><code>grep</code></strong>: 패턴에 맞는 줄을 검색</li>
</ul>



<pre class="EnlighterJSRAW" data-enlighter-language="bash" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">
# file.txt에서 keyword를 포함하는 줄만 출력
cat file.txt | grep "keyword"

# ps -ef는 모든 프로세스 번호를 출력하므로 bash 라는 글자가 들어간 프로세스만 출력
ps -ef | grep bash</pre>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<ul class="wp-block-list">
<li><strong><code>awk</code></strong>: 파일을 특정 구분자로 나누어 처리</li>
</ul>



<pre class="EnlighterJSRAW" data-enlighter-language="bash" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">
# file.txt의 각 줄에서 첫 번째 열만 출력
cat file.txt | awk '{print $1}'
</pre>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<ul class="wp-block-list">
<li><strong><code>sort</code></strong>: 데이터를 정렬</li>
</ul>



<pre class="EnlighterJSRAW" data-enlighter-language="bash" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">
# 디렉토리 내 파일들을 알파벳 순으로 정렬하여 출력
ls | sort
</pre>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<ul class="wp-block-list">
<li><strong><code>cut</code></strong>: 텍스트를 구분자로 나누어 일부만 선택.</li>
</ul>



<pre class="EnlighterJSRAW" data-enlighter-language="bash" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">
# file.txt에서 공백을 기준으로 첫 번째 필드를 출력
cat file.txt | cut -d' ' -f1

</pre>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<ul class="wp-block-list">
<li><strong><code>sed</code></strong>: 텍스트 스트림을 수정(편집).</li>
</ul>



<pre class="EnlighterJSRAW" data-enlighter-language="bash" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">
# file.txt에서 old라는 단어를 new로 바꿔 출력
cat file.txt | sed 's/old/new/g'

</pre>



<div style="height:50px" aria-hidden="true" class="wp-block-spacer"></div>



<h3 class="wp-block-heading"><strong><strong><strong>리디렉션(Redirection)</strong></strong></strong></h3>



<p>리디렉션은 명령어의 출력을 파일로 저장하거나, 파일을 명령어의 입력으로 전달하는 기능</p>



<p>리디렉션은 <strong>출력 리디렉션</strong>과 <strong>입력 리디렉션</strong>으로 나눌 수 있음</p>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<h4 class="wp-block-heading"><strong>출력 리디렉션</strong></h4>



<p>출력 리디렉션은 명령어의 출력을 파일로 보낼 때 사용 <code>></code> 또는 <code>>></code>를 사용</p>



<ul class="wp-block-list">
<li><strong><code>></code></strong> 출력을 새로운 파일에 덮어쓰기</li>
</ul>



<pre class="EnlighterJSRAW" data-enlighter-language="bash" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">
# "Hello, World!"를 hello.txt라는 파일에 덮어씁니다.
echo "Hello, World!" > hello.txt
</pre>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<ul class="wp-block-list">
<li><strong><code>>></code></strong> 출력을 파일 끝에 추가</li>
</ul>



<pre class="EnlighterJSRAW" data-enlighter-language="bash" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">
# "New line"을 hello.txt 파일에 추가합니다.
echo "New line" >> hello.txt
</pre>



<div style="height:50px" aria-hidden="true" class="wp-block-spacer"></div>



<h4 class="wp-block-heading"><strong><strong>입력 리디렉션</strong></strong></h4>



<p>입력 리디렉션은 파일을 명령어의 입력으로 전달하는 데 사용 <code>&lt;</code> 기호를 사용</p>



<ul class="wp-block-list">
<li><strong><code>&lt;</code></strong>: 파일을 명령어의 입력으로 사용</li>
</ul>



<pre class="EnlighterJSRAW" data-enlighter-language="bash" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">
# file.txt의 내용을 정렬하여 출력
sort &lt; file.txt

# list.txt 파일을 정렬하고 out.txt에 쓰기
sort &lt; list.txt > out.txt
</pre>



<div style="height:50px" aria-hidden="true" class="wp-block-spacer"></div>



<h4 class="wp-block-heading"><strong><strong><strong>표준 오류 리디렉션</strong></strong></strong></h4>



<p>표준 오류를 파일로 리디렉션할 수 있습니다. <code>2></code> 또는 <code>2>></code>를 사용</p>



<ul class="wp-block-list">
<li><strong><code>2></code></strong>: 오류 출력을 파일로 리디렉션</li>
</ul>



<pre class="EnlighterJSRAW" data-enlighter-language="bash" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">
# 명령어의 오류 메시지를 error.log 파일에 저장
command 2> error.log
</pre>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<ul class="wp-block-list">
<li><strong><code>2>></code></strong>: 오류 출력을 파일 끝에 추가</li>
</ul>



<pre class="EnlighterJSRAW" data-enlighter-language="bash" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group=""># 명령어의 오류 메시지를 error.log 파일 끝에 저장
command 2>> error.log

</pre>



<div style="height:50px" aria-hidden="true" class="wp-block-spacer"></div>



<h4 class="wp-block-heading"><strong><strong><strong><strong>출력과 오류 모두 리디렉션</strong></strong></strong></strong></h4>



<p>출력과 오류를 모두 하나의 파일로 리디렉션</p>



<pre class="EnlighterJSRAW" data-enlighter-language="bash" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group=""># output.log 파일에 표준 출력과 표준 오류가 모두 기록
command > output.log 2>&amp;1
</pre>



<div style="height:50px" aria-hidden="true" class="wp-block-spacer"></div>



<h4 class="wp-block-heading"><strong><strong><strong><strong><strong>파이프, 필터, 리디렉션을 결합 예시</strong></strong></strong></strong></strong></h4>



<p>여러 명령어를 조합하여 복잡한 작업을 할 수 있습니다.</p>



<p>예를 들어, 특정 로그 파일에서 오류 메시지만 추출하여 정렬하고, 이를 파일로 저장할 수 있습니다.</p>



<pre class="EnlighterJSRAW" data-enlighter-language="bash" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">
# /var/log/syslog 파일에서 "error"라는 단어가 포함된 행을 찾고, 그 결과를 정렬하여 error_log.txt에 저장합니다.
cat /var/log/syslog | grep "error" | sort > error_log.txt

</pre>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<p></p>
<p>The post <a href="https://lycos7560.com/ubuntu/ubuntu-%ed%8c%8c%ec%9d%b4%ed%94%84pipe-%ed%95%84%ed%84%b0filter-%eb%a6%ac%eb%8b%a4%ec%9d%b4%eb%a0%89%ec%85%98redirection/38877/">Ubuntu – 파이프(Pipe)/필터(filter)/리다이렉션(redirection)</a> appeared first on <a href="https://lycos7560.com">어제와 내일의 나 그 사이의 이야기</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://lycos7560.com/ubuntu/ubuntu-%ed%8c%8c%ec%9d%b4%ed%94%84pipe-%ed%95%84%ed%84%b0filter-%eb%a6%ac%eb%8b%a4%ec%9d%b4%eb%a0%89%ec%85%98redirection/38877/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Ubuntu &#8211; Dummy File 더미 파일 생성</title>
		<link>https://lycos7560.com/ubuntu/ubuntu-dummy-file-%eb%8d%94%eb%af%b8-%ed%8c%8c%ec%9d%bc-%ec%83%9d%ec%84%b1/38818/</link>
					<comments>https://lycos7560.com/ubuntu/ubuntu-dummy-file-%eb%8d%94%eb%af%b8-%ed%8c%8c%ec%9d%bc-%ec%83%9d%ec%84%b1/38818/#respond</comments>
		
		<dc:creator><![CDATA[lycos7560]]></dc:creator>
		<pubDate>Sun, 01 Dec 2024 04:27:49 +0000</pubDate>
				<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[/dev/random]]></category>
		<category><![CDATA[/dev/urandom]]></category>
		<category><![CDATA[/dev/zero]]></category>
		<category><![CDATA[base64]]></category>
		<category><![CDATA[block size]]></category>
		<category><![CDATA[CPU load]]></category>
		<category><![CDATA[CPU 사용률]]></category>
		<category><![CDATA[data simulation]]></category>
		<category><![CDATA[data transfer]]></category>
		<category><![CDATA[data writing]]></category>
		<category><![CDATA[dd]]></category>
		<category><![CDATA[debugging tools]]></category>
		<category><![CDATA[disk space]]></category>
		<category><![CDATA[encryption testing]]></category>
		<category><![CDATA[entropy]]></category>
		<category><![CDATA[fallocate]]></category>
		<category><![CDATA[file allocation]]></category>
		<category><![CDATA[file generation]]></category>
		<category><![CDATA[file handling]]></category>
		<category><![CDATA[file manipulation]]></category>
		<category><![CDATA[file properties]]></category>
		<category><![CDATA[file system tools]]></category>
		<category><![CDATA[file transformation]]></category>
		<category><![CDATA[I/O operations]]></category>
		<category><![CDATA[Linux commands]]></category>
		<category><![CDATA[performance analysis]]></category>
		<category><![CDATA[random data]]></category>
		<category><![CDATA[random number generation]]></category>
		<category><![CDATA[resource usage]]></category>
		<category><![CDATA[shell commands]]></category>
		<category><![CDATA[storage allocation]]></category>
		<category><![CDATA[storage management]]></category>
		<category><![CDATA[system efficiency]]></category>
		<category><![CDATA[system utilities]]></category>
		<category><![CDATA[temporary files]]></category>
		<category><![CDATA[truncate]]></category>
		<category><![CDATA[zero-fill]]></category>
		<category><![CDATA[가상 데이터]]></category>
		<category><![CDATA[난수 생성]]></category>
		<category><![CDATA[대용량 파일 생성]]></category>
		<category><![CDATA[더미 파일]]></category>
		<category><![CDATA[데이터 생성]]></category>
		<category><![CDATA[데이터 암호화]]></category>
		<category><![CDATA[디스크 사용량]]></category>
		<category><![CDATA[디스크 성능 테스트]]></category>
		<category><![CDATA[디스크 할당]]></category>
		<category><![CDATA[랜덤 데이터 생성]]></category>
		<category><![CDATA[리디렉션]]></category>
		<category><![CDATA[무손실 압축]]></category>
		<category><![CDATA[무작위 데이터]]></category>
		<category><![CDATA[보안 시뮬레이션]]></category>
		<category><![CDATA[블록 크기]]></category>
		<category><![CDATA[성능 분석]]></category>
		<category><![CDATA[시스템 도구]]></category>
		<category><![CDATA[시스템 유지보수]]></category>
		<category><![CDATA[시스템 유틸리티]]></category>
		<category><![CDATA[시스템 진단]]></category>
		<category><![CDATA[시스템 효율성]]></category>
		<category><![CDATA[암호화 테스트]]></category>
		<category><![CDATA[엔트로피]]></category>
		<category><![CDATA[우분투]]></category>
		<category><![CDATA[유닉스 도구]]></category>
		<category><![CDATA[임시 파일 생성]]></category>
		<category><![CDATA[테스트 환경 준비]]></category>
		<category><![CDATA[텍스트 인코딩]]></category>
		<category><![CDATA[파이프라인]]></category>
		<category><![CDATA[파일 관리]]></category>
		<category><![CDATA[파일 모니터링]]></category>
		<category><![CDATA[파일 백업]]></category>
		<category><![CDATA[파일 변환]]></category>
		<category><![CDATA[파일 생성]]></category>
		<category><![CDATA[파일 속성]]></category>
		<category><![CDATA[파일 시스템 레벨 할당]]></category>
		<category><![CDATA[파일 전송]]></category>
		<category><![CDATA[파일 조작]]></category>
		<category><![CDATA[파일 크기]]></category>
		<category><![CDATA[파일 크기 조정]]></category>
		<category><![CDATA[파일 테스트]]></category>
		<category><![CDATA[파일 할당]]></category>
		<category><![CDATA[파일 효율성]]></category>
		<guid isPermaLink="false">https://lycos7560.com/?p=38818</guid>

					<description><![CDATA[<p>dd dd if=/dev/zero of=dd_dummy_file.img bs=500M count=1 dd: 유틸리티의 이름 if=/dev/zero: 입력 파일(input file)을 지정 of=dummy_file.img: 출력 파일(output file)을 지정, dummy_file.img라는 이름의 파일로 데이터를 기록 bs=1G: 블록 크기(block size)를 설정, 1GB 크기의 블록을 사용 count=1: 블록의 개수를 설정, 1개의 블록만 기록 fallocate -l 옵션은 생성할 파일의 크기를 지정 truncate base64 base64 /dev/urandom &#124; head -c 1G [&#8230;]</p>
<p>The post <a href="https://lycos7560.com/ubuntu/ubuntu-dummy-file-%eb%8d%94%eb%af%b8-%ed%8c%8c%ec%9d%bc-%ec%83%9d%ec%84%b1/38818/">Ubuntu &#8211; Dummy File 더미 파일 생성</a> appeared first on <a href="https://lycos7560.com">어제와 내일의 나 그 사이의 이야기</a>.</p>
]]></description>
										<content:encoded><![CDATA[				<div class="wp-block-uagb-table-of-contents uagb-toc__align-left uagb-toc__columns-1  uagb-block-f0fb0e78      "
					data-scroll= "1"
					data-offset= "30"
					style=""
				>
				<div class="uagb-toc__wrap">
						<div class="uagb-toc__title">
							목차						</div>
																						<div class="uagb-toc__list-wrap ">
						<ol class="uagb-toc__list"><li class="uagb-toc__list"><a href="#dd" class="uagb-toc-link__trigger">dd</a><li class="uagb-toc__list"><a href="#fallocate" class="uagb-toc-link__trigger">fallocate</a><li class="uagb-toc__list"><a href="#truncate" class="uagb-toc-link__trigger">truncate</a><li class="uagb-toc__list"><a href="#base64" class="uagb-toc-link__trigger">base64</a><li class="uagb-toc__list"><a href="#명령어-비교-표" class="uagb-toc-link__trigger">명령어 비교 표</a></ol>					</div>
									</div>
				</div>
			


<div style="height:50px" aria-hidden="true" class="wp-block-spacer"></div>



<h4 class="wp-block-heading">dd</h4>



<pre class="EnlighterJSRAW" data-enlighter-language="bash" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group=""># 1GB 크기의 더미 파일 생성 (img는 임시)
dd if=/dev/zero of=dd_dummy_file.img bs=1G count=1

# 500MB 크기의 더미 파일 생성 (img는 임시)
dd if=/dev/zero of=dd_dummy_file.img bs=500M count=1</pre>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<p><strong>dd if=/dev/zero of=dd_dummy_file.img bs=500M count=1</strong></p>



<p><code>dd</code>: 유틸리티의 이름</p>



<p><code>if=/dev/zero</code>: 입력 파일(input file)을 지정</p>



<ul class="wp-block-list">
<li><code>/dev/zero</code> 무한히 0을 생성하는 특수 파일</li>



<li><code>/dev/urandom</code> 넌블로킹 방식으로 빠르게 무작위 데이터를 생성</li>



<li><code>/dev/random</code> 고품질의 무작위 데이터를 생성하지만, 엔트로피가 부족할 경우 출력이 지연</li>
</ul>



<p><code>of=dummy_file.img</code>: 출력 파일(output file)을 지정, <code>dummy_file.img</code>라는 이름의 파일로 데이터를 기록</p>



<p><code>bs=1G</code>: 블록 크기(block size)를 설정, 1GB 크기의 블록을 사용</p>



<p><code>count=1</code>: 블록의 개수를 설정, 1개의 블록만 기록</p>



<figure class="wp-block-image size-full"><img fetchpriority="high" decoding="async" width="807" height="554" src="https://lycos7560.com/wp-content/uploads/2024/12/image.png" alt="" class="wp-image-38819" srcset="https://lycos7560.com/wp-content/uploads/2024/12/image.png 807w, https://lycos7560.com/wp-content/uploads/2024/12/image-300x206.png 300w, https://lycos7560.com/wp-content/uploads/2024/12/image-768x527.png 768w" sizes="(max-width: 807px) 100vw, 807px" /></figure>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<h4 class="wp-block-heading">fallocate</h4>



<pre class="EnlighterJSRAW" data-enlighter-language="bash" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group=""># 1GB 크기의 더미 파일 생성 (img는 임시)
fallocate -l 1G fallocate_dummy_file.img

# 500MB 크기의 더미 파일 생성 (img는 임시)
fallocate -l 500M fallocate_dummy_file.img</pre>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<p><code>-l</code> 옵션은 생성할 파일의 <strong>크기</strong>를 지정</p>



<figure class="wp-block-image size-full"><img decoding="async" width="828" height="556" src="https://lycos7560.com/wp-content/uploads/2024/12/image-1.png" alt="" class="wp-image-38820" srcset="https://lycos7560.com/wp-content/uploads/2024/12/image-1.png 828w, https://lycos7560.com/wp-content/uploads/2024/12/image-1-300x201.png 300w, https://lycos7560.com/wp-content/uploads/2024/12/image-1-768x516.png 768w" sizes="(max-width: 828px) 100vw, 828px" /></figure>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<h4 class="wp-block-heading">truncate</h4>



<pre class="EnlighterJSRAW" data-enlighter-language="bash" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group=""># 1GB 크기의 더미 파일 생성 (img는 임시)
truncate -s 1G dummy_file.img</pre>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-image size-full"><img decoding="async" width="823" height="599" src="https://lycos7560.com/wp-content/uploads/2024/12/image-2.png" alt="" class="wp-image-38821" srcset="https://lycos7560.com/wp-content/uploads/2024/12/image-2.png 823w, https://lycos7560.com/wp-content/uploads/2024/12/image-2-300x218.png 300w, https://lycos7560.com/wp-content/uploads/2024/12/image-2-768x559.png 768w" sizes="(max-width: 823px) 100vw, 823px" /></figure>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<h4 class="wp-block-heading">base64</h4>



<pre class="EnlighterJSRAW" data-enlighter-language="bash" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group=""># 1GB 크기의 더미 파일 생성 (img는 임시)
base64 /dev/urandom | head -c 1G > dummy_file.img</pre>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-image size-full"><img decoding="async" width="990" height="611" src="https://lycos7560.com/wp-content/uploads/2024/12/image-3.png" alt="" class="wp-image-38822" srcset="https://lycos7560.com/wp-content/uploads/2024/12/image-3.png 990w, https://lycos7560.com/wp-content/uploads/2024/12/image-3-300x185.png 300w, https://lycos7560.com/wp-content/uploads/2024/12/image-3-768x474.png 768w" sizes="(max-width: 990px) 100vw, 990px" /></figure>



<p><strong>base64 /dev/urandom | head -c 1G &gt; dummy_file.img</strong></p>



<p>\<code>base64 /dev/urandom</code>:</p>



<ul class="wp-block-list">
<li><code>/dev/zero</code> 무한히 0을 생성하는 특수 파일</li>



<li><code>/dev/random</code> 넌블로킹 방식으로 빠르게 무작위 데이터를 생성</li>



<li><code>/dev/urandom</code> 고품질의 무작위 데이터를 생성하지만, 엔트로피가 부족할 경우 출력이 지연</li>
</ul>



<p><code>base64</code>: 무작위 데이터를 base64 인코딩 형식으로 변환</p>



<p>base64 인코딩은 이진 데이터를 텍스트 형식으로 인코딩</p>



<p><code>|</code><strong> (파이프라인)</strong>:</p>



<ul class="wp-block-list">
<li>파이프라인(<code>|</code>)을 사용하여 첫 번째 명령어의 출력을 다음 명령어의 입력으로 전달</li>
</ul>



<p><code>head -c 1G</code>:</p>



<ul class="wp-block-list">
<li><code>head</code>: 파일의 처음 부분을 출력하는 명령어</li>



<li><code>-c 1G</code>: 1GB(기가바이트) 크기의 데이터를 읽어옵니다. 여기서 <code>1G</code>는 1GB를 의미</li>
</ul>



<p><code>&gt;</code><strong> (리디렉션)</strong>:</p>



<ul class="wp-block-list">
<li><code>&gt;</code> 기호는 명령어의 출력을 파일로 리디렉션, 기존 파일을 덮어쓰는 방식</li>
</ul>



<p><code>dummy_file.img</code>:</p>



<ul class="wp-block-list">
<li>출력 데이터를 저장할 파일 이름입니다. 여기서는 <code>dummy_file.img</code>라는 이름의 파일로 데이터를 저장</li>
</ul>



<div style="height:50px" aria-hidden="true" class="wp-block-spacer"></div>



<h4 class="wp-block-heading">명령어 비교 표</h4>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th>도구</th><th>특징</th><th>장점</th><th>단점</th><th>성능</th><th>용도</th></tr></thead><tbody><tr><td><strong>dd</strong></td><td>전통적인 유닉스 도구, 저수준 블록 복사</td><td>&#8211; 높은 호환성<br>&#8211; 다양한 입출력 옵션<br>&#8211; 시스템 전반에 걸쳐 안정적</td><td>&#8211; 상대적으로 느림<br>&#8211; 리소스 사용량 높음</td><td>중간</td><td>시스템 진단<br>대용량 파일 생성<br>디스크 성능 테스트</td></tr><tr><td><strong>fallocate</strong></td><td>파일 시스템 레벨 할당</td><td>&#8211; <strong>가장 빠른 방식</strong><br>&#8211; 최소 시스템 리소스 사용<br>&#8211; 실제 디스크 공간 즉시 할당</td><td>&#8211; 일부 파일 시스템에서 미지원<br>&#8211; <strong>실제 데이터 미기록</strong></td><td>매우 빠름</td><td>빠른 대용량 파일 생성<br>테스트 환경 준비</td></tr><tr><td><strong>truncate</strong></td><td>파일 크기 조작에 특화</td><td>&#8211; 매우 간단한 명령어<br>&#8211; 최소 시스템 오버헤드<br>&#8211; 빠른 실행</td><td>&#8211; <strong>실제 데이터 없음</strong><br>&#8211; 일부 제한된 옵션</td><td>빠름</td><td>빠른 파일 크기 조정<br>임시 파일 생성</td></tr><tr><td><strong>base64</strong></td><td>랜덤 데이터 생성</td><td>&#8211; 실제 랜덤 데이터 생성<br>&#8211; <strong>암호화된 데이터 유사</strong></td><td>&#8211; 생성 속도 느림<br>&#8211; 높은 CPU 사용률<br>&#8211; 대용량 파일에 비효율적</td><td>느림</td><td>암호화 테스트<br>랜덤 데이터 필요 시<br>보안 관련 시뮬레이션</td></tr></tbody></table></figure>



<p></p>
<p>The post <a href="https://lycos7560.com/ubuntu/ubuntu-dummy-file-%eb%8d%94%eb%af%b8-%ed%8c%8c%ec%9d%bc-%ec%83%9d%ec%84%b1/38818/">Ubuntu &#8211; Dummy File 더미 파일 생성</a> appeared first on <a href="https://lycos7560.com">어제와 내일의 나 그 사이의 이야기</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://lycos7560.com/ubuntu/ubuntu-dummy-file-%eb%8d%94%eb%af%b8-%ed%8c%8c%ec%9d%bc-%ec%83%9d%ec%84%b1/38818/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
