Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F151672153
D34747.id104721.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
3 KB
Referenced Files
None
Subscribers
None
D34747.id104721.diff
View Options
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.1
===================================================================
--- bin/ls/ls.1
+++ bin/ls/ls.1
@@ -301,14 +301,9 @@
.Fl s
options.
.It Fl g
-This option has no effect.
-It is only available for compatibility with
-.Bx 4.3 ,
-where it was used to display the group name in the long
+Display the long
.Pq Fl l
-format output.
-This option is incompatible with
-.St -p1003.1-2008 .
+format output without the file owner's name or number.
.It Fl h
When used with the
.Fl l
@@ -339,14 +334,9 @@
.Pq Fl l
output.
.It Fl o
-Include the file flags in a long
+Display the long
.Pq Fl l
-output.
-This option is incompatible with
-.St -p1003.1-2008 .
-See
-.Xr chflags 1
-for a list of file flags and their meanings.
+format output without the file's group name or number.
.It Fl p
Write a slash
.Pq Ql /
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 %*ju ", buf, dp->s_nlink,(uintmax_t)sp->st_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)
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Apr 10, 10:22 PM (17 h, 51 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31249830
Default Alt Text
D34747.id104721.diff (3 KB)
Attached To
Mode
D34747: ls(1): Change -g and make -n imply -l to implement POSIX
Attached
Detach File
Event Timeline
Log In to Comment