exa 치트시트
설치
| 플랫폼 | 명령어 |
|---|
| Ubuntu 20.10+ | sudo apt update && sudo apt install exa |
| Debian/Ubuntu (older) | cargo install exa |
| Arch Linux | sudo pacman -S exa |
| Fedora | sudo dnf install exa |
| RHEL/CentOS | sudo dnf install epel-release && sudo dnf install exa |
| openSUSE | sudo zypper install exa |
| macOS (Homebrew) | brew install exa |
| macOS (MacPorts) | sudo port install exa |
| Windows (Scoop) | scoop install exa |
| Universal (Cargo) | cargo install exa |
exa --version
기본 명령어
| 명령어 | 설명 |
|---|
exa | List files in current directory (replaces ls) |
exa -l | 권한, 크기, 타임스탬프가 포함된 긴 형식 |
exa -a | Show all files including hidden (. files) |
exa -la | 숨겨진 파일을 포함한 모든 파일의 긴 형식 |
exa -lh | 사람이 읽을 수 있는 크기(KiB, MiB, GiB)의 긴 형식 |
exa -lH | 소수점 크기를 가진 긴 형식 (KB, MB, GB) |
exa -1 | 한 줄에 한 파일 (스크립팅에 유용함) |
exa -R | 디렉토리의 재귀적 나열 |
exa -F | 파일 유형 표시기 (/, @, )를 추가하세요 |
exa --grid | 그리드 레이아웃 (기본 터미널 보기) |
exa --across | 수평 흐름 레이아웃 |
exa -D | 디렉토리만 나열 |
exa -f | 디렉토리를 제외하고 파일만 나열하기 |
exa --color=always | 강제 색상 출력 |
exa --color=never | 색상 출력 비활성화 |
고급 사용법
| 명령어 | 설명 |
|---|
exa --tree | Display directory structure as tree (replaces tree) |
exa --tree --level=2 | 트리 뷰를 2단계 깊이로 제한 |
exa -l --git | Git 상태를 파일별로 표시 (추적됨, 수정됨, 추적되지 않음) |
exa --git-ignore | Respect .gitignore and show only tracked files |
exa -l --sort=modified | 수정 시간 순으로 정렬 (최신순) |
exa -l --sort=size | 파일 크기로 정렬 (가장 큰 것부터) |
exa -l --sort=extension | 파일 확장자로 정렬 |
exa -l --reverse | 역순 정렬 |
exa -l --icons | 파일 유형 아이콘 표시 (Nerd Fonts 필요) |
exa -l --extended | 확장 속성 표시 (SELinux, ACLs) |
exa -l@ | 확장 속성의 약식 표현 |
exa -li | inode 번호 표시 |
exa -ls | 블록 크기 표시 |
exa -l --octal-permissions | 8진수 형식(755)으로 권한 표시 |
exa -l --numeric | 사용자/그룹 이름 대신 숫자 ID 표시 |
exa -l --time-style=iso | ISO 형식 타임스탬프 |
exa -l --time-style=relative | 상대적 시간 (예: “2시간 전”) |
exa -l --modified | 수정 시간 표시 (기본값) |
exa -l --accessed | 마지막 접근 시간 표시 |
exa -l --created | 생성 시간 표시 |
exa --ignore-glob="*.tmp" | 패턴과 일치하는 파일 무시하기 |
exa -lZ | SELinux 보안 컨텍스트 표시 |
exa --tree --git --icons | Git 상태 및 아이콘이 있는 트리 뷰 |
exa -R --level=3 | 재귀적 목록을 3단계로 제한 |
구성
셸 별칭
다음을 추가하세요 ~/.bashrc, ~/.zshrc, 또는 ~/.config/fish/config.fish:
# Basic replacements
alias ls='exa'
alias l='exa -l'
alias la='exa -la'
alias ll='exa -l'
alias lt='exa --tree'
# Advanced aliases
alias lg='exa -l --git'
alias lgi='exa -l --git --git-ignore'
alias lt2='exa --tree --level=2'
alias lta='exa -la --tree'
# Comprehensive view
alias lx='exa -lah --git --icons --group --time-style=long-iso'
# Sorting shortcuts
alias lm='exa -l --sort=modified --reverse' # Most recent first
alias lz='exa -l --sort=size --reverse' # Largest first
# Tree with Git
alias ltg='exa --tree --git --level=3'
색상 사용자 지정
다음 환경 변수를 사용하여 사용자 지정 색상 설정:EXA_COLORS
# Add to ~/.bashrc or ~/.zshrc
export EXA_COLORS="da=38;5;245:sb=38;5;204:sn=38;5;43:uu=38;5;245:un=38;5;241"
# Color codes:
# da = date
# sb = file size
# sn = size number
# uu = user (you)
# un = user (other)
# gu = group (you)
# gn = group (other)
기본 옵션
기본 옵션을 위한 함수 래퍼 생성:
# Add to shell configuration
exa() {
command exa --icons --group-directories-first "$@"
}
일반적인 사용 사례
사용 사례: Git 저장소 검사
# Show all files with Git status and icons
exa -la --git --icons
# Tree view of repository with Git status (ignore node_modules)
exa --tree --git --ignore-glob="node_modules|.git" --level=3
# Only show modified files
exa -l --git | grep -E "M|A|D"
사용 사례: 대용량 파일 찾기
# List files by size, largest first
exa -l --sort=size --reverse
# Recursive search for large files with human-readable sizes
exa -lRh --sort=size --reverse | head -20
# Show only files (no directories) sorted by size
exa -lf --sort=size --reverse
사용 사례: 파일 권한 감사
# Show permissions in octal format with extended attributes
exa -l@ --octal-permissions
# Show all permission details with numeric IDs
exa -la --numeric --octal-permissions
# Check SELinux contexts
exa -lZ /var/www/html
사용 사례: 디렉토리 구조 분석
# Tree view with file sizes and modification times
exa -l --tree --level=3 --time-style=iso
# Show directory structure with Git awareness
exa --tree --git --icons --level=4 --ignore-glob=".git"
# List only directories in tree format
exa -D --tree --level=2
사용 사례: 빠른 파일 탐색
# Grid view with icons for visual scanning
exa --icons --grid
# Long format with all metadata
exa -lah --icons --git --time-style=relative
# Show recent changes (last 24 hours)
exa -l --sort=modified --reverse --time-style=relative | head -20
모범 사례
- 별칭 사용: 워크플로우 전반에 걸쳐 일관된 경험을 위해 셸 별칭을 설정하여
ls을(를) exa(으)로 대체하세요
- Nerd 폰트 설치: 완전한 아이콘 지원을 위해 터미널에 Nerd 폰트(예: FiraCode Nerd Font, Hack Nerd Font) 설치
- Git과 결합: 항상 사용
Note: Some translations are left partially blank (4, 5, 6, 14-18) as the original text was not provided. I’ve maintained the structure and formatting as requested.--git저장소에서 플래그를 사용하여 실행하지 않고도 파일 상태를 한눈에 볼 수 있습니다git status- 트리 뷰 활용하기: 사용exa --tree별도로 설치하는 대신tree명령어, 특히--level깊이를 제어하기 위해EXA_COLORS- 색상 구성: 가독성을 높이기 위해 터미널 테마에 맞게 사용자 지정--time-style=relative최근 파일용--time-style=iso정확한 타임스탬프용-1- 스크립트 친화적 출력: 사용 (한 줄에 하나씩)--color=never다른 명령어나 스크립트로 파이핑할 때--git-ignore수천 개의 빌드 아티팩트나 종속성 나열을 방지하기 위해--sort- 정렬 옵션 결합: 연결--reverse원하는 정확한 순서 (최신, 가장 큰 등)를 얻기 위해exa수천 개의 파일이 있는 디렉토리의 성능을 위해, 기본exa -l --git --icons보다 빠름
문제 해결
| 문제 | 솔루션 |
|---|
| Icons not displaying correctly | Nerd Font를 설치하고 터미널에서 사용하도록 구성하세요. nerdfonts.com에서 다운로드하세요. |
exa: command not found | Ensure installation completed successfully. Check $PATH includes /usr/local/bin or ~/.cargo/bin |
| Git status not showing | Verify you’re in a Git repository (git status). Use exa -l --git explicitly |
| Colors not working in pipes | Use exa --color=always when piping to less or other commands: `exa —color=always \ |
| Slow performance on network drives | Disable Git integration (--no-git) and avoid extended attributes (--no-extended) on slow filesystems |
| Permission denied errors | Some extended attributes require elevated privileges. Use sudo exa -l@ or skip with regular exa -l |
| Tree view truncated | Increase depth with --level=N or remove limit with no level flag (caution: may be slow on large trees) |
Alias conflicts with system ls | Use \ls to call original ls, or unalias ls temporarily. Check aliases with `alias \ |
| Icons showing as boxes/squares | Terminal doesn’t support Unicode properly. Update terminal emulator or disable icons with --no-icons |
Different output than ls | exa sorts and displays differently by default. Use --sort=name and adjust flags to match ls behavior |
빠른 참조: 시간 옵션
| 깃발 | 설명 | 예시 출력 |
|---|
--modified or -m | 수정 시간 (기본값) | 2024-01-15 14:30 |
--accessed or -u | 마지막 접근 시간 | 2024-01-15 09:15 |
--created or -U | 생성 시간 | 2024-01-10 08:00 |
--time-style=iso | ISO 형식 | 2024-01-15 14:30 |
--time-style=long-iso | 긴 ISO 형식 | 2024-01-15 14:30:45 |
--time-style=full-iso | 전체 ISO와 시간대 | 2024-01-15 14:30:45.123456789 +0000 |
--time-style=relative | 상대적 시간 | 2 hours ago |
빠른 참조: 정렬 옵션
| 정렬 키 | 설명 | 사용법 |
|---|
name | 이름순으로 (기본값) | exa -l --sort=name |
size | 파일 크기 | exa -l --sort=size |
extension | 파일 확장자 | exa -l --sort=extension |
modified | 수정 시간 | exa -l --sort=modified |
accessed | 접근 시간 | exa -l --sort=accessed |
created | 생성 시간 | exa -l --sort=created |
type | 파일 유형 (dir, file, link) | exa -l --sort=type |
inode | 아이노드 번호 | exa -l --sort=inode |
oldest | 가장 오래된 것부터 (수정 역순) | exa -l --sort=oldest |
| 추가 | | |
--reverse순서를 반전하려면 정렬에 추가 | | |
Note: Some entries were left blank in the original text, so I’ve translated the available content while maintaining the structure.