Bash CLI 가이드

41의 명령어를 찾았습니다

ls
file
디렉토리 내용 나열

예제:

$ ls ls -l ls -a ls -la
list
directory
files
cd
navigation
디렉토리 변경

예제:

$ cd /path/to/directory cd .. cd ~ cd -
change
directory
navigation
pwd
navigation
현재 작업 디렉토리 출력

예제:

$ pwd pwd -P
print
working
directory
cp
file
파일 및 디렉토리 복사

예제:

$ cp file1 file2 cp -r dir1 dir2 cp -i file1 file2
copy
file
directory
mv
file
파일 및 디렉토리 이동/이름 변경

예제:

$ mv file1 file2 mv dir1 dir2 mv -i file1 file2
move
rename
file
rm
file
파일 및 디렉토리 삭제

예제:

$ rm file rm -r directory rm -f file rm -i file
remove
delete
file
mkdir
directory
디렉토리 생성

예제:

$ mkdir directory mkdir -p parent/child mkdir -m 755 directory
make
directory
create
rmdir
directory
빈 디렉토리 삭제

예제:

$ rmdir directory rmdir -p parent/child
remove
directory
delete
touch
file
파일 생성 또는 타임스탬프 변경

예제:

$ touch file touch -t 202301010000 file touch -a file
create
file
timestamp
cat
text
파일 내용 출력

예제:

$ cat file cat -n file cat file1 file2 > file3
concatenate
display
file
grep
text
텍스트 검색

예제:

$ grep pattern file grep -r pattern directory grep -i pattern file
search
pattern
text
find
file
파일 검색

예제:

$ find . -name "*.txt" find . -type f -mtime -7 find . -size +100M
search
file
directory
chmod
permissions
파일 권한 변경

예제:

$ chmod 755 file chmod u+x file chmod -R 755 directory
change
mode
permissions
chown
permissions
파일 소유자 변경

예제:

$ chown user file chown user:group file chown -R user:group directory
change
owner
group
tar
archive
파일 압축 및 압축 해제

예제:

$ tar -cvf archive.tar files tar -xvf archive.tar tar -czvf archive.tar.gz files
archive
compress
extract
gzip
archive
파일 압축

예제:

$ gzip file gzip -d file.gz gzip -l file.gz
compress
decompress
file
ps
process
프로세스 상태 표시

예제:

$ ps ps aux ps -ef
process
status
system
kill
process
프로세스 종료

예제:

$ kill PID kill -9 PID killall process_name
kill
process
terminate
top
process
시스템 프로세스 모니터링

예제:

$ top top -u username top -p PID
monitor
process
system
df
system
디스크 사용량 표시

예제:

$ df df -h df -T
disk
space
usage
du
system
디렉토리/파일 사용량 표시

예제:

$ du directory du -h directory du -sh *
disk
usage
size
head
text
파일의 처음 부분 출력

예제:

$ head file head -n 10 file head -c 100 file
display
beginning
file
tail
text
파일의 마지막 부분 출력

예제:

$ tail file tail -n 10 file tail -f file
display
end
file
sort
text
텍스트 정렬

예제:

$ sort file sort -r file sort -n file
sort
order
text
uniq
text
중복된 줄 제거

예제:

$ uniq file uniq -c file uniq -d file
unique
duplicate
text
wc
text
줄, 단어, 문자 수 계산

예제:

$ wc file wc -l file wc -w file
word
count
lines
diff
text
파일 비교

예제:

$ diff file1 file2 diff -u file1 file2 diff -r dir1 dir2
compare
difference
files
ln
file
링크 생성

예제:

$ ln -s target link ln target link ln -f target link
link
symbolic
file
history
shell
명령어 히스토리 표시

예제:

$ history history 10 history | grep pattern
history
commands
shell
alias
shell
명령어 별칭 생성

예제:

$ alias ll='ls -l' alias la='ls -la' alias
alias
shortcut
shell
export
shell
환경 변수 설정

예제:

$ export VAR=value export PATH=$PATH:/new/path export
environment
variable
shell
source
shell
스크립트 실행

예제:

$ source script.sh . script.sh
source
script
shell
echo
text
텍스트 출력

예제:

$ echo "Hello World" echo $PATH echo -n "No newline"
print
output
text
printf
text
포맷된 텍스트 출력

예제:

$ printf "%s\n" "Hello World" printf "%d\n" 42 printf "%.2f\n" 3.14159
print
format
output
read
input
사용자 입력 읽기

예제:

$ read variable read -p "Enter name: " name read -s password
input
read
user
test
shell
조건 테스트

예제:

$ test -f file [ -d directory ] [[ $var == value ]]
test
condition
shell
if
shell
조건문

예제:

$ if [ condition ]; then commands fi
if
condition
shell
for
shell
반복문

예제:

$ for i in {1..5}; do echo $i done
loop
iteration
shell
while
shell
조건 반복문

예제:

$ while [ condition ]; do commands done
loop
while
shell
case
shell
다중 조건문

예제:

$ case $var in pattern1) commands ;; pattern2) commands ;; esac
case
switch
shell
function
shell
함수 정의

예제:

$ function name() { commands } name() { commands }
function
define
shell