Zip a file with no extension


Login or Register for Dates, Times and to Reply

 
Thread Tools Search this Thread
# 1  
Zip a file with no extension

I would like to include in my zip file a particular file name On_Resume which has no file extension.

This does not work.

Code:
zip -u Ubuntu_Documents.zip *.txt *.doc *.rtf *.html *.png *.pdf *.odt *.ods *.odg *.csv *.png *.xls On_Resume*

# 2  
Code:
$ touch on_resume
$ zip -u something.zip on_resume*
$ unzip -l something.zip

Archive:  something.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
        0  04-04-2019 09:08   on_resume
---------                     -------
        0                     1 file

$

In what way does it "not work"? I suspect it has nothing to do with the extension and more to do with the file not matching your expression.
This User Gave Thanks to Corona688 For This Post:
# 3  
Hi drew77...

And to add to Corona688's reply you have "*.png" twice.
Just an observation.
These 2 Users Gave Thanks to wisecracker For This Post:
# 4  
Quote:
Originally Posted by Corona688
Code:
$ touch on_resume
$ zip -u something.zip on_resume*
$ unzip -l something.zip

Archive:  something.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
        0  04-04-2019 09:08   on_resume
---------                     -------
        0                     1 file

$

In what way does it "not work"? I suspect it has nothing to do with the extension and more to do with the file not matching your expression.
Code:
andy@7_~/bin$ ls On*
On_host.sh  On_Resume
andy@7_~/bin$

What is even stranger is that it zips up a On_Resume.sh which is not even present in the directory or anywhere else?

Update:

On_Resume is a script, so I added the sh extension. Problemo solved.

Last edited by drew77; 04-04-2019 at 02:17 PM..
# 5  
Why are you appending a * for a file you give its full name? I could understand On_Re* ...
# 6  
Removed the *.

No change.

Even tried it with other no extension files.

Maybe it's a conspiracy. :-)
# 7  
On a lark, try:

Code:
echo zip -u Ubuntu_Documents.zip *.txt *.doc *.rtf *.html *.png *.pdf *.odt *.ods *.odg *.csv *.png *.xls On_Resume*

Which will at least solve the question of whether it's being expanded wrong, or zip itself is revolting here...
This User Gave Thanks to Corona688 For This Post:
Login or Register for Dates, Times and to Reply

Previous Thread | Next Thread
Thread Tools Search this Thread
Search this Thread:
Advanced Search

Test Your Knowledge in Science: Mathematics
Difficulty: Medium
The set of all algebraic numbers is countable.
True or False?

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How can we Zip multiple files created on the same date into one single zip file.?

Hi all i am very new to shell scripting and need some help from you to learn 1)i have some log files that gets generated on daily basis example: i have abc_2017_01_30_1.log ,2017_01_30_2.log like wise so i want to zip this 4 logs which are created on same date into one zip folder. 2)Post zipping... (1 Reply)
Discussion started by: b.saipriyanka
1 Replies

2. UNIX for Beginners Questions & Answers

How can we Zip multiple files created on the same date into one single zip file.?

Hi all i am very new to shell scripting and need some help from you to learn 1)i have some log files that gets generated on daily basis example: i have abc_2017_01_30_1.log ,2017_01_30_2.log like wise so i want to zip this 4 logs which are created on same date into one zip folder. 2)Post zipping... (2 Replies)
Discussion started by: b.saipriyanka
2 Replies

3. Shell Programming and Scripting

Rename specific file extension in directory with match to another file in bash

I have a specific set (all ending with .bam) of downloaded files in a directory /home/cmccabe/Desktop/NGS/API/2-15-2016. What I am trying to do is use a match to $2 in name to rename the downloaded files. To make things a more involved the date of the folder is unique and in the header of name... (1 Reply)
Discussion started by: cmccabe
1 Replies

4. UNIX for Dummies Questions & Answers

Display the .csv extension files based on .done extension fine

Hi All, I want to fetch the files based on .done file and display the .csv files and Wil take .csv files for processing. 1.I need to display the .done files from the directory. 2.next i need to search for the .Csv files based on .done file.then move .csv files for the one directory ... (2 Replies)
Discussion started by: girija.g6
2 Replies

5. Shell Programming and Scripting

Zip Multiple files to One .zip file in AIX system

Hi I have a requirement in unix shell where I need to zip multiple files on server to one single .zip file. I dont see zip command in AIX and gzip command not doing completely what I want. One I do .zip file, I should be able to unzip in my local Computer. Here is example what I want... (9 Replies)
Discussion started by: RAMA PULI
9 Replies

6. UNIX for Dummies Questions & Answers

archieve and zip the multiple file with no extension

Hi, I'm new to scripting. I need to find all the 10 files in the source directory and then archieve them to archive directory. The source files which im getting does not have any extensions just binary files. I need to find them by the file names and archive it. Directory also contains other... (1 Reply)
Discussion started by: etldeveloper
1 Replies

7. UNIX for Advanced & Expert Users

Zip file inside Zip file(s)

I've a zip file called Z00.zip and in that file there are 22 more zip files. Each zip file having .txt files nearly 10,000 files. I am trying to unzip all these .txt files in one command line to unzip each .zip file from Z00.zip file. Would like to know whether possible to unzip all sub-zip files... (1 Reply)
Discussion started by: nvkuriseti
1 Replies

8. UNIX for Dummies Questions & Answers

Zip a file with .zip extension.

Hi, I need to zip a .dat file with .zip extension. I tried using the "zip" command. But shell says. "ksh: zip: not found" Currently I am using gunzip to zip and changing the extension ".gz" to ".zip" as follows. mv $file `echo $file | sed 's/\(.*\.\)gz/\1zip/'` But when I tried... (1 Reply)
Discussion started by: aeroticman
1 Replies

9. AIX

ZIP multiple files and also specify size of zip file

I have to zip many pdf files and the size of zip file must not exceed 200 MB. When size is more than 200 MB then multiple zip files needs to be created. How we can achieve this in UNIX? I have tried ZIP utility but it takes a lot of time when we add individual pdfs by looping through a... (1 Reply)
Discussion started by: tom007
1 Replies

10. UNIX for Dummies Questions & Answers

unzip .zip file and list the files included in the .zip archive

Hello, I am trying to return the name of the resulting file from a .zip archive file using unix unzip command. unzip c07212007.cef7081.zip Archive: c07212007.cef7081.zip SecureZIP for z/OS by PKWARE inflating: CEP/CEM7080/PPVBILL/PASS/G0063V00 I used the following command to unzip in... (5 Replies)
Discussion started by: oracledev
5 Replies

Featured Tech Videos