본문 바로가기

리눅스-기초명령어/명령어 관리

리눅스 명령어 단축키

명령어를 입력할 때 사용 가능한 단축키

ctrl + a

명령어 맨앞칸으로 이동

ctrl + e

명령어 맨뒷칸으로 이동

ctrl + u

커서를 기준으로 앞을 삭제

 

ex) 뒤쪽 c에 커서를 맞춘 후 실행

[root@Linux ~]# cat hi.txt; cat hello.txt

 

[root@Linux ~]# cat hello.txt

 

ctrl + k

커서를 기준으로 뒤를 삭제

 

ex) 뒤쪽 c에 커서를 맞춘 후 실행

[root@Linux ~]# cat hi.txt; cat hello.txt

 

[root@Linux ~]# cat hi.txt; 

 

ctrl + r

본인이 친 명령어를 역순으로 검색해준다.

 

Ctrl + c 

강제 종료

>
>
>

 

이런식으로 엔터를 쳐도 빠져나올수 없을때는 ctrl + c 를 쓰면 빠져나온다



\ (백 슬래쉬)

한 줄로 적기 어려울 경우 명령어를 두 줄로 입력 가능

가독성이 좋아진다. argument(인자)가 길어지거나 하는 경우 오타를 방지하기 위해 사용.

 

[root@Linux ~]# echo "hello" > \
> hello.txt
[root@Linux ~]# ls
AAA  acltest  happy  happy.txt  hello.txt  setgid  test
[root@Linux ~]# cat hello.txt
hello

 

명령어 두 개를 이어서 실행

[root@Linux ~]# cat hi.txt; cat hello.txt
hi
hello

cat 명령어로 hi파일을 열고 hello 파일을 열어 보여준다.

 

#

뒤에 나오는 문자가 주석처리된다.

 

문자로 출력되게 할 경우 \# 사용

[root@Linux ~]# echo \#comment #comment
#comment

>> 앞의 #은 문자로 처리 되어서 출력되고 뒤의 #은 주석으로 처리 되어서 출력되지 않는다.

 

'리눅스-기초명령어 > 명령어 관리' 카테고리의 다른 글

grep  (0) 2023.08.31
history  (1) 2023.08.31