Skip to content

SNOW-1905965: Add wildcard support in file ls#606

Merged
sfc-gh-pkowalewski merged 3 commits intomainfrom
pkowalewski-support-wild-card-in-ls
Dec 22, 2025
Merged

SNOW-1905965: Add wildcard support in file ls#606
sfc-gh-pkowalewski merged 3 commits intomainfrom
pkowalewski-support-wild-card-in-ls

Conversation

@sfc-gh-pkowalewski
Copy link
Copy Markdown
Collaborator

@sfc-gh-pkowalewski sfc-gh-pkowalewski commented Dec 16, 2025

Added a feature that will make the following file ls patterns possible:

  • '*' matches any sequence of non-Separator characters
  • '?' matches any single non-Separator character
  • '[aml]' matches any single character within the brackets
  • '[a-f]' matches any single character within the range specified in the brackets

Example: file ls "/var/logs/?[1-3]*.log" will match and output

  • /var/logs/a1.log
  • /var/logs/b3.log
  • /var/logs/z1lalala.log

Tested on remote VM that the old and new functionality behaves as expected
Commands tested:

sanssh --target $TARGET --proxy $PROXY file ls "/var/log/[k-y]*"
sanssh --target $TARGET --proxy $PROXY file ls "/var/log/[ky]*"
sanssh --target $TARGET --proxy $PROXY file ls "/var/log/???log"
sanssh --target $TARGET --proxy $PROXY file ls "/var/log"

Added a feature that will make the following ls patterns possible:
* '*' matches any sequence of non-Separator characters
* '?' matches any single non-Separator character
* '[aml]' matches any single character within the brackets
* '[a-f]' matches any single character within the range specified in the brackets
Comment thread services/localfile/server/localfile.go Outdated
@sfc-gh-pkowalewski sfc-gh-pkowalewski marked this pull request as ready for review December 16, 2025 10:29
Comment thread services/localfile/server/localfile.go Outdated
Copy link
Copy Markdown
Collaborator

@sfc-gh-mwojtczak sfc-gh-mwojtczak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for making this change.

Before merging, could you please test on a test server to ensure the functionality is working end2end as expected and add a short description of what was tested to the PR?
Thanks

@sfc-gh-mwojtczak
Copy link
Copy Markdown
Collaborator

Maybe worth adding that this feature is supported in the client command description?

func (*lsCmd) Usage() string {
return `ls [--long] [--directory] <path>:
List the path given printing out each entry (N if it's a directory). Use --long to get ls -l style output.
If the entry is a directory it will be suppressed from the output unless --directory is set (ls -d style).
NOTE: Only expands one level of a directory.
`
}

@sfc-gh-pkowalewski sfc-gh-pkowalewski merged commit 5b840fe into main Dec 22, 2025
6 checks passed
@sfc-gh-pkowalewski sfc-gh-pkowalewski deleted the pkowalewski-support-wild-card-in-ls branch December 22, 2025 14:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants