본문 바로가기

Shell 과 CLI 명령어 요약 정리

by ds31x 2023. 10. 2.
728x90
반응형

Linux shells since 1977. ref.: https://developer.ibm.com/tutorials/l-linux-shells/

Shell 이란?

https://dsaint31.me/mkdocs_site/OS/console_terminal_shell_kernel/?h=shell#shell

 

BME

Console, Terminal, and Shell Console: 컴퓨터(주로 서버)에 command를 작성하여 입력하고 그 결과를 확인할 수 있는 (물리적) 입출력 장치 . Terminal과 비슷한 의미를 가지고 있으나 보다 물리적인 측면이 강

dsaint31.me

 

다음의 기사 글을 한번 읽어보길 권함:

https://developer.ibm.com/tutorials/l-linux-shells/

 


Bash (GNU Bourne-Again Shell)

Bourne Shell(sh, 1977 등장) 를 계승하여 현대적으로 확장한 Shell: Brian Fox가 1989년 공개(GNU Project)함.


기본 명령어들

2024.05.20 - [Linux/shell] - [Bash] File과 directory 관련 command

 

[Bash] File과 directory 관련 command

Bash에서 파일과 디렉토리 관련 명령어 튜토리얼이 문서는 비어있는 디렉토리에서 시작하여 파일과 디렉토리를 생성하고, 삭제하는 과정을 단계별로 설명하는 일종의 튜토리얼임. terminal에서 각

ds31x.tistory.com

2023.09.30 - [Linux] - [Linux] 파일 내용확인하기: cat, bat, less, more, head, tail

 

[Linux] 파일 내용확인하기: cat, bat, less, more, head, tail

cat, bat, head, tail대표적인 text processing utilities로 file viewing commands라고도 불림.less, morepager라고 불리는 utilities로 긴 출력을 화면에 페이지 단위로 나누어 보여주는 역할을 수행함.cat, batcat (concatenate

ds31x.tistory.com

2024.05.11 - [Linux] - [linux] find 사용법.

 

[linux] find 사용법.

find 명령어 사용법find 명령어는 UNIX 및 Linux 기반 시스템에서파일이나 디렉토리를 검색할 때 사용하는 S/W.이 명령어는 지정된 "[검색 시작 경로]"에서부터 파일 시스템을 순회하며주어진 조건에

ds31x.tistory.com

https://dsaint31.tistory.com/234

 

[Linux] ps 명령어

linux에서 현재 동작하고 있는 process들에 대한 정보(목록 및 상태)를 보여줌.ps auxBSD 형식으로 현재 동작하고 있는 모든 프로세스에 대한 아래의 정보를 출력함.a : BSD 계열 옵션으로 터미널에 연관

dsaint31.tistory.com


Shell Initialization File

2026.01.02 - [shell] - Shell Initialization File-dot files: .profile, .bashrc, .zprofile, .zshrc

 

Shell Initialization File-dot files: .profile, .bashrc, .zprofile, .zshrc

Shell initialization file들은 리눅스와 맥(macOS)에서 쉘(Shell) 설정 파일들을 가리킴.주로 dot(닷) . 으로 시작하기 때문에 dotfiles라고도 불림.Linux나 macOS에서 숨김파일은 dot으로 시작하는 이름을 가짐. st

ds31x.tistory.com


Shell script file 의 작성

Shell programming은 명령 실행과 제어를 자동화하기 위해 shell script 파일을 작성하는 작업이라고 볼 수 있다.
관리자의 경우 간단한 작업은 shell로 처리하지만, 복잡한 로직이나 확장이 필요한 경우에는 Python과 같은 고급 프로그래밍 언어를 사용하는 사례도 점점 늘고 있다.

첫번째 라인 (shebang line) 작성법 : env 사용하기

2023.06.20 - [개발환경] - [Shell] env and Shebang line

 

[Shell] env and Shebang line

Envenv 명령어는 주로environment variable들을 확인하거나특정 명령어 수행할 때 특정 environment variable을 지정해주는데 사용된다.The env command allows youto display your current environment or run a specified commandin a c

ds31x.tistory.com

변수 설정 반복 구문 작성하기

2023.07.19 - [개발환경] - [bash] shell 기본 : 변수 설정 및 반복구문

 

[Bash] shell 기본 : 변수 설정 및 반복구문

shell script란shell에서 동작하는 script로,여러 command 들을 하나의 파일로 저장하고 해당 파일을 line별로 interpreting하여 수행시킬 수 있게 해주는 것을 가르킴.(.py파일이 python interptreter에 의해 동작하

ds31x.tistory.com

조건문 작성하기

2025.07.25 - [shell] - Shell Script Conditionals(조건문)-test, [], [[]],(())

 

Shell Script Conditionals(조건문)-test, [], [[]],(())

위의 그림은 가장 많이 애용되는 Extended Conditionals 를 정리(Bash 기준)한 것임. 이외에도 셸 스크립트에서 조건을 검사할 때는 test 또는 다양한 괄호 구문을 사용함 . 대표적으로 다음 네 가지 방법

ds31x.tistory.com

함수 작성하고 호출하기

2025.07.25 - [shell] - Shell 함수 기본: bash, zsh에서 함수 사용하기

 

Shell 함수 기본: bash, zsh에서 함수 사용하기

Shell 함수 기본: bash, zsh에서 함수 사용하기Shell Script(bash나 zsh)에서 함수를 정의하고 사용하는 것은,복잡한 작업을 반복하지 않게 해주는 아주 유용한 방법임. Function 은 재사용가능한 코드의 묶

ds31x.tistory.com

 


Shell Expansion : Shell 이 다루는 문자열을 이해하기.

2026.01.11 - [shell] - Shell Expansion: Brace Expansion, Tilde Expansion, Variable Expansion, Command Substitution, Arithmetic Expansion, Filed Splitting, Globbing

 

Shell Expansion: Brace Expansion, Tilde Expansion, Variable Expansion, Command Substitution, Arithmetic Expansion, Filed Splitti

시작하기Shell(bash, zsh 등)은 사용자가 입력한 문자열을 바로 실행하지 않는다.먼저 언어 처리 파이프라인을 거쳐문자열을 실제 실행 인자 목록으로 변환한 뒤 실행함.POSIX / bash에서 정의된 처리

ds31x.tistory.com


여러 명령어를 연결 하기

2023.09.12 - [Linux] - [Linux] Pipe와 다중 명령어

 

[Linux] Pipe(|)와 다중 명령어 (;, &&, ||)

| : PipePipe |는 2개의 processes를 연결해주는 연결 통로로서pipe 앞의 프로세스의 stdout(표준출력)이pipe 뒤의 프로세스의 stdin(표준입력)으로 쓰이도록 연결해주는 것임. 예를 들어 ls|sort|more의 경우 ls

ds31x.tistory.com

 

2023.10.02 - [Linux] - [Bash] 입출력 목적지 변경하기 : Redirection Operation

 

[Bash] 입출력 목적지 변경하기 : Redirection Operation

stdout (표준출력, 1), sdtin(표준입력, 0), stderr(표준에러, 2)을 redirection하는 방법에 대한 문서서버에서 백그라운드로 명령어 수행시 출력이나 error 메시지 등을 stdout이 아닌 file에 남길 때 유용.redirec

ds31x.tistory.com


Zsh

zsh(Z Shell)는 Bourne 계열 셸과 호환되면서도,
강력한 자동 완성·프롬프트 커스터마이징·스크립팅 기능을 제공하는 현대적인 유닉스 셸임.

 

bash가 서버에서 주로 사용된다면, zsh은 macOS와 개인용 Linux장비에서 많이 애용됨.


2023.09.08 - [Linux] - [zsh] 사용자 Shell 확인 및 변경하기.

 

[zsh] 사용자 Shell 확인 및 변경하기.

사실 linux를 따로 배운 적이 없이, 업무 중에 조금씩 익혀나간터라...무엇이 가장 권장되는 방법인지는 자신이 없다. ==;;가장 쉬운 방법은 환경변수 SHELL을 확인하는 것임.echo ${SHELL}환경변수가 아

ds31x.tistory.com

 

2023.09.11 - [Linux] - [zsh] install Zsh and oh-my-zsh:

 

[zsh] install Zsh and oh-my-zsh:

Zsh 란?Zsh는 1990년에 출시된 유닉스 셸 및 명령어 인터프리터:bash, ksh, tcsh 등 다른 셸의 가장 유용한 기능들을 통합하고 풍부한 테마와 플러그인 생태계를 통해 강력한 사용자 경험을 제공.특히

ds31x.tistory.com


Shell Initialization File

2026.01.02 - [shell] - Shell Initialization File-dot files: .profile, .bashrc, .zprofile, .zshrc

 

Shell Initialization File-dot files: .profile, .bashrc, .zprofile, .zshrc

Shell initialization file들은 리눅스와 맥(macOS)에서 쉘(Shell) 설정 파일들을 가리킴.주로 dot(닷) . 으로 시작하기 때문에 dotfiles라고도 불림.Linux나 macOS에서 숨김파일은 dot으로 시작하는 이름을 가짐. st

ds31x.tistory.com

 


Command Prompt와 Windows PowerShell

  • Command Prompt (cmd.exe):
    • MS-DOS 계열을 계승한 Windows의 전통적인 텍스트 기반 명령 인터프리터 
    • 단순한 명령 실행과 배치 파일(.bat) 처리에 주로 사용된다.
  • Windows PowerShell (powershell.exe):
    • .NET 기반의 객체 지향 명령줄 셸 및 스크립팅 환경 
    • 시스템 관리와 자동화를 위해 설계된 Windows 전용 PowerShell 5.1까지의 구현: powershell.exe
    • 이후 버전은 PowerShell 이라고 불리며 Windows와 분리됨: 별도 설치 필요: pwsh

기본 명령어들

2024.05.20 - [utils/cmd and powershell] - [cmd] command prompt 연습하기 (file, dir 사용하기)

 

[cmd] command prompt 연습하기 (file, dir 사용하기)

CMD 프롬프트 기초 튜토리얼: 파일 및 디렉토리 다루기1. CMD 프롬프트 열기Windows 키 + R을 눌러 실행 창을 엽니다.cmd를 입력하고 Enter를 누릅니다.기본적으로 현재 User의 home 디렉토리를 cwd (current wo

ds31x.tistory.com

 

2025.12.31 - [utils/cmd and powershell] - Windows PowerShell 명령어 (기본): PowerShell 5.x

 

Windows PowerShell 명령어 (기본): PowerShell 5.x

5.x 라고 했으나, MS사가 Windows PowerShell의 버전을 동결하고 이후의 버전은 PowerShell 6+ (현재의 Major version은 7임)로 분리한 상태임.기능 개선이 되어야 minor version이 올라가는데, Windows버전 향상이나

ds31x.tistory.com


Initialization Files

2025.12.31 - [shell] - PowerShell의 초기화-profile

 

PowerShell의 초기화-profile

PowerShell의 profile이란?PowerShell의 profile은셸이 시작될 때 자동으로 실행되어환경 변수, alias, 함수, 초기화 코드 등을 설정하는시작 스크립트(확장자 .ps1 파일).PowerShell은 상황에 따라 서로 다른 prof

ds31x.tistory.com

Command Prompt에는

  • PowerShell의 profile과 같은 공식 개념은 없으며,
  • 대신 AutoRun 레지스트리를 통해 시작 시 명령을 자동 실행할 수 있음: clink등이 이용하는 방식

실무에선 powershell의 profile을 주로 이용함.


기타 등등

2025.12.26 - [CE] - Gemini CLI와 함께하는 터미널(CLI) 명령어 학습하기

 

Gemini CLI와 함께하는 터미널(CLI) 명령어 학습하기

이 문서에선 Windows CMD와 macOS Zsh 환경에서초보자가 터미널 명령어(CLI)를 익히는 과정을 돕기 위해 개인 AI 조교(Gemini CLI) 를 설정하고 활용하는 방법을 다룸. 이 튜토리얼을 통해 여러분은 Gemini CLI

ds31x.tistory.com

 

 

728x90