$ ls -Rl ./src
src:
total 4
drwxrwxr-x 2 dennis dennis 4096 Feb 21 10:02 jdbc3040
src/jdbc3040:
total 20
-rw-rw-r-- 1 dennis dennis 827 Feb 21 09:50 DatabaseInfo.java
-rw-rw-r-- 1 dennis dennis 941 Feb 21 10:07 DriverReteieveDepartmentData.java
-rw-rw-r-- 1 dennis dennis 217 Feb 21 09:47 MyMain.java
-rw-rw-r-- 1 dennis dennis 462 Feb 21 09:24 MySQLConnection.java
-rw-rw-r-- 1 dennis dennis 1427 Feb 21 10:23 PreparedStatementExample.java
Zip the directory up into a single zip file:
$ zip -r /tmp/src.zip src
adding: src/ (stored 0%)
adding: src/jdbc3040/ (stored 0%)
adding: src/jdbc3040/DriverReteieveDepartmentData.java (deflated 49%)
adding: src/jdbc3040/DatabaseInfo.java (deflated 60%)
adding: src/jdbc3040/MyMain.java (deflated 23%)
adding: src/jdbc3040/MySQLConnection.java (deflated 49%)
adding: src/jdbc3040/PreparedStatementExample.java (deflated 61%)
Show the contents of the zip file with out unzipping it:
$ unzip -l /tmp/src.zip
Archive: src.zip
Length Date Time Name
--------- ---------- ----- ----
0 2016-02-21 09:19 src/
0 2016-02-21 10:02 src/jdbc3040/
941 2016-02-21 10:07 src/jdbc3040/DriverReteieveDepartmentData.java
827 2016-02-21 09:50 src/jdbc3040/DatabaseInfo.java
217 2016-02-21 09:47 src/jdbc3040/MyMain.java
462 2016-02-21 09:24 src/jdbc3040/MySQLConnection.java
1427 2016-02-21 10:23 src/jdbc3040/PreparedStatementExample.java
--------- -------
3874 7 files