• "dir *.msf -t" almost what I need

    From Richard Owlett@rowlett@cloud85.net to alt.os.linux.debian on Wed Sep 20 07:32:30 2023
    From Newsgroup: alt.os.linux.debian

    "dir *.msf -t" prints a time ordered list of file with extension "msf".

    I have two problems with result.
    The format is 2 columns, I need a single column.
    I would like to have a modification date associated with each filename.

    https://manpages.debian.org/bookworm/coreutils/dir.1.en.html
    wasn't helpful enough.

    Suggestions?
    TIA


    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From azigni@azigni@yahoo.com to alt.os.linux.debian on Wed Sep 20 22:39:19 2023
    From Newsgroup: alt.os.linux.debian

    On 9/20/23 06:32, Richard Owlett wrote:
    "dir *.msf -t" prints a time ordered list of file with extension "msf".

    Not sure where you can go with this, but this is what I use for a
    directory print out:

    ls -n > filename.txt

    This gives me: drwxr-xr-x 2 1000 1000 4096 Sep 19 18:25 Countertop

    I am sure there is an editor that can delete the first xx characters of
    each line. Just a thought.
    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From azigni@azigni@yahoo.com to alt.os.linux.debian on Wed Sep 20 22:50:49 2023
    From Newsgroup: alt.os.linux.debian

    Okay, this helps. Libre Office Writer has a block edit function that
    lets you choose a "block" of text. I used it to remove the first xxx of
    this text file:

    total 44
    drwxr-xr-x 2 1000 1000 4096 Sep 19 18:25 Countertop
    -rwxr-xr-x 1 1000 1000 151 Jan 14 2020 Countertop.txt
    -rw-r--r-- 1 1000 1000 0 Sep 20 22:43 cracker.txt
    drwxr-xr-x 2 1000 1000 4096 Sep 19 18:25 Decoupage
    -rwxr-xr-x 1 1000 1000 149 Jan 10 2020 Decoupage.txt
    drwxr-xr-x 2 1000 1000 4096 Sep 19 18:25 Faux_Leather
    -rwxr-xr-x 1 1000 1000 715 Jan 14 2020 Faux_Leather.txt
    -rwxr-xr-x 1 1000 1000 364 Jan 17 2020 Image_Transfer.txt
    drwxr-xr-x 3 1000 1000 4096 Sep 19 18:25 Making_Notebooks
    -rwxr-xr-x 1 1000 1000 158 Jan 9 2020 Making_Notebooks.txt
    -rw-r--r-- 1 1000 1000 0 Sep 20 22:41 michael@office
    -rwxr-xr-x 1 1000 1000 137 Sep 6 2021 notebook.zim
    -rwxr-xr-x 1 1000 1000 1308 Jan 12 2020 Small_Wood_Projects.txt

    In LibreOffice Writer: Edit -> Selection Mode -> Block Area

    Then I was able to highlight and delete everything up to the date,
    leaving me with this:


    Sep 19 18:25 Countertop
    Jan 14 2020 Countertop.txt
    Sep 20 22:43 cracker.txt
    Sep 19 18:25 Decoupage
    Jan 10 2020 Decoupage.txt
    Sep 19 18:25 Faux_Leather
    Jan 14 2020 Faux_Leather.txt
    Jan 17 2020 Image_Transfer.txt
    Sep 19 18:25 Making_Notebooks
    Jan 9 2020 Making_Notebooks.txt
    Sep 20 22:41 michael@office
    Sep 6 2021 notebook.zim
    Jan 12 2020 Small_Wood_Projects.txt

    Hope this helps. Don't forget to undo: Block Area
    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From Russell Marks@zgedneil@spam^H^H^H^Hgmail.com to alt.os.linux.debian on Thu Sep 21 09:00:13 2023
    From Newsgroup: alt.os.linux.debian

    Richard Owlett <rowlett@cloud85.net> wrote:

    "dir *.msf -t" prints a time ordered list of file with extension "msf".

    I have two problems with result.
    The format is 2 columns, I need a single column.
    I would like to have a modification date associated with each filename.

    https://manpages.debian.org/bookworm/coreutils/dir.1.en.html
    wasn't helpful enough.

    Suggestions?
    TIA

    ls -lt *.msf

    That may give more details than you're really after, but I think it's
    the usual approach.

    -Rus.
    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From Russell Marks@zgedneil@spam^H^H^H^Hgmail.com to alt.os.linux.debian on Thu Sep 21 09:02:16 2023
    From Newsgroup: alt.os.linux.debian

    azigni <azigni@yahoo.com> wrote:

    Okay, this helps. Libre Office Writer has a block edit function that
    lets you choose a "block" of text. I used it to remove the first xxx
    of this text file:

    total 44
    drwxr-xr-x 2 1000 1000 4096 Sep 19 18:25 Countertop
    -rwxr-xr-x 1 1000 1000 151 Jan 14 2020 Countertop.txt
    [...]
    Then I was able to highlight and delete everything up to the date,
    leaving me with this:


    Sep 19 18:25 Countertop
    Jan 14 2020 Countertop.txt

    Generally "ls -l |cut -c 40-" will give something similar, though the
    "40" might need adjusting in some situations.

    -Rus.
    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From Richard Owlett@rowlett@cloud85.net to alt.os.linux.debian on Thu Sep 21 04:57:00 2023
    From Newsgroup: alt.os.linux.debian

    On 09/20/2023 11:39 PM, azigni wrote:
    On 9/20/23 06:32, Richard Owlett wrote:
    "dir *.msf -t" prints a time ordered list of file with extension "msf".

    Not sure where you can go with this, but this is what I use for a
    directory print out:

    ls -n > filename.txt

    This gives me: drwxr-xr-x 2 1000 1000 4096 Sep 19 18:25 Countertop

    I am sure there is an editor that can delete the first xx characters of
    each line. Just a thought.

    *THANK YOU!*
    That lead me to the manual page for "ls" which led to
    https://www.gnu.org/software/coreutils/ls

    Reading that guided me to posing a better question.
    An adequate command for my current need is
    ls *.msf -t -l -n
    As this is a personal machine, everything to the left of file size is an identical string, which allows easy removal.

    That command is not applicable for a slightly more general case as "ls" outputs the clock time [but not year] if the file is less than 6 months
    old. Time for a more detailed reading of "GNU Coreutils".

    Thank you again.




    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From Chris Elvidge@chris@mshome.net to alt.os.linux.debian on Thu Sep 21 11:32:59 2023
    From Newsgroup: alt.os.linux.debian

    On 21/09/2023 10:57, Richard Owlett wrote:
    On 09/20/2023 11:39 PM, azigni wrote:
    On 9/20/23 06:32, Richard Owlett wrote:
    "dir *.msf -t" prints a time ordered list of file with extension "msf".

    Not sure where you can go with this, but this is what I use for a
    directory print out:

    ls -n > filename.txt

    This gives me: drwxr-xr-x 2 1000 1000 4096 Sep 19 18:25 Countertop

    I am sure there is an editor that can delete the first xx characters
    of each line. Just a thought.

    *THANK YOU!*
    That lead me to the manual page for "ls" which led to
    https://www.gnu.org/software/coreutils/ls

    Reading that guided me to posing a better question.
    An adequate command for my current need is
    ls *.msf -t -l -n
    As this is a personal machine, everything to the left of file size is an identical string, which allows easy removal.

    That command is not applicable for a slightly more general case as "ls" outputs the clock time [but not year] if the file is less than 6 months
    old. Time for a more detailed reading of "GNU Coreutils".


    See: --time-style
    E.g. --time-style "+%Y-%m-%d %H:%M:%S"
    --
    Chris Elvidge, England
    I WILL NOT CHARGE ADMISSION TO THE BATHROOM
    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From Richard Owlett@rowlett@cloud85.net to alt.os.linux.debian on Thu Sep 21 07:32:27 2023
    From Newsgroup: alt.os.linux.debian

    On 09/20/2023 07:32 AM, Richard Owlett wrote:
    "dir *.msf -t" prints a time ordered list of file with extension "msf".

    I have two problems with result.
    The format is 2 columns, I need a single column.
    I would like to have a modification date associated with each filename.

    https://manpages.debian.org/bookworm/coreutils/dir.1.en.html
    wasn't helpful enough.

    Suggestions?
    TIA

    To ALL who contributed, thank you.

    The command
    ls *.msf -tln --time-style "+ %m-%d-%Y " |cut -c 23-
    gives the required information in a pleasant human readable format.


    --- Synchronet 3.21d-Linux NewsLink 1.2