How to zip a list of files of the same type using jar command - command-line

I have a folder on my computer at the following path:
/path/to/folder/
This folder contains a subfolder and many cvs files
folder/subfolder
folder/1.cvs
folder/2.cvs
...
folder/n.cvs
Now, I would like to be able to zip all the .cvs files into one .zip file using the jar command (long story...)
The best I could come up with is:
jar -cvfM output.zip -C /path/to/folder .
This works, but inside output.zip I also see the subfolder, is there any way to avoid it? I tried using the * wildcard like this:
jar -cvfM output.zip -C /path/to/folder *.cvs
But it doesn't work.
Is it possible?
Thanks in advance

Related

Is there a way to archiving using 7 zip CLI and exclude a particular folder using full paths?

I am on windows 10, and I'm struggling to exclude a directory from archive using the 7z CLI
Archive directory: D:/
zip file: C:/users/hamster/desktop/archive.zip
exclude folder: D:/movies
Command:
C:\Program Files\7-Zip\7z.exe a -mhe -p{password} c:/users/hamster/desktop/archive.zip D:/ -x!D:/movies
7z still archives the movies directory. Any help is appreciated.
I found that the -x flag only works with relative paths by default. I included the -spf2 flag to allow full paths. I also added the * wildcard to capture all files and folders within the directory.
So the new command is as follow:
C:\Program Files\7-Zip\7z.exe a -mhe -p{password} -spf2 c:/users/hamster/desktop/archive.zip D:/ -x!D:/movies/*

How to run `forest schema:update` outside project directory?

I'm trying to use the forest-cli schema:update command, but when I do, I keep getting the error:
× We are not able to detect a Forest CLI project file architecture at this path: /PATH/TO/REPO/ROOT.: Error: No "routes" directory.
There is a routes directory, but within src/ below the repo root. I have tried running forest schema:update from inside there, but I get the exact same error. The command only has options for a config file and an output directory.
Googling has turned up nothing, and there's no obvious hint from forestadmin's documents. Thanks in advance for any assistance!
According to the forest-cli code available here, the forest schema:update command requires the package.json file to be directly accessible in order to run (In the same folder you run the command), to check that the version of the agent you are running is indeed compatible with schema:update.
You can also use the -c/--config option in order to use another location of your config/database.js, and the -o/--outputDirectory to output the result to a new location.
In your case, I would say that forest schema:update -c src/config/database.config.js -o tmp should allow you to generate the files in the tmp directory (Be aware that this directory should not exist).
This command should be run where your package.json is located.
However, I don't think you will be able to export files directly at the right location when using a custom folder structure.

command copy in command promt

ok I know this a really generic question but I nedd to copy a folder from command promt (I'm creating a .bat archive) but I can't make it work can somebody help me at least with the syntax. Thanks!!
In your .bat file first make the folder you want to copy to (if it doesn't exist)
mkdir destinationFolder
then copy files
copy soureFolder destinationFolder

Where are Doxygen output files put?

I have just run Doxygen from the command line and am unsure where it put it...
It doesn't show up in the directory I ran it from
Is there an easy way to find it?
From the Doxygen manual:
The default output directory is the directory in which doxygen is started. The root directory to which the output is written can be changed using the OUTPUT_DIRECTORY. The format specific directory within the output directory can be selected using the HTML_OUTPUT, RTF_OUTPUT, LATEX_OUTPUT, XML_OUTPUT, and MAN_OUTPUT tags of the configuration file. If the output directory does not exist, doxygen will try to create it for you (but it will not try to create a whole path recursively, like mkdir -p does).
If you are having some problems getting it to do what you want use doxywizard it makes writing the configuration file much easier.

How to move a file in to zip uncompressed, with zip cmd tool

I'm try to determine how to use the zip cmd line tool to move a file (uncompressed) in to a zip of compressed files (ie I want a zip in the end with all files but one compressed, b/c the one file is another compressed file).
Anyone know how to do this?
It looks like you could use -n option to just store the files with defined extensions together with -g option to append the file to archive.
I didn't test it, but something like this should do the trick:
zip -gn .foo archive.zip myAddedFile.foo
Although documentation states that, by default, zip does not compress files with extensions in the list .Z:.zip:.zoo:.arc:.lzh:.arj, so if you are adding a file with one of those extensions you should be fine.
Documentation to the command is here
-m is what I wanted, moves the file(s) into a zip.