Linux
-
shell commandLinux 2024. 4. 25. 17:32
1. RedirectionCommunication channelsRedirectioncharacters의미STDIN00입력을 키보드가 아닌 파일을 통해받음STDOUT1>1>>표준 출력을 터미널이아닌 파일로 출력STDERR2>2>>표준 에러출력을 터미널이 아닌 파일로 출력 * 0과 1은 생략가능 1) > (Output Redirection) 해당 파일이 이미 존재하면, >는 해당 파일을 덮어쓰고 존재하지않으면 새로운 파일 생성2) >> (Appending Output Redirection) 해당 파일이 이미 존재하면, >>는 기존 파일의 끝에 내용을 추가 2. Pipeline명령의 실행결과를 다음 명령의 입력으로 전달기호 : command1 | ..
-
bash shell RulesLinux 2024. 4. 25. 16:03
1. Metacharacters: shell에서 특별히 의미를 정해 놓은 문자들- \ ? () $ ... * % {} [] 등 ex) echo * : 현재 디렉토리 전체표시 echo ??? : 현재디렉토리에서 3글자인 목록 출력[test@localhost ~]$ lsdate.txt message.txt 공개 문서 비디오 서식hello222.txt test 다운로드 바탕화면 사진 음악[test@localhost ~]$ echo *date.txt hello222.txt message.txt test 공개 다운로드 문서 바탕화면 비디오 사진 서식 음악[test@localhost ~]$ echo ????test 다운로드 바탕화면 2. Quoiti..
-
shell 변수Linux 2024. 4. 25. 13:47
다른 프로그래밍 언어와 달리 변수를 선언하지 않아도 알아서 만들어진다.( 문자를 사용하면 문자형변수, 정수를 사용하면 정수형변수) 1. shell 일반변수 1) 변수 선언 : 변수명=값 (* blank가 있으면 안됨) (※변수는 항상 덮어쓰기 된다.)[test@localhost ~]$ lname=kim 2) 변수확인 : set (환경변수, 일반변수 등 모든변수 출력)[test@localhost ~]$ set | grep lnamelname=kim[test@localhost ~]$ echo $lnamekim 3) 변수삭제 : unset 변수명[test@localhost ~]$ unset lname[test@localhost ~]$ echo $lname 2. sh..
-
shellLinux 2024. 4. 25. 11:26
shell: 사용자 명령어 해석기 (사용자가 프롬포트에 입력한 명령을 해석해 운영체제 커널에 전달해주는 역할) 종류Bourne shell (sh)original shellC Shell (csh, tcsh)C언어의 기술을 넣어서 만든 ShellKorn shell (ksh)기존 bourne shell에 C shell기능을 포함시켜 생성Bourne-again shell (bash)csh,ksh 이 가진 기능을 포함하면서 bourne shell과 호환성을 많이 높인 shell(* 리눅스 ,MAC OS의 기본 shell) 사용가능한 쉘 확인[TEST@localhost ~]$ cat /etc/shells/bin/sh/bin/bash/usr/bin/sh/usr/bin/bash/bin/tcsh/bin/csh 지금 ..