[리눅스] linux 기본 명령어 | which, whatis, man
이번 글에서는 명령어와 관련된 명령어들을 알아봅시다!
which 명령어는 $ which 명령어 형태로 사용합니다.
명령어들은 모두 특정 파일 안에 존재하는데, 그 위치를 절대경로를 보여줍니다.
$ which ls
/bin/ls
$ which pwd
/usr/pwd
$ which passwd
/usr/passwd
whatis 명령어는 $ whatis 명령어 형태로 사용되고,
명령어에 대한 간단한 설명을 출력합니다.
$ whatis ls
ls (1) - 경로의 내용을 나열한다.
ls (1p) - list directory contents
man 명령어 또한 명령어에 대한 설명을 제공하는 명령어입니다.
따라서 사용 방법은 whatis와 유사하게 $ man 명령어 형태로 쓰이겠죠?
whatis와는 다르게 man은 그 명령어에 대한 온라인 메뉴얼을 제공합니다. 길게길게 설명이 써있죠.
$ man ls
LS(1) User Commands LS(1)
NAME
ls - list directory contents
SYNOPSIS
ls [OPTION]... [FILE]...
DESCRIPTION
List information about the FILEs (the current directory by default).
Sort entries alphabetically if none of -cftuvSUX nor --sort is speci
fied.
Mandatory arguments to long options are mandatory for short options
too.
-a, --all
do not ignore entries starting with .
-A, --almost-all
do not list implied . and ..
Manual page ls(1) line 1 (press h for help or q to quit)
정리를 해보면, 어떤 명령어를 사용하기 전에 이 명령어 무슨 역할이었지? 궁금하면 whatis 명령어를 통해 짧은 설명을 슬쩍 보고, 그래도 이해가 안간다! 기억이 안난다! 하면은 man 명령어로 자세한 설명을 보면 되겠습니다!
이 명령어들은 구글링을 할 수고로움을 덜어주죠!
근데 전 구글링이 편해서 자주 안썼던 명령어들입니다^^