CDARGS(1)
π cdargs β from the General Commands Manual, section 1 π
hi bestie!! ok so this is the manual page for cdargs (that's the program, and yes you're reading section 1 of the General Commands Manual). buckle up, it's lowkey iconic π
β¨ NAME β¨
cdargs β bookmarks and browser for the cd shell built-in. periodt. π
β¨ SYNOPSIS β¨
cdargs [OPTIONS]
function cv () {
cdargs "$1" && cd "`cat "$HOME/.cdargsresult"`" ;
}
cv [Needle]
πΈ DESCRIPTION πΈ
okay so with cdargs you can jump to various places throughout the file-system that are defined using a plain text, line oriented bookmarks file. it's giving teleportation but make it shell β¨
you can create bookmarks by:
- editing your bookmarks file
"$HOME/.cdargs"using your favorite editor - using the
--addoption tocdargs - using the built-in mechanism that will be described later
while you're in cdargs you can use various commands to navigate through your list of bookmarks and through the file-system β they're all described below in the section "COMMANDS". the most commonly used and most obvious commands are the up/down keys for navigation, "ENTER" for selection of a path and "q" for quit. (yes bestie, they really are that obvious π)
to be able to actually use this program together with the shell built-in "cd" command, you must use a little trick by defining a shell function. of course the syntax for this is different between the csh-like shells (like tcsh) and the sh-like</sh-like> shells (like bash). π€
for sh-like shells:
function cv () {
cdargs "$1" && cd "`cat "$HOME/.cdargsresult"`" ;
}
for csh-like shells:
alias cv 'cdargs \!* && cd `cat $HOME/.cdargsresult`'
now you only have to put the cdargs binary somewhere into your path. π«Ά
of course you can create functions and/or aliases for different purposes. you might want to add a pwd call to echo your current directories, or put --nowrap in your functions to enable a different scrolling behavior. see section SHELL FUNCTIONS below.
since version 1.19 cdargs brings a collection of bash functions (and since 1.20 tcsh aliases, too) with it. you only have to source this in your ~/.profile or ~/.bashrc (or ~/.tcsh) and you get nice kinds of magic prepared (completion...). please read the cdargs-bash.sh or cdargs-tcsh.csh respectively for the documentation of these functions. the way that it just works π
β¨ COMMAND-LINE OPTIONS β¨
you can call cdargs with a few options, but otherwise you probably won't call it directly β you'll call it via the function you defined.
-hor--helpβ display usage information and exit. bye bestie π-vor--versionβ output version information and exit.-aor--add=[:desc:]pathβ add path to the bookmarks list using the optional desc as description string.-for--file=FILEβ uses the given FILE as bookmarks file-uor--user=USERβ read the default bookmarks file of USER. won't modify that file.-oor--output=FILEβ use FILE as the result-file (who knows what The World might make of this feature that I can't imagine...) π-bor--browseβ startcdargsin BROWSE mode in the current directory.-ror--noresolveβ don't exit with a result when the Needle matches a description exactly (which is some every-day-magic) but show a list (even if it contains just one entry).-cor--cwdβ make the current working directory the current entry on startup if it appears on the list.--nowrapβ don't wrap the cursor around when hitting the end of the list.
π Needle π
the Needle performs some magic which I hope improves the usage of cdargs.
the Needle is examined in the following order and the first thing that fits is taken. π
- if Needle is a one-digit integer the appropriate entry is preselected.
- otherwise if Needle is a string each entry of the list is checked whether it contains Needle.
then Needle has two functions:
- if it just matches a substring of either
pathordescriptionthat option is placed in the list. - if it exactly matches a description string this is the result (that means
cdargscloses the curses window, exits and the changing of directories takes place). - if it doesn't match a line, that line won't be displayed.
and to make things even more complicated you can affect this behavior by using the "--noresolve" option. this option is used when you think you give a Needle which matches descriptions exactly but you don't want it to be resolved if it does. this option is internally turned on when you delete an entry (otherwise the deletion of entries until only one entry is left would lead to resolving) or when the bookmarks file contains only one entry.
finally, if the filtered list (but not the bookmarks file) contains only one entry it is selected and the program exits successfully, unless you chose --noresolve.
I can only hope that you understand this nested if babble... π
please note, that the existence of a Needle disables the saving of the list at the end of the program. no cap, it just does.
π COMMANDS π
when you're in cdargs you have two modes and several commands at your hands. main character energy fr fr.
the two modes are LIST (when your bookmark list is displayed) and BROWSE (when you navigate through the file-system).
the navigation keys are mostly available in Emacs and vi style for all maniacs out there. β¨
π¦ Common Keys
<UP>/<DOWN>ork/jorC-n/C-pβ move selection up/down and scroll.<ENTER>β select current entry.<TAB>β toggle modes: LIST or BROWSE.<HOME>/<END>orC-a/C-eβ goto first/last entry in list.cβ add current directory to list.Cβ add current directory to list but ask the user for a description<PgUp>/<PgDown>orC-vβ scroll the list in 10-line-steps. this will never wraparound and does not honor the nowrap-optione,vβ edit the list in$EDITOR.H,?β show the help-screen.~,/β browse home/root directory.qβ quit β saving the list.C-c,C-g,C-[β abort β don't save the list. π³
π§ Keys in BROWSE mode
<LEFT>,h,C-bβ descent into current directory.<RIGHT>,l,C-fβ up one directory.[num]β make[num]the current highlighted entryaβ add current entry to list.Aβ add current entry to list but ask the user for a description, just like with'c'and'C'..β toggle display of hidden files.
π Keys in LIST mode
[num]β select and resolve entry[num]if displayed.<LEFT>,h,C-bβ descent into the current entry.<RIGHT>,l,C-fβ up one directory from current dir.dorC-dβ delete current entry from list.sortβ swap (transpose) two entries of the list.Mormβ move an entry up or down in the list and set the current position afterwards so that repeated keystrokes keep moving the same entry up and down.
π SHELL FUNCTIONS π
in addition to the shell function mentioned above you might wish to add other commands to your function. one example is to echo the directory you changed to:
function cv () {
cdargs "$1" && cd "`cat "$HOME/.cdargsresult"`"
&& pwd;
}
or you can remove the file in which cdargs reports it's result:
function cv () {
cdargs "$1" && cd "`cat "$HOME/.cdargsresult"`"
&& rm -f "$HOME/.cdargsresult";
}
since version 1.19 cdargs comes with a file of preset functions for bash: see cdargs-bash.sh in the distribution. from now on you only have to source that file if you are using a sh-like shell. then you can use the shell completion to switch directories even faster by typing
cv [TAB]
since version 1.20 cdargs comes with a file of rudimentary aliases (and completion) for the tcsh.
any volunteers for porting all the bash functionality to tcsh are welcome. π₯Ί (please, someone, the tcsh girlies are waiting)
β¨ DISPLAY β¨
the cdargs window has one line at the bottom for the display of messages like when you added to your list or when you hit an unknown key.
the second line from the bottom is a status line which shows the current directory and a one letter code for the current operation mode:
Bβ for BROWSELβ for LIST
the largest part of the display is used to show you either the list of your bookmarks or the contents of the current directory. on the left side you'll probably find a number which you can use for a slightly quicker jumping compared to using the cursor movement. these numbers can be moved as described above. next comes the short description of an entry in brackets. this is convient when you have quite long paths in your bookmarks and most of them start with the same base (e.g. /home/user). finally there is the actual absolute path you'll be warping to when finishing. obviously the current entry is highlighted. π
if the path is preced by a "!" it points to an invalid directory. a bookmark pointing to the current working directory is displayed in bold font (if the terminal emulation understands that attribute). iykyk
π FILES π
/usr/bin/cdargsβ thecdargsexecutable.$HOME/.cdargsβ personal bookmarks file.$HOME/.cdargsresultβ temporary file for passing results to shell./usr/share/doc/cdargs/examples/cdargs-bash.shβ example collection of bash functions./usr/share/doc/cdargs/examples/cdargs-tcsh.cshβ example collection of tcsh functions./usr/share/emacs/site-lisp/cdargs.elβ (X)Emacs front-end to personal bookmarks file
π₯ REPORTING BUGS π₯
report bugs to <mail@skamphausen.de>. bestie will hear you out fr fr π«Ά
π AUTHOR π
cdargs was written by Stefan Kamphausen with add-ons by Claus Brunzema. many user-interface improvements came from Dan Allen. iconic trio, honestly β¨
π SEE ALSO π
the current version of cdargs is located at
http://www.skamphausen.de/software/cdargs
you might want to visit that site. other than that pressing the 'H' key in cdargs fires up a help screen.
π COPYRIGHT π
Copyright Β© 2001-2003 Stefan Kamphausen
cdargs 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.
you should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
okay that's literally the whole page bestie π this version dropped back in March 2002 (yes it's vintage, yes it's still serving), and it's page 1 of the manual β CDARGS(1), mwah. go bookmark something. πβ¨π¦
π¦ where this page comes from
- debian bookworm: cdargs 1.35-12 Β· GPL-2.0-or-later
- debian trixie: cdargs 1.35-12 Β· GPL-2.0-or-later
- ubuntu jammy: cdargs 1.35-12build1 Β· GPL-2.0-or-later
- ubuntu noble: cdargs 1.35-12build1 Β· GPL-2.0-or-later
- ubuntu resolute: cdargs 1.35-12build2 Β· GPL-2.0-or-later
- ubuntu stonking: cdargs 1.35-12build2 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms