리눅스(Linux)

리눅스 특수문자 정리

kth9364 2024. 5. 2. 14:32

/home> ls
test2024.txt

test_2024.txt

test test2014.txt

 

*은 하나라도 맞으면 모두
/home> ls -ls test*
5월  2 11:06 test2024.txt
5월  2 11:06 test_2024.txt

5월  2 11:06 test2014.txt

 

?는 하나만 맞을 경우

/home> ls -l test20?4.txt
5월  2 11:09 test2014.txt
5월  2 11:06 test2024.txt

 

| 파이프라인

# 프로세서 간 사용하며 앞의 결과를 뒤에 나오는 명령어의 입력으로 처리

ps -ef | grep mysql

cat ./ | grep '1234' == grep '1234' ./*

# 디렉토리 갯수 확인

ll | grep "^d" | wc -l

 

스트림

0 입력 stdin

1 출력 stdout

2 에러출력 stderr

 

[root@a ttttemp]# ls test.txt2 1> out
ls: cannot access test.txt2: 그런 파일이나 디렉터리가 없습니다
[root@a ttttemp]# cat out
[root@a ttttemp]# ls test.txt2 2> out
[root@a ttttemp]# cat out
ls: cannot access test.txt2: 그런 파일이나 디렉터리가 없습니다