mark - a tool for marking and acting on file paths
mark add <path> # Add a file path to the mark list mark remove <path> # Remove a file path from the mark list mark clear # Remove all marks from list mark ls # List current marks mark ls-print0 # List current marks, separated by NUL chars mark cp # Copy marked files to current directory mark mv # Move files to current directory and unmark mark each <command> # Execute command with each marked file as parameter mark -h # Print help message
mark stores a list of marked file paths in an SQLite database called marks.db in the user's home directory. Once marked, files can be copied, moved, listed, or passed as parameters to arbitrary shell commands.
Commands are intended to be invoked as subcommands of mark(1), in the style of git(1).
Add one or more paths to the mark list. Relative paths will be stored by their absolute location. Repeated commands are idempotent - a path can only appear once in the mark list.
Remove one or more paths from the mark list. Relative paths will be resolved to their absolute location before the list is searched.
Clear the entire mark list.
List all currently marked paths, one line per path.
List all currently marked paths, separated by null characters, for use when piping to xargs -0 or other commands which expect null-terminated file lists. Analogous to find -print0. This is useful where filenames contain whitespace, quotes, etc.
xargs -0
find -print0
Copy all marked paths to the current working directory.
Move all marked paths to the current working directory, and remove them from the mark list.
Execute the provided command once per marked path, with the path as a parameter, and print any output from the command.
This is crudely analogous to xargs. While good enough for simple commands, it's likely to break in more complex cases, and may be slow for large mark lists. Consider using mark-ls-print0(1) and xargs(1) instead.
xargs
App::MarkFiles
mark is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
Brennen Bearnes
To install App::MarkFiles, copy and paste the appropriate command in to your terminal.
cpanm
cpanm App::MarkFiles
CPAN shell
perl -MCPAN -e shell install App::MarkFiles
For more information on module installation, please visit the detailed CPAN module installation guide.