사용자 도구

사이트 도구


linux:ls

차이

문서의 선택한 두 판 사이의 차이를 보여줍니다.

차이 보기로 링크

양쪽 이전 판 이전 판
다음 판
이전 판
linux:ls [2014/01/09 14:02]
kwon37xi
linux:ls [2021/12/09 13:38] (현재)
kwon37xi
줄 1: 줄 1:
 ====== Linux ls ====== ====== Linux ls ======
 +  * [[linux:exa|exa]]
 +  * [[linux:lsd|LSD lsdeluxe]]
 +===== 정렬 =====
 +  * [[https://www.lostsaloon.com/technology/how-to-sort-the-output-of-ls-in-linux/|how to sort the output of ‘ls command’ in linux command line - lost saloon]]
 +  * ''ls''는 기본적으로 파일명으로 정렬을 한다.
 +
 +==== 날짜 순 정렬 ====
 +  * ''-t'' : 수정 날짜 순 정렬
 +  * ''-r'' : 역순 정렬
 +<code sh>
 +ls -ltr
 +</code>
 +
 ===== ls 컬러 변경 ===== ===== ls 컬러 변경 =====
 +  * https://github.com/seebi/dircolors-solarized
   * [[http://www.geekgumbo.com/2011/11/04/changing-the-directory-color-in-the-bash-shell/|환경 변수를 이용한 ls 색상 변경]]<code sh>   * [[http://www.geekgumbo.com/2011/11/04/changing-the-directory-color-in-the-bash-shell/|환경 변수를 이용한 ls 색상 변경]]<code sh>
 export LS_COLORS='di=0;35' export LS_COLORS='di=0;35'
 </code> </code>
-  * [[http://www.suse.or.kr/bbs/board.php?bo_table=tip&wr_id=2268&page=4|설정 파일로 변경하기]] ''DIR_COLORS''파일을 ''~/.dir_colors''로 복사해서 수정+  * ''dircolors'' 명령을 통한 변경 [[http://linuxtoolkit.blogspot.kr/2009/06/painting-ls-on-bash.html|Linux Toolkits: Changing Color for ls on Bash]]<code sh> 
-    * ''/etc/DIR_COLORS'' +# 문서상 파일 이름이 ".dircolors"로 나와 있는데 ".dir_colors"가 맞음 
-    ''~/.dir_colors''+# Step 1: Pipe the information from Dircolors and save as .dir_colors 
 +dircolors -p > ~/.dir_colors 
 + 
 +# Step 2: Change the contents of .dir_colors 
 +vim .dir_colors 
 + 
 +#------------------------------------------------ 
 +NORMAL 00 # global default, although everything should be something. 
 +FILE 00 # normal file 
 +DIR 01;34 # directory 
 +......... 
 +#------------------------------------------------ 
 + 
 +Color Codes (Foreground): 
 +00;30=Black 
 +00;31=Red 
 +00;32=Green 
 +00;33=Brown 
 +00;34=Blue 
 +00;35 Magenta 
 +00;36=Cyan 
 +00;37=White 
 + 
 +01;30=Grey 
 +01;31=Light Red 
 +01;32=Light green 
 +01;33=Yellow 
 +01;34=Light Blue 
 +01;35=Pink 
 +01;36=Light Cyan 
 +01;37=Light Gray 
 + 
 + 
 +# Introduce DirColors to the new configuration 
 +dircolors -b ~/.dir_colors 
 + 
 +</code> 
 + 
 +===== 파일의 전체 경로 보기 ===== 
 +  [[https://stackoverflow.com/questions/246215/how-can-i-generate-a-list-of-files-with-their-absolute-path-in-linux|command line - How can I generate a list of files with their absolute path in Linux? - Stack Overflow]]
  
-===== 날짜 순 정렬 ===== 
-  * ''-t'' : 수정 날짜 순 정렬 
-  * ''-r'' : 역순 정렬 
 <code sh> <code sh>
-ls -ltr+# current dir의 모든 파일과 디렉토리 
 +ls -1 |xargs realpath 
 + 
 +# 현재 디렉토리의 파일과 링크 
 +find $PWD -maxdepth 1 -type f,l 
 + 
 +# 현재 이하 모든 디렉토리의 모든 파일과 링크 
 +find $PWD -type f,l
 </code> </code>
 +
linux/ls.1389243763.txt.gz · 마지막으로 수정됨: 2014/01/09 14:02 저자 kwon37xi