Re: "fields" in files
Hi Lisi,
On Sun, Jan 30, 2011 at 12:18:39PM +0000, Lisi wrote:
> On Sunday 30 January 2011 11:35:56 Camaleón wrote:
> > On Sun, 30 Jan 2011 11:26:16 +0000, Lisi wrote:
> > > In teh following:
> > > -rw-r--r-- 1 lisi lisi 19503 2011-01-28 21:12 Etch_repositories.odt
> > >
> > > I can see eight pieces of information: permissions, directory or file
> > > (information that is also at the beginning of the permissions), owner,
> > > group (or group, owner), size, date, name of file or directory.
> > >
> > > What are these called? I have always called them fields, but it would
> > > appear that I am wrong to do so.
> >
> > directory/file
> > user perms-group perms-others perms
> > user-group
> > size
> > last modified timestamp
> > file name
> >
> > I call them "file attributes" but not sure if that's the technical name
> > though :-)
>
> Thanks, Camaleón! Yes ,that it what they are in this context. But in more
> general terms, like page, chapter, section etc., rather than the names of
> that particular page etc. - what are they called? I want to use it with cut
> if possible, but can't even find if there is a suitable option when I don't
> know what they are called. Column is too narrow (in the physical sense) a
> definition. There are 21 of what cut calls columns in the name of the file
> alone in this sample!
Is that what you want to achieve?
ls -l | sed -e 's/ */ /g' | cut -f 8 -d " "
This gives the 8's element in the line, that is the filename.
I used "sed" to replace multiple spaces by a single one, and then "cut"
to select an appropriate element
Axel
Reply to: