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
else
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
fi

}

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]+> -------------- dir to mark[x] where is x is the index
dir <name> ---------------- dir to mark where key=<shortname>
dir -a <name> <path> ------ add new mark
dir -d <name>|[0-9]+ ------ delete mark
dir -u <name> <path> ------ update mark
dir -m <name> ------------- add mark for PWD
dir -p <name> ------------- prints mark

Usage example

majam@dirose:~$ dir -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@dirose:~$ dir 1
majam@dirose:/net/xen/mnt/sdb1/majam/aMule/Incoming$ 

majam@dirose:/etc/init.d$ dir majam
majam@dirose:/net/xen/mnt/sdb1/majam$ 

majam@dirose:~$ dir -d 2
majam@dirose:~$

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.7.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dirmarks-0.1.7-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file dirmarks-0.1.7.tar.gz.

File metadata

  • Download URL: dirmarks-0.1.7.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.0 CPython/3.12.8 Darwin/24.4.0

File hashes

Hashes for dirmarks-0.1.7.tar.gz
Algorithm Hash digest
SHA256 c0b768833d4e6a521ec52cb3ce1b06ff8c9cbd92ed6222595d826ed0a5461bde
MD5 80d5383ef982ca8d5ab40e3dc71158a5
BLAKE2b-256 76b3ae84c8c593d5b549c4f8c2898623cdf8e6164481e8f0c47369d7a905a2a5

See more details on using hashes here.

File details

Details for the file dirmarks-0.1.7-py3-none-any.whl.

File metadata

  • Download URL: dirmarks-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 5.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.0 CPython/3.12.8 Darwin/24.4.0

File hashes

Hashes for dirmarks-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 3391ed1fbe051d31e39d46bddbf280c076debcc33a1f559f552c40ddc3d55d02
MD5 9128e18ff90fc2a73d7a1db548f4a537
BLAKE2b-256 1ca1f53de7bcfddad18a4ed217f1459962fe0e8fef75a2e3c451639c54584945

See more details on using hashes here.

Supported by

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