How to? Name completion only of directories?

May 20, 2009
293
5
57
ITALY
I am in a directory called for example "F:\Provider\Cisco\".
Inside it I have many files, all that start with "AnyConnect*", and also a directory called "anyconnect-win-3.1.10010-pre-deploy-k9", as You can see below there are many files.
Now, I want for example to see what is inside the directory.
I type "dir anyconnect" and then press TAB.
I have to press it many times, since it finds first all files, and only at the end it finds the directory.
Is there a way, for example with ctrl+alt+shift+tab, or an option, to expand names only for directories and not for files?
Right now I cannot find any.
I can use a workaround, for example I cd into the directory and then I type dir.
Or, I type "cd anyconnect" and then press TAB.
Since I have the option that for cd it completes only directories, I get immediately the directory and skip files.
Then, I go back on the command-line and change from cd to the command that I want to use.
But, I would like better a key combination to expand only directories.


Thank You and regards

Rodolfo Giovanninetti


Volume in drive F is unlabeled Serial number is 00bd:629b
Directory of F:\PROVIDER\cisco\*

03/09/2015 11:23 <DIR> .
03/09/2015 11:23 <DIR> ..
02/09/2015 15:42 <DIR> anyconnect-win-3.1.10010-pre-deploy-k9
02/09/2015 16:39 247.696 anyconnect-EnableFIPS-win-3.1.10010.exe
02/09/2015 16:39 10.240 anyconnect-EnableFIPS-win-3.1.10010.mst
02/09/2015 16:39 581.000 anyconnect-gina-win-3.1.10010-pre-deploy-k9-lang.zip
02/09/2015 16:39 581.003 anyconnect-gina-win-3.1.10010-web-deploy-k9-lang.zip
02/09/2015 16:39 85.426 anyconnect-linux-3.1.10010-EnableFIPS.tar.gz
02/09/2015 16:38 12.122.817 anyconnect-linux-3.1.10010-k9.pkg
02/09/2015 16:38 7.232.810 anyconnect-linux-3.1.10010-vpnapi.tar.gz
02/09/2015 16:38 82.983 anyconnect-linux-64-3.1.10010-EnableFIPS.tar.gz
02/09/2015 16:38 12.718.496 anyconnect-linux-64-3.1.10010-k9.pkg
02/09/2015 16:38 7.531.051 anyconnect-linux-64-3.1.10010-vpnapi.tar.gz
02/09/2015 16:37 79.863 anyconnect-macosx-i386-3.1.10010-EnableFIPS.tar.gz
02/09/2015 16:37 9.573.720 anyconnect-macosx-i386-3.1.10010-k9.dmg
02/09/2015 16:37 12.722.977 anyconnect-macosx-i386-3.1.10010-k9.pkg
02/09/2015 16:37 6.463.026 anyconnect-macosx-i386-3.1.10010-vpnapi.tar.gz
02/09/2015 16:37 9.051.855 anyconnect-predeploy-linux-3.1.10010-k9.tar.gz
02/09/2015 16:37 9.605.229 anyconnect-predeploy-linux-64-3.1.10010-k9.tar.gz
02/09/2015 16:36 4.120.576 anyconnect-profileeditor-win-3.1.10010-k9.msi
20/06/2013 12:08 1.868.864 anyconnect-win-2.5.3046-web-deploy-k9.exe
02/09/2015 16:36 38.409.858 anyconnect-win-3.1.10010-k9.pkg
02/09/2015 16:35 585.681 anyconnect-win-3.1.10010-pre-deploy-k9-lang.zip
02/09/2015 16:35 23.244.800 anyconnect-win-3.1.10010-pre-deploy-k9.iso
02/09/2015 16:34 585.661 anyconnect-win-3.1.10010-web-deploy-k9-lang.zip
02/09/2015 16:34 75.264.810 anyconnect-win-vpnapi-3.1.10010.zip
02/09/2015 16:33 814.121 sampleTransforms-3.1.10010.zip
02/09/2015 16:33 47.130 thirdparty_3.1.10010_3eTI_Docs.zip
233.631.693 bytes in 25 files and 3 dirs 233.672.704 bytes allocated
3.262.488.576 bytes free
 
Jun 2, 2008
376
2
Newton, MA
You could define an alias, for example DIRD, that runs the DIR command, but you could configure it the way you did CD to file-complete only directories.

-- Jay
 

samintz

Scott Mintz
May 20, 2008
1,503
16
Solon, OH, USA
Yes, what Jay said. Add DIRD to your FILECOMPLETION environment variable (e.g. set FILECOMPLETION=cd cdd rd dird:DIRS) or in your configuration file. And add a DIRD alias. Or if you are a lazy typist like me, name it DD instead of DIRD.

Code:
set FILECOMPLETION=cd cdd rd dd:DIRS
alias dd=dir

DIR<tab> will cycle through all the names
DD<tab> will only cycle through the directory names
 
Jun 2, 2008
376
2
Newton, MA
Scott, I used DIRD in the example because, like you, I'm a lazy typist, which means that I already had an alias DD that does something that I need a lot more often that what was asked for here. And then, of course, there's the alias D, which is what I use for the DIR command with my favorite options.:smile:
 
Similar threads
Thread starter Title Forum Replies Date
vefatica LIBRARY and file name completion? Support 4
H file name completion on tcc21.01.61 Support 4
Joe Caverly How to? Get name of current LIBRARY function? Support 4
vefatica Command name mix-up Support 3
Jay Sage Command Will Not Run Using Short Name of Path Support 5
Chen Touboul When i try to delete an empty folder i got "the dirctoy name is invalid" Support 3
vefatica PLAYSOUND requires 8-dot-3 name? Support 8
R Tree on FAT32 does not sort by name by default. Support 6
vefatica START /PGM "name with spaces.URL" fails Support 2
vefatica Can TCC complete this file name? Support 5
thorntonpg option /u not working The directory name is invalid Support 5
Dmitry L. Kobyakov WAD Start /pgm "name.htm" works improperly Support 4
vefatica Array name in a variable? Support 3
E My echo full file name to the clipboard fails now. Support 2
Joe Caverly @NAME supports library functions Support 2
C See if a file name matches extended range. Support 15
vefatica Two @FUNCTIONs/aliases with the same name Support 4
x13 Function to get interface user-defined name? Support 10
nickles Command name parsing of GNU compilers Support 13
M Registered to machine-name? Support 7
P Rename files with ampersand in the name Support 1
mdwyer TCC 13 COPY: specified network name is no longer available. Support 5
I "IF" command in a variable does not expand redirection variable name Support 0
nickles Fixed Executing long command lines in a batch generates file name errors Support 16
Jay Sage Short File Name Won't Execute Support 4
rps Fixed V17 @name adding quote (") to result Support 5
vefatica FFIND /S, find directory with specified name? Support 7
jbanaszczyk Alias with space in the name Support 3
tmaynard Invalid item name "Lua" Support 6
MickeyF how to work with env var with special characters in the name Support 5
nickles WAD Variable name gets changed within FOR loop Support 2
B Why Does @GETDIR Repeat Selected Directory Name In Returned Value Support 7
noahcoad Fixed Can't @iniread a section w quotes in the name Support 6
M A UNC name failure... Support 28
M Why is an obviously invalid file name allowed? Support 2
T TCC reading TCMD.INI causing "Invalid item name" warnings and pauses Support 2
C start /wait /pgm "program name" ^ ketstack n/w Support 3
J Tab-Complete annoyance when directory name and file basename match and tab on '.' Support 1
vefatica START /DESKTOP="name with space" ... Support 4
S WAD PDIR: files with percent sign % in name cause not listing other files in directory Support 9
C sendmail TO name? Support 9
cgunhouse ProcessMonitor Does Not Work With Quoted Process Name Support 5
cgunhouse ProcessMonitor Does Not Work With Quoted Process Name Support 0
D Copy directory tree without repeating directory name Support 32
L How to easily cd to \users\name? Support 8
D unzip /d in directory with space in name Support 1
S Listing the paths of all directories of a given name Support 4
G Copy a file to unknown directory name Support 5
J How to use RegQuery for value with \name Support 2
M Is bash-like filename completion possible? Support 3

Similar threads