본문 바로가기

Ubuntu/linux Command

Linux Basic Command (echo)

728x90

개요 : 인수로 전달되는 텍스트 / 문자열을 표시하는 데 사용. 이 명령어는 쉘 스크립트와 배치 파일에서 주로 현재 상태를 화면이나 파일로 출력하는데 사용되는 내장 명령어

 

 

용례1 : echo [문자열]

   echo "web makes the workd better"

   

 

용례2echo -e "web \nmakes \nthe \nworkd \nbetter"

   -e : enable interpretation of backslash escapes 

 

 

용례3: echo "aaaa" >> test.txt 

   >> : append "aaaa" to the last part of the test.txt

 

 

용례4 : echo "cccc" > test.txt

   > :  crete test.txt with "cccc" by overwriting it 

 

 

용례5 : echo $PATH

  환경변수 $PATH 출력

 

'Ubuntu > linux Command' 카테고리의 다른 글

Linux Basic Command (mkdir/rmdir)  (0) 2021.08.05
Linux Basic Command (cd)  (0) 2021.08.05
Linux Basic Command (clear)  (0) 2021.08.04
Linux Basic Command (which)  (0) 2021.08.04
Linux Basic Command (head/tail)  (0) 2021.08.04