locate j*.vim doesn't work? - locate

I've read the locate man page and searched this site, but I don't see how to do this:
I'm looking for all *.vim files starting with j. How can I use locate to achieve this?
[docker#docker1 ~]$ locate java.vim
/usr/share/vim/vim74/ftplugin/java.vim
/usr/share/vim/vim74/indent/java.vim
/usr/share/vim/vim74/syntax/java.vim
[docker#docker1 ~]$ locate "j*.vim"
[docker#docker1 ~]$

You have to use find command.
Just type find -name "j*.vim" and you will get expected search result.

I found the answer here, and it's simple. Locate stores the whole path, so you need a wildcard on BOTH sides on your search terms:
docker#docker1:~$ locate '*jav*.vim'
/usr/share/vim/vim74/autoload/javascriptcomplete.vim
/usr/share/vim/vim74/compiler/javac.vim
/usr/share/vim/vim74/ftplugin/java.vim
You can, of course, also resort to regular expressions:
docker#docker1:~$ locate -r 'jav.*.vim'
/usr/share/vim/vim74/autoload/javascriptcomplete.vim
/usr/share/vim/vim74/compiler/javac.vim
/usr/share/vim/vim74/ftplugin/java.vim

Related

Need help to write a basic Command Line code

I'm using Windows 10 if it matters and I'm trying to feed a file to the "oeminst" app that will convert this file from .EDR to .CCSS. According to the app's website its usage summary is this:
oeminst [-options] [inputfiles]
-v Verbose
-n Don't install, show where files would be installed
-c Don't install, save files to current directory
-S d Specify the install scope u = user (def.), l = local system]
infile Manufacturers setup.exe install file(s) or .dll(s) containing install files
infile.[edr|ccss|ccmx] EDR file(s) to translate and install or CCSS or CCMX files to install
If no file is provided, oeminst will look for the install CD.
more info can be found here https://www.argyllcms.com/doc/oeminst.html
So far I tried this code:
C:\Users\PC>oeminst infile. [C:\Users\PC\testfile.edr]
oeminst: Error - Unable to load file 'infile [C:\Users\PC\testfile]'
I'd appreciate if someone at least could tell me if I'm doing it right or not.
P.S. sorry for the messed up text. Not sure how to fix it. It looks good in editing mode.
Try this : oeminst infile.edr C:\Users\PC\testfile.edr
Nevermind, I got it.
C:\Users\PC>oeminst C:\Users\PC\testfile.edr

Is there a documentation about "Config_heavy.pl" keys?

After installing perl you can find a Config_heavy.pl file e.g. in /usr/lib/perl5/5.18/mach/Config_heavy.pl and I wonder if there is a commentation of all key/value pairs one can find in it. The of them are clear, but sometimes I'm not sure.
Calling perl -V shows all these values in there.
I guess what I really want to know is, which values are really 'hard', because not only in this file so a change would have no effect, an which have an effect after change? E.g. which can I change to have an effect in CPAN like adding a '-I.' to the ccflags to have CPAN searching for local headers included with <> instead of "" (you can find this in Authen::PAM ;) ).
So if there is some more information do find about the keys in this file, I would be happy to learn about them.
From the command line,
perldoc Config
You shouldn't change that file.
I think the following will do the trick to install Authen::PAM:
wget http://search.cpan.org/CPAN/authors/id/N/NI/NIKIP/Authen-PAM-0.16.tar.gz
tar xvzf Authen-PAM-0.16.tar.gz
cd Authen-PAM-0.16
perl Makefile.PL CCFLAGS='-I.'
make test
make install

Syntax of Wget for windows

Does anybody know syntax for wget command in windows. I tried its basic syntax but the problem is file gets downloaded in the directory on which I have opened command prompt. I want to know whether we can explicitly specify destination in its command. If possible then let me know that would be much helpful for me.
If anyone reading this wants to save files downloaded to a directory, use "-P".
Example:
wget LINKHERE -P %USERPROFILE%/Downloads
This saves whatever is served by your link to C:\Users\username\Downloads.
According to the manual -O, --output-document=FILE write documents to FILE.
So you must give a file name after a valid directory as such:
C:\cronjobs>wget -q -O C:\Users\Public\Documents\tmp1.txt "http://google.com/"
note: -q option is to say quiet but -O is to say save file to a given file name and it will work!
Sure you can.
Use the -O syntax, and the path to use.
I've just tested this with:
C:\users\julien>wget google.com -O "C:\here.html"
And "here.html" was google's index page on the root of my "C:" drive

How to use Google's Sparse Hash

In my project, I am asked to use Google's Sparse Hash. But I don't even know where to start. These are steps that I take and do not get my code even compiled:
The sparsehash-1.11 code is in the same directory with where my code is.
I typed "#include " at the beginning of my code.
The error is
Multiple markers at this line
- fatal error: google/sparse_hash_map: No such file or directory
- Unresolved inclusion: <google/sparse_hash_map>
I really don't know what to do. Waiting for your helps.
Sorry if this is obvious, but if your google hashmap source is already in the same directory as your code is, you should probably try:
#include "sparse_hash_map"
instead of
#include <google/sparse_hash_map>
Worse case, include -I</directory/to/google/sparse_hash_map> in your compile command line.
Good luck!
You could locate sparse_hash_set in your computer ( locate sparse_hash_set ) and create a symbolic link from the directory where sparse_hash_set is installed to google/sparse_hash_map.
test#ubuntu:~# updatedb # To update the locate database
test#ubuntu:~# locate sparse_hash_map
/usr/include/google/sparsehash/sparse_hash_map
test#ubuntu:~# ln -s /usr/include/google/sparsehash/sparse_hash_map /usr/include/google/sparse_hash_map

using grep and find commands - basic questions to help me sort it out in my simple mind

I am back with a second no-brainer question, but I would like to get this straight in my head.
I have an assignment in which I am charged with providing a command to find a file named test in my home directory (one command using find, and one using grep). I understand that using find is just 'find ~/test', but using grep, wouldn't I have to search out a pattern within the file 'test'? Or is there a way to search for the file (using grep), even if the file is empty?
ls ~ | grep test
I understand that using find is just 'find ~/test'
No. find ~/test will also have a match for every file or directory under the directory $HOME/test/. Rather use find ~ -type f -name test.
The assignment sounds unclear. But yes, if you give any filenames to grep, it will look at the contents of the files and ignore the names of the files. Perhaps you can grep the output of another command? Maybe ls as #Reese suggested, or maybe a different find command.
ls -R ~ | grep test
Explanation: ls -R ~ will recursively list all files and directories in your home folder. grep test will narrow down that list to files (and directories) that have "test" in their name.