Skip to content

QuickStart

Ravi J edited this page Dec 17, 2020 · 10 revisions

There are about 75+ options to play with. Some of the most important ones demonstrated here. For all the available options, please read the section Options in the [manual]

At the CLI use man qkw will provide the options to construct a functional set.

To learn more, on how to set up macros and other advanced use cases on how to make the most of qkw, please consult the [manual]

The core option set

  • add
  • delete
  • modify
  • search

  • Get help
qkw -h <option_string>

# Egs
qkw -h -T -cC
qkw -h -D -lA
  • Create two tables
qkw -T -cC cmd_1
qkw -T -cD dir_1
  • List the tables, and their types
qkw -T -lA
  • Add the tables to config file.
qkw -cfgfile
  • Content retrieval, gets data from the second column or V-column based on labels/tags
# only one label taken
qkw -gC <label> # C-tables
qkw -gD <label> # D-tables
  • Visit a few directories and add labels
# current directory information 
qkw -addpath p1  # in dir /a/b/c
qkw -addpath p2  # in dir x/y
  • Add content to the tables manually as label:directory_path strings
# directories, D tables
# labels can have additional characters for modularity
# and easy to remember
qkw -iD m.x:"/u/v/w/x"
qkw -iD m.p:"/u/v/w/x/p"
qkw -iD n:"/q/r"

# commands, C tables
qkw -iC devpush:"git push origin dev"
qkw -iC open:"vi /path/to/my/todo/list.txt"
  • Check the added content D:directories, C:commands
qkw -D -lA
qkw -C -lA
  • Bulk Changes: export/import/removing/modifying data via a file.
# template file with fields to populate information
# label,value,expl fields
qkw -gettemplate cmdinput.data 

# write to a file when labels are provided
qkw -C -if cmdoutput.data <L,L...,L> # L:labels

# write from file to the database
qkw -C -wf cmdinput.data

# add modified data from file, should have existing label
# helps when you have changes to make or reuse with variations
qkw -C -mf cmdinput.data

# delete the modified data from file, label should exist
# rest of the fields are ignored
qkw -C -df cmdinput.data

# same operations work for dir tables, but with different format
# since the format is "label:directory_path", one per line
# NOTE: -gettemplate option doesn't work for dir tables
qkw -D -if dirinput.data
qkw -D -mf dirinput.data
qkw -D -df dirinput.data
qkw -D -wf diroutput.data <L,L...,L>  # L:labels
  • Check the added data
qkw -C -lA
  • Add the macros cd2:navigation, and runfast:command execution in your bashrc or it's equivalent
# navigation
cd2(){
  cd `qkw -gD $1`
}

# command execution
runfast(){
  eval `qkw -gC $1`
}

source ~/.bashrc and start using the tags

# takes you to directory /u/v/w/x
cd2 m 
# will run your the tagged lss commands
runfast lss 

Search for information by tag

# "cmd" tables
qkw -sC <regex>

# "dir" tables
qkw -sD <regex>
Clone this wiki locally