본문 바로가기
Linux/Shell

ls 명령어 옵션

by Sondho 2020. 11. 19.
-@ 확장된 속성 키 및 크기를 긴(-l) 출력 단위로 표시
-1 (숫자 숫자 "one")  강제로 출력을 라인당 하나의 항목으로 만드십시오.  이것은 단자가 아닌 출력의 기본값이다.
-A '.'와 '..'를 제외한 모든 항목을 나열하십시오.  항상 슈퍼 유저에 맞게 설정.
-a 이름이 점(.)으로 시작하는 디렉토리 항목 포함.
-B 파일 이름에 \xxx로 인쇄할 수 없는 문자(ctype(3) 및 현재 로케일 설정으로 정의됨)를 강제로 인쇄하십시오. 여기서 xxx는 8진수 문자의 숫자 값이다.
-b -B로 하되, 가능하면 C 이스케이프 코드를 사용한다.
-C 다중 열 출력 강제. 단자에 대한 출력일 경우 기본 설정.
-c 정렬(-t) 또는 긴 인쇄(-l)에 대해 마지막으로 파일 상태가 변경된 시간을 사용한다.
-d 디렉토리는 일반 파일로 나열된다(재귀적으로 검색되지 않음).
-e 파일과 관련된 ACL(액세스 제어 목록)이 있는 경우 긴(-l) 출력으로 인쇄
-F 디렉터리인 각 경로 이름 바로 뒤에 슬래시("/"), 실행 가능한 각 경로 이름 뒤에 별표("*"), 각 기호 링크 뒤에 at("@"), 각 소켓 뒤에 등호("='), 각 화이트아웃 뒤에 백분율 기호("%"), FIFO 뒤에 수직 막대("|")를 표시한다.
-f 출력이 정렬되지 않음.  이 옵션은 -a 옵션을 실행한다.
-G 컬러 출력 활성화  이 옵션은 환경에서 CLICOLOR를 정의하는 것과 동일하다(아래 참조).
-g 이 옵션은 POSIX와의 호환성이 있는 경우에만 사용할 수 있으며, 그룹 이름을 긴(-l) 형식 출력(소유자 이름은 억제됨)으로 표시하는 데 사용된다.
-H 명령줄에 심볼 링크가 따라온다.  -F, -d 또는 -l 옵션이 지정되지 않은 경우 이 옵션을 가정한다.
-h -l 옵션과 함께 사용할 경우 단위 접미사를 사용하십시오. 바이트, 킬로바이트, 메가바이트, 기가바이트, 테라바이트, 페타바이트는 크기에 대한 베이스 2를 사용하여 자릿수를 3자리 이하로 줄이기 위한 것이다.
-i 각 파일에 대해 파일의 일련번호(인코드 번호)를 인쇄한다.
-k -s 옵션이 지정된 경우 파일 크기 할당을 블록이 아닌 킬로바이트 단위로 인쇄하십시오.  이 옵션은 환경 변수 BlOCKSIZE를 재정의한다.
-L 모든 심볼 링크를 따라 최종 대상으로 이동하고 링크 자체 대신 링크 참조 파일 또는 디렉터리를 나열하십시오.  이 옵션은 -P 옵션을 취소한다.
-l 모든 심볼 링크를 따라 최종 대상으로 이동하고 링크 자체 대신 링크 참조 파일 또는 디렉터리를 나열하십시오.  이 옵션은 -P 옵션을 취소한다.
-m 출력 형식 스트리밍; 페이지에 있는 파일을 쉼표로 구분하여 나열하십시오.
-n 긴(-l) 출력에서 사용자 또는 그룹 이름으로 변환하지 않고 사용자 및 그룹 ID를 숫자로 표시하십시오.  이 옵션은 -l 옵션을 실행한다.
-O 긴(-l) 출력에 파일 플래그를 포함하십시오.
o 긴 형식으로 나열하되 그룹 ID는 생략한다.
-P 인수가 심볼릭 링크인 경우 링크에서 참조하는 개체 대신 링크 자체를 나열하십시오.  이 옵션은 -H 및 -L 옵션을 취소한다.
-p 각 파일 이름 뒤에 해당 파일이 디렉토리인 경우 슬래시("/')를 쓰십시오.
-q 파일 이름에 비그래픽 문자를 '?' 문자로 강제 인쇄. 단자로 출력할 때 기본값.
-R 발견된 하위 디렉터리를 반복적으로 나열하십시오.
-r 역 사전 순서 또는 가장 오래된 항목을 먼저 가져오려면 정렬 순서를 반대로 적용(또는 크기별 정렬과 함께 조합된 경우 가장 큰 파일이 마지막)
-S 크기별로 파일 정렬
-s 각 파일에서 실제로 사용한 파일 시스템 블록의 수를 512바이트 단위로 표시하며, 여기서 부분 단위는 다음 정수 값으로 반올림한다.  만약 출력이 단자라면, 모든 파일 크기에 대한 총합은 목록 앞에 한 줄에 출력된다.  환경 변수 BLOCKSIZE는 512바이트의 단위 크기를 재정의한다.
-T -l( 소문자 "el") 옵션과 함께 사용할 경우 월, 일, 시간, 분, 초, 연도를 포함한 파일에 대한 전체 시간 정보를 표시하십시오.
-t 사전순으로 피연산자를 정렬하기 전에 수정한 시간(가장 최근에 수정한 것 먼저)별로 정렬한다.
-u 정렬(-t) 또는 긴 인쇄(-l)를 위해 파일을 마지막으로 수정하는 대신 마지막 액세스 시간을 사용하십시오.
-U 정렬(-t) 또는 긴 출력(-l)에 대한 마지막 수정 대신 파일 생성 시간을 사용하십시오.
-v 비그래픽 문자의 편집되지 않은 인쇄 강제. 단자가 아닌 출력의 경우 기본값.
-W 디렉토리 스캔 시 화이트아웃 표시(-S) 플래그).
-w 인쇄할 수 없는 문자의 원시 인쇄 강제  이것은 단자가 아닌 출력의 기본값이다.
-x -C와 동일하며, 다중 컬럼 출력은 아래 컬럼이 아닌 여러 컬럼에 걸쳐 정렬된 항목으로 생산된다.

-@ Display extended attribute keys and sizes in long (-l) output.
-1 (The numeric digit ``one''.)  Force output to be one entry per line.  This is the default when output is not to a terminal.
-A List all entries except for . and ...  Always set for the super-user.
-a Include directory entries whose names begin with a dot (.).
-B Force printing of non-printable characters (as defined by ctype(3) and current locale settings) in file names as \xxx, where xxx is the numeric value of the character in octal.
-b As -B, but use C escape codes whenever possible.
-C Force multi-column output; this is the default when output is to a terminal.
-c Use time when file status was last changed for sorting (-t) or long printing (-l).
-d Directories are listed as plain files (not searched recursively).
-e Print the Access Control List (ACL) associated with the file, if present, in long (-l) output.
-F Display a slash (`/') immediately after each pathname that is a directory, an asterisk (`*') after each that is executable, an at sign (`@') after each symbolic link, an equals sign (`=') after each socket, a percent sign (`%') after each whiteout, and a vertical bar (`|') after each that is a FIFO.
-f Output is not sorted.  This option turns on the -a option.
-G Enable colorized output.  This option is equivalent to defining CLICOLOR in the environment.  (See below.)
-g This option is only available for compatibility with POSIX; it is used to display the group name in the long (-l) format output (the owner name is suppressed).
-H Symbolic links on the command line are followed.  This option is assumed if none of the -F, -d, or -l options are specified.
-h When used with the -l option, use unit suffixes: Byte, Kilobyte, Megabyte, Gigabyte, Terabyte and Petabyte in order to reduce the number of digits to three or less using base 2 for sizes.
-i For each file, print the file's file serial number (inode number).
-k If the -s option is specified, print the file size allocation in kilobytes, not blocks.  This option overrides the environment variable BLOCKSIZE.
-L Follow all symbolic links to final target and list the file or directory the link references rather than the link itself.  This option cancels the -P option.
-l (The lowercase letter ``ell''.)  List in long format.  (See below.)  If the output is to a terminal, a total sum for all the file sizes is output on a line before the long listing.
-m Stream output format; list files across the page, separated by commas.
-n Display user and group IDs numerically, rather than converting to a user or group
             name in a long (-l) output.  This option turns on the -l option.
-O Include the file flags in a long (-l) output.
-o List in long format, but omit the group id.
-P If argument is a symbolic link, list the link itself rather than the object the link references.  This option cancels the -H and -L options.
-p Write a slash (`/') after each filename if that file is a directory.
-q Force printing of non-graphic characters in file names as the character `?'; this is the default when output is to a terminal.
-R Recursively list subdirectories encountered.
-r Reverse the order of the sort to get reverse lexicographical order or the oldest entries first (or largest files last, if combined with sort by size
-S Sort files by size
-s Display the number of file system blocks actually used by each file, in units of 512 bytes, where partial units are rounded up to the next integer value.  If the output is to a terminal, a total sum for all the file sizes is output on a line before the listing.  The environment variable BLOCKSIZE overrides the unit size of 512 bytes.
-T When used with the -l (lowercase letter ``ell'') option, display complete time information for the file, including month, day, hour, minute, second, and year.
-t Sort by time modified (most recently modified first) before sorting the operands by lexicographical order.
-u Use time of last access, instead of last modification of the file for sorting (-t) or
             long printing (-l).
-U Use time of file creation, instead of last modification for sorting (-t) or long output (-l).
-v Force unedited printing of non-graphic characters; this is the default when output is not to a terminal.
-W Display whiteouts when scanning directories.  (-S) flag).
-w Force raw printing of non-printable characters.  This is the default when output is not to a terminal.
-x The same as -C, except that the multi-column output is produced with entries sorted across, rather than down, the columns.

 

'Linux > Shell' 카테고리의 다른 글

id 명령어 옵션  (0) 2020.11.19
find 명령어 옵션  (0) 2020.11.19
zip, unzip 명령어  (0) 2020.08.07
alias로 단축명령어 생성  (0) 2020.07.14
Ubuntu 시작 경로 변경하기 (echo 사용)  (0) 2020.07.14

댓글