Index: bin/ls/ls.h =================================================================== --- bin/ls/ls.h +++ bin/ls/ls.h @@ -54,8 +54,10 @@ extern int f_samesort; /* sort time and name in same direction */ extern int f_sectime; /* print the real time for all files */ extern int f_size; /* list size in short listing */ +extern int f_sgroup; /* show the name of owning group*/ extern int f_slash; /* append a '/' if the file is a directory */ extern int f_sortacross; /* sort across rows, not down columns */ +extern int f_sowner; /* show the owner's name */ extern int f_statustime; /* use time of last mode change */ extern int f_thousands; /* show file sizes with thousands separators */ extern char *f_timeformat; /* user-specified time format */ Index: bin/ls/ls.c =================================================================== --- bin/ls/ls.c +++ bin/ls/ls.c @@ -141,8 +141,10 @@ static int f_singlecol; /* use single column output */ int f_size; /* list size in short listing */ static int f_sizesort; + int f_sgroup; /* show the name of owning group */ int f_slash; /* similar to f_type, but only for dirs */ int f_sortacross; /* sort across rows, not down columns */ + int f_sowner; /* show owner's name */ int f_statustime; /* use time of last mode change */ static int f_stream; /* stream the output, separate with commas */ int f_thousands; /* show file sizes with thousands separators */ @@ -401,7 +403,11 @@ f_listdir = 1; f_recursive = 0; break; - case 'g': /* Compatibility with 4.3BSD. */ + case 'g': + f_longform = 1; + f_singlecol = 0; + f_stream = 0; + f_sowner = 1; break; case 'h': f_humanval = 1; @@ -420,9 +426,15 @@ break; case 'n': f_numericonly = 1; + f_longform = 1; + f_singlecol = 0; + f_stream = 0; break; case 'o': - f_flags = 1; + f_longform = 1; + f_singlecol = 0; + f_stream = 0; + f_sgroup = 1; break; case 'p': f_slash = 1; Index: bin/ls/print.c =================================================================== --- bin/ls/print.c +++ bin/ls/print.c @@ -234,9 +234,11 @@ strmode(sp->st_mode, buf); aclmode(buf, p); np = p->fts_pointer; - (void)printf("%s %*ju %-*s %-*s ", buf, dp->s_nlink, - (uintmax_t)sp->st_nlink, dp->s_user, np->user, dp->s_group, - np->group); + (void)printf("%s %u ", buf, dp->s_nlink); + if (!f_sowner) + (void)printf("%-*s ", dp->s_user, np->user); + if (!f_sgroup) + (void)printf("%-*s ", dp->s_group, np->group); if (f_flags) (void)printf("%-*s ", dp->s_flags, np->flags); if (f_label)