셸 치트시트
검색 및 인쇄 가능한 Bash / 셸 레퍼런스: 탐색, 파일, 파이프, 변수, 반복문, 조건문, 유용한 원라이너. 무료.
Navigation
8pwd
Print the working directory
ls -la
List all files with details
cd /path
Change directory
cd -
Go to the previous directory
cd ~
Go to the home directory
tree -L 2
Show directory tree (2 levels)
pushd / popd
Push and pop the directory stack
ls -lhS
List by size, human-readable
Files & directories
10touch file.txt
Create an empty file
mkdir -p a/b/c
Create nested directories
cp -r src dest
Copy recursively
mv old new
Move or rename
rm -rf dir
Remove recursively (careful!)
ln -s target link
Create a symbolic link
cat file.txt
Print file contents
head -n 20 / tail -n 20
First / last 20 lines
tail -f log.txt
Follow a file as it grows
less file.txt
Page through a file
Search & find
8grep 'pattern' file
Search for a pattern in a file
grep -rin 'text' .
Recursive, case-insensitive, numbered
find . -name '*.php'
Find files by name
find . -type f -mtime -1
Files modified in the last day
find . -size +10M
Files larger than 10 MB
which node
Locate an executable
locate file.txt
Find by indexed database
grep -v 'skip' file
Invert match (exclude lines)
Text processing
9wc -l file
Count lines
sort file | uniq -c
Sort then count duplicates
cut -d',' -f1 file
Extract a CSV column
awk '{print $1}' file
Print the first field
sed 's/old/new/g' file
Substitute text
tr 'a-z' 'A-Z'
Translate characters
diff a.txt b.txt
Compare two files
tee out.txt
Write to a file and stdout
xargs -I{} cmd {}
Build commands from input
Pipes & redirection
9a | b
Pipe output of a into b
cmd > file
Redirect stdout (overwrite)
cmd >> file
Redirect stdout (append)
cmd 2> err.log
Redirect stderr
cmd > out 2>&1
Redirect both streams
cmd < input.txt
Read stdin from a file
cmd1 && cmd2
Run cmd2 only if cmd1 succeeds
cmd1 || cmd2
Run cmd2 only if cmd1 fails
cmd &
Run in the background
Permissions & ownership
8chmod 755 file
Set rwx for owner, rx for others
chmod +x script.sh
Make a file executable
chmod -R 644 dir
Recursive permission change
chown user:group file
Change owner and group
umask 022
Default permission mask
sudo cmd
Run a command as root
stat file
Show file metadata
ls -l file
View permission bits
Processes & system
9ps aux
List running processes
top / htop
Live process monitor
kill -9 PID
Force-kill a process
pkill -f name
Kill processes by name
jobs / fg / bg
Manage background jobs
df -h
Disk space usage
du -sh dir
Size of a directory
free -h
Memory usage
uname -a
System and kernel info
Variables & expansion
9NAME='value'
Set a variable (no spaces)
echo \"$NAME\"
Use a variable
export PATH=\"$PATH:/x\"
Export to child processes
$(command)
Command substitution
${VAR:-default}
Default if unset
$1 $2 $@
Script positional arguments
$?
Exit status of the last command
read -p 'Name: ' x
Read user input
echo {1..5}
Brace expansion
Scripting
9#!/usr/bin/env bash
Shebang line
set -euo pipefail
Safer strict mode
if [ -f file ]; then ...; fi
Conditional on a file test
[ \"$a\" = \"$b\" ]
String comparison
for f in *.txt; do ...; done
Loop over files
while read line; do ...; done < file
Read a file line by line
case \"$x\" in a) ...;; esac
Multi-way branch
function greet() { echo hi; }
Define a function
trap cleanup EXIT
Run a handler on exit
“:q”와 일치하는 항목이 없습니다.
셸 치트시트 소개
이 Bash 및 셸 치트시트는 명령줄의 첫걸음부터 스크립팅까지 다룹니다: 탐색, 파일과 디렉터리, 검색과 찾기, 텍스트 처리, 파이프와 리다이렉션, 권한과 소유권, 프로세스와 시스템 정보, 변수와 확장, 셸 스크립팅 구문까지 포함합니다.
ls, cp, grep, find, chmod, ps 같은 일상적인 명령어를 유용하게 만드는 플래그와 함께 다루며, 단일 명령을 한 줄짜리 조합으로 바꿔주는 파이프, 리다이렉션, 확장 구문도 담았습니다. 스크립팅 섹션은 일 년에 한두 번 스크립트를 작성할 때 잊어버리는 반복문, 조건문, 함수 구문을 다시 떠올리게 해줍니다.
모든 내용이 무료 클라이언트 사이드 한 페이지에 담겨 있습니다: 검색으로 행을 실시간으로 필터링하고, 고정된 목차로 섹션 간을 이동하고, 클릭 한 번으로 명령어를 복사하며, 인쇄 버튼으로 책상용 터미널 참고 자료를 만들 수 있습니다.
셸 치트시트 사용 방법
- 탐색, 파일 및 디렉터리부터 파이프 및 리다이렉션, 스크립팅까지 섹션을 둘러보세요.
- grep나 chmod 같은 명령어 이름을 검색창에 입력해 시트를 즉시 필터링하세요.
- 고정된 사이드바를 통해 텍스트 처리 같은 섹션으로 바로 이동하세요.
- 명령어나 복사 아이콘을 클릭해 복사한 다음 터미널에 붙여넣으세요.
- 오프라인 Bash 명령어 참고 자료로 페이지를 인쇄하세요.
자주 묻는 질문
이 시트는 Bash 및 POSIX 계열 셸을 기준으로 작성되어, Linux와 macOS의 bash, zsh 및 유사 셸에서 거의 그대로 동작합니다.
둘 다 포함합니다. 파일, 검색, 텍스트 처리, 프로세스 명령어와 함께, 변수와 확장 그리고 스크립팅 구문 (반복문, 조건문, 스크립트 사이에 잊어버리는 문법) 을 다루는 전용 섹션이 있습니다.
네. 명령어나 해당 행의 복사 아이콘을 클릭하면 클립보드에 저장되어 바로 터미널에 붙여넣을 수 있습니다.
특히 rm, 권한, 리다이렉션이 관련된 명령어는 실행 전에 항상 확인하세요. 각 행에는 명령어가 정확히 무엇을 하는지 한 줄 설명이 포함되어 있습니다.
네, 완전히 무료입니다: 계정도 필요 없고 제한도 없는 클라이언트 사이드 참고 페이지입니다.
인기 검색어
리눅스 명령어 치트시트
bash 치트시트
쉘 명령어 목록
grep find 사용 예시
bash 스크립트 참고자료
chmod 권한 치트시트
bash 파이프와 리다이렉션
터미널 명령어 목록
도움이 필요하신가요?
이 도구에서 문제를 발견하셨나요? 저희 팀에 알려주세요.