github.com/lmorg/murex@v0.0.0-20240217211045-e081c89cd4ef/builtins/core/io/f_doc.yaml (about)

     1  - DocumentID: f
     2    Title: >+
     3      `f`
     4    CategoryID: commands
     5    Summary: >-
     6      Lists or filters file system objects (eg files)
     7    Description: |-
     8      `f` lists or filters lists of file system objects, such as files, directories,
     9      etc. `f` provides a quick way to output file system items that confirm to
    10      specific criteria.
    11  
    12      You define this criteria by using +flags (eg `+s` for all symlinks) and
    13      optionally then restricting that criteria with -flags (eg `-x` to remove all
    14      executable items). All flags supported as `+` are also supported as a `-`.
    15  
    16      By default `f` will return no results. You need to include +flags.
    17  
    18      Output is a JSON array as this format preserves whitespace in file names.
    19    Usage: |-
    20      ```
    21      f options -> <stdout>
    22  
    23      <stdin> -> f options -> <stdout>
    24      ```
    25    Examples: |-
    26      Return only directories:
    27  
    28      ```
    29      f +d
    30      ```
    31  
    32      Return file and directories but exclude symlinks:
    33  
    34      ```
    35      f +fd -s
    36      ```
    37  
    38      Filter out files in a list (eg created by `g`) using conditions set by `f`:
    39  
    40      ```
    41      g '*.go' -> f +f
    42  
    43      rx '\.(txt|md)' -> f +fw
    44      ```
    45    Flags:
    46      -: "exclude files (pair this with any other flag apart from `+`)"
    47      +: "include files (pair this with any other flag apart from `-`)"
    48  
    49      f: all files (inc symlinks, devices, sockets, name pipes, etc)
    50      F: regular files (exc symlinks, devices, sockets, named pipes, etc)
    51      d: all directories (inc symlinks)
    52      D: regular directories
    53      s: symlinks
    54      l: symlinks
    55      b: block devices
    56      c: character devices
    57      S: sockets
    58      p: POSIX named pipes (FIFO)
    59      i: irregular files (nothing else is known about these files)
    60      "?": deprecated -- use `i` instead
    61  
    62      r: read permissions (user, group, or other)
    63      R: user read permissions
    64      e: group read permissions
    65      E: other read permissions
    66  
    67      w: write permissions (user, group, or other)
    68      W: user write permissions
    69      q: group write permissions
    70      Q: other write permissions
    71  
    72      x: execute permissions (user, group, or other)
    73      X: user execute permissions
    74      z: group execute permissions
    75      Z: other execute permissions
    76  
    77    Detail: |-
    78      `+` flags are always matched first. Then the `-` flags are used to filter out
    79      any matches from the `+` flags.
    80    Synonyms:
    81    Related:
    82      - g
    83      - rx
    84      - json