App::MarkFiles - some utility functions for marking and operating on files
# This module: use App::MarkFiles qw(get_dbh each_path add remove); my $dbh = get_dbh(); # db handle for marks.db add('/foo/bar', '/foo/baz'); remove('/foo/baz'); each_path(sub { my ($path) = @_; print "$path\n"; }); # mark commands: $ mark add foo.txt $ cd ~/somedir $ mark mv
$ perl Build.PL $ ./Build $ ./Build install
The mark utilities store a list of marked file paths in marks.db in the user's home directory. Once marked, files can be copied, moved, listed, or passed as parameters to arbitrary shell commands.
This originated as a simple tool for collecting files from one or more directories and moving or copying them to another. A basic usage pattern looks something like this:
$ cd ~/screenshots $ mark add foo.png $ cd ~/blog/files/screenshots $ mark mv Moved: /home/brennen/screenshots/foo.png
This is more steps than a simple invocation of mv(1), but its utility becomes more apparent when it's combined with aliases for quickly navigating directories or invoked from other programs like editors and file managers.
See bin/mark in this distribution (or, when installed, the mark(1) man page) for details on the commands.
bin/mark
Get database handle for default marks database, stored in ~/marks.db.
Creates a new marks.db with the correct schema if one doesn't already exist.
Create a new marks table.
Add a mark to one or more paths.
Remove all given paths from the mark list.
Run an anonymous function against each item in the mark list.
Expects a sub which takes a path string.
Copyright 2018 Brennen Bearnes
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. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
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.