Search

Stream

"Hi?"output 파일에 덮어쓰기
echo "Hi?" > output
Shell
복사
input 파일 내용을 cat으로 읽어서 출력
cat < input
Shell
복사
오류 메시지만 error 파일에 저장
curl http://definitely.not.exists 2> error
Shell
복사
모든 메시지를 한 파일에 저장
curl http://definitely.not.exists &> output_and_error
Shell
복사
"More Content!"output 파일 뒤에 추가
echo "More Content!" >> output
Shell
복사
문자열을 직접 stdin으로 주는 방법
cat <<< "Inject directly!"
Shell
복사
멀티라인 문자열을 stdin으로 전달 (Here Document)
cat <<EOF Hello, world! This is multiline string! EOF
Shell
복사
멀티라인 문자열을 파일에 저장
cat << Done > output You can also output to this multiline string Done
Shell
복사