답변:
나는 사용할 것이다 find -printf "%u %h/%f\n" | sort
find: bad option -printf
find --version find (GNU findutils) 4.4.2 Copyright (C) 2007 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Written by Eric B. Decker, James Youngman, and Kevin Dalley. Built using GNU gnulib version e5573b1bad88bfabcda181b9e0125fb0c52b7d3b Features enabled: D_TYPE O_NOFOLLOW(enabled) LEAF_OPTIMISATION FTS() CBO(level=0)
ls -l | awk '{print $3"\t\t"$9}' | sort
또한 할 것입니다. 첫 번째 열은 사용자 이름이고 두 번째 열은 파일 / 디렉토리 이름입니다.
[ 09:20 jon@host /home ]$ ls -l | awk '{print $3"\t\t"$9}' | sort
bettina bettina
caldavd caldavd
davical_app postgres
davical_dba davical_dba
istat istat
jared jared
jason jason
jon jon
jon repo
root lost+found
root SCN_RepositoryB.tar.gz
tomcat tomcat
파일 / 디렉토리 이름 만 표시합니다 (소유자별로 정렬).
[ 09:24 jon@host /home ]$ ls -l | awk '{print $3"\t\t"$9}' | sort | awk '{print $2}'
bettina
caldavd
postgres
davical_dba
istat
jared
jason
jon
repo
lost+found
SCN_RepositoryB.tar.gz
tomcat
그리고 이것은 그것들이 정렬되었지만 한 줄로 보여줍니다 :
[ 09:26 jon@host /home ]$ ls -l | awk '{print $3"\t\t"$9}' | sort | awk '{print $2}' | tr "\n" " "
bettina caldavd postgres davical_dba istat jared jason jon repo lost+found SCN_RepositoryB.tar.gz tomcat
ls -l | sort -k3
3
-k3 이후 에 지정할 필요가 없습니다.
kracekumar@python-lover:~$ ls -l /tmp | sort -k3
total 36
drwx------ 2 gdm gdm 4096 2011-10-14 08:36 orbit-gdm
drwx------ 2 gdm gdm 4096 2011-10-14 08:36 pulse- 2L9K88eMlGn7
drwx------ 2 kracekumar kracekumar 4096 2011-10-14 08:36 keyring-4O5hSc
drwx------ 2 kracekumar kracekumar 4096 2011-10-14 08:36 pulse-SBBBfzrceWvC
drwx------ 2 kracekumar kracekumar 4096 2011-10-14 08:36 ssh-UkESZoNj1595
drwx------ 2 kracekumar kracekumar 4096 2011-10-14 08:36 virtual-kracekumar.5D8Mlv
drwx------ 2 kracekumar kracekumar 4096 2011-10-14 08:43 orbit-kracekumar
drwx------ 2 root root 4096 2011-10-14 08:36 pulse-PKdhtXMmr18n
drwxr-xr-x 3 www-data www-data 4096 2011-10-14 08:36 www-data-temp-aspnet-0
kracekumar@python-lover:~$ ls -l /tmp | sort -k3,3
total 36
drwx------ 2 gdm gdm 4096 2011-10-14 08:36 orbit-gdm
drwx------ 2 gdm gdm 4096 2011-10-14 08:36 pulse-2L9K88eMlGn7
drwx------ 2 kracekumar kracekumar 4096 2011-10-14 08:36 keyring-4O5hSc
drwx------ 2 kracekumar kracekumar 4096 2011-10-14 08:36 pulse-SBBBfzrceWvC
drwx------ 2 kracekumar kracekumar 4096 2011-10-14 08:36 ssh-UkESZoNj1595
drwx------ 2 kracekumar kracekumar 4096 2011-10-14 08:36 virtual-kracekumar.5D8Mlv
drwx------ 2 kracekumar kracekumar 4096 2011-10-14 08:43 orbit-kracekumar
drwx------ 2 root root 4096 2011-10-14 08:36 pulse-PKdhtXMmr18n
drwxr-xr-x 3 www-data www-data 4096 2011-10-14 08:36 www-data-temp-aspnet-0
kracekumar@python-lover:~$