extracting from 7z archive failed when executed through command line - 7zip

I downloaded a 7z archive which needs a password to extract the contents of the archive. I used the command
7z -e archive.7z
It failed with the following error:
error: Incorrect command line.
Can anyone tell me command to extract the file. Thanks in advance.

7z e archive.7z
Lose the dash.

setting password for extraction is similar to setting password for archiving
(password is PWD)
7z e -pPWD archive.zip

Related

Shell script to copy a file from one location to another

I have written a Unix command to copy a file from one location to other and saved it with script.sh in my E:\ drive in Windows10. However,while executing through the command prompt by going to the path where this script is located,it throws pop up windows saying "how do you want to open this file?".Command in the script as below:
cd E:/source
for f in *.txt
do
cp -v "$f" E:/Destination/"${f%.txt}"$(date +%m%d%y).txt
done
Please help to fix this error.Thanks in advance.

unzip .bin file programatically in ruby

I have a .bin which i am trying to unzip programatically. The directory is a temp directory in which the.bin file is saved.
I have tried to the following
change the permission of bin files by typing.
chmod -c 777 filenam.bin.
now run the bin file by typing
here is a ruby code which i have
%x(gunzip #{label_path})
using above gunzip gives me this error
unknown suffix -- ignored
I shows error as illegal option c.
Can anyone help. Thanks.
gunzip has an option -S to specify a suffix of the file to be unzipped:
gunzip -S .bin filenam.bin
The above will produce file filenam in the same directory.

"End-of-central-directory signature not found" when unzipping

When I unzip the file by double click I get the error
2:no such file or directory
After that I open terminal and use the below command but I get the below result:
unzip /Users/mahesh/Desktop/maheshapp.zip
Archive: /Users/mahesh/Desktop/maheshapp.zip
End-of-central-directory signature not found. Either this file is not
a zipfile, or it constitutes one disk of a multi-part archive. In the
latter case the central directory and zipfile comment will be found on
the last disk(s) of this archive.
unzip: cannot find zipfile directory in one of /Users/mahesh/Desktop/maheshapp.zip or
/Users/mahesh/Desktop/maheshapp.zip.zip, and cannot find /Users/mahesh/Desktop/maheshapp.zip.ZIP
Try below command on terminal.
ditto -x -k source.zip Destination_Dir
ditto will recover most of the contents. Credit goes to http://ask.metafilter.com/157754/Mac-OS-X-Recovering-a-corrupted-zip-file
I had this error message and the only solution for me was to install the trial of WinRAR and use that. The zip file wouldn't extract using either the built-in Windows 10 or MacOS extraction utilities.
you have splitted binaries, like file.zip.001, file.zip.002 ... you may just need to combine the files e.g. using cat command: cat file.zip.* > single.zip
Credits: https://superuser.com/questions/365643/how-to-unzip-split-files-on-os-x/1067907?newreg=5fb5d89c2d2a4ae5aeb1842dd233b8d1
I got the same error when my linux run out of space:
[root#client actimize429]# unzip ais-linux-setup-4.29.0.9-20200616.090151-1.zip
Archive: ais-linux-setup-4.29.0.9-20200616.090151-1.zip
End-of-central-directory signature not found. Either this file is not
a zipfile, or it constitutes one disk of a multi-part archive. In the
latter case the central directory and zipfile comment will be found on
the last disk(s) of this archive.
unzip: cannot find zipfile directory in one of ais-linux-setup-4.29.0.9-20200616.090151-1.zip or
ais-linux-setup-4.29.0.9-20200616.090151-1.zip.zip, and cannot find ais-linux-setup-4.29.0.9-20200616.090151-1.zip.ZIP, period.

Tar: Directory Checksum Error

I am writing to a HP LTO4 tape drive. But after writing a big file (of the order 30GB) I am not able to write anything after that. I get
tar: directory checksum error
Anyone has any idea what could be wrong?
I am using the command
tar -rvfE /dev/rmt/0 <file.gz>
Need help!
Problem resolved by using -i flag.
So now I am using the command
tar -rvfEi /dev/rmt/0 <file>
:)

Using Gimp script in windows command line Error

I try using this script to convert .PSD with using a certain script.
This is my code:
#echo off
set gimp="c:\Program Files\GIMP 2\bin\gimp-console-2.8.exe"
%gimp% -i -b '(flatten-layer-groups 1 test.psd)' -b '(gimp-quit 0)'
but he does not work, with this error:
(gimp-console-2.8.exe:1336): LibGimpBase-WARNING **: gimp-console-2.8.exe: gimp_
wire_read(): error
GIMP-╬°шсър: ═хтючьюцэю юЄъЁ√Є№ 'c:\Work\Test\1': No such file or directory
GIMP-╬°шсър: ═хтючьюцэю юЄъЁ√Є№ 'c:\Work\Test\test.psd)'': No such file or direc
tory
GIMP-╬°шсър: ═хтючьюцэю юЄъЁ√Є№ 'c:\Work\Test\0)'': No such file or directory
Please Help me! Thank you!
I think you need to use double qoutes, something like
%gimp% -i -b "(flatten-layer-groups 1 \"test.psd\")" -b "(gimp-quit
0)"
See this link
For example xd function opens c.jpeg which is on desktop on Windows 10 for Gimp version 2.10
gimp-2.10 -b "(xd \"C:\\Users\\YourUsername\\Desktop\\c.jpeg\")"

Resources