Skip to content

Instantly share code, notes, and snippets.

@minademian
Created January 14, 2017 00:50
Show Gist options
  • Save minademian/28f641709469d02f8cdf66246508c63c to your computer and use it in GitHub Desktop.
Save minademian/28f641709469d02f8cdf66246508c63c to your computer and use it in GitHub Desktop.
sanitize Linux directory listing
# Sanitize a Linux directory listing so that it shows files, directories, and contents of subdirectories
# useful for sending a listing in an email, IM message, or online
^\-?[a-z]+(\s) # directory bit and file permissions
[0-9]{1}(\s) # directory counter, shows how many subdirectories this file has.
[a-z]+\s # owner
[a-z]+\s+ # group
[0-9]+\s+ # filesize
[a-z]+\s+[0-9]+\s+
[0-9]+:?[0-9]+\s # date, last updated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment