Skip to main content

Bookmarks for the filesystem

Project description

= Dirmarks Dirmarks is a directory bookmarking tool that allows you to easily manage, navigate, and switch between directories using bookmarks. This tool can save you time and make working with the command line more efficient.

== Installation Install the Markdirs package using pip:

pip install dirmarks

== Shell Function Setup To enable the dir command for changing directories using bookmarks, add the following shell function to your .profile, .bashrc, or .zshrc file, depending on your shell:

#!/bin/bash
dir() {
if [ "$#" -eq 0 ]; then
    dirmarks list
    exit $?
fi
OPT=$1;
shift;
case $OPT in
        -l)
        dirmarks list
        ;;
        -h)
        dirmarks help
        ;;
        -d)
        dirmarks delete $1
        ;;
        -m)
        dirmarks add $1 $PWD
        ;;
        -u)
        dirmarks update $1 $2
        ;;
        -a)
        dirmarks add $1 $2
        ;;
        -p)
        GO=`dirmarks get $1`;
        if [ "X$GO" != "X" ]; then
                echo $GO;
        fi
        ;;
        *)
        GO=`dirmarks get $OPT`;
        if [ "X$GO" != "X" ]; then
                cd $GO;
        fi
        ;;
esac
}

Or add a file .functions in your home directory and source it in .bashrc

echo "source ~/.functions" >> ~/.bashrc

== Setup dirmarks for all users

mkdir -p /etc/bash.functions 
cp data/marks.function /etc/bsh.fucntions
Append the following line in /etc/bash.bashrc

if [ -d /etc/bash.functions ]; then for i in /etc/bash.functions/*;do source $i done fi


== Usage:

dir -h ------------------ prints this help dir -l ------------------ list marks dir <[0-9]+> -------------- gm to mark[x] where is x is the index dir ---------------- gm to mark where key= dir -a ------ add new mark dir -d |[0-9]+ ------ delete mark dir -u ------ update mark dir -m ------------- add mark for PWD dir -p ------------- prints mark


== Usage example

majam@dirose:~$ gm -l 0 => meirm:/net/xen/mnt/sdb1/meirm 1 => edonkey:/net/xen/mnt/sdb1/majam/aMule/Incoming 2 => init:/etc/init.d 3 => majam:/net/xen/mnt/sdb1/majam

majam@gmose:~$ gm 1 majam@gmose:/net/xen/mnt/sdb1/majam/aMule/Incoming$

majam@gmose:/etc/init.d$ gm majam majam@gmose:/net/xen/mnt/sdb1/majam$

majam@gmose:$ gm -d 2 majam@gmose:$


Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dirmarks-0.1.0.tar.gz (3.0 kB view hashes)

Uploaded Source

Built Distribution

dirmarks-0.1.0-py3-none-any.whl (4.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page