automated terminal push
All checks were successful
learn org at code.softwareshinobi.com/git.softwareshinobi.com/pipeline/head This commit looks good

This commit is contained in:
2025-06-04 20:15:25 -04:00
parent 91cf2c0d5d
commit ba2080733d
196 changed files with 12170 additions and 1 deletions

View File

@@ -0,0 +1,96 @@
# The `gzip` command
The `gzip` command in Linux/Unix is used to compress/decompress data.
# Usage
## Compress a file
**Action:**
--- Compressing a file
**Details:**
--- Reduce the size of the file by applying compression
**Command:**
```
gzip file_name
```
## Decompress a file
**Action:**
--- Decompressing a file
**Details:**
--- Restore the file's original form in terms of data and size
**Command:**
```
gzip -d archive_01.gz
```
## Compress multiple files:
**Action:**
--- Compress multiple files
**Details:**
--- Compress multiple files into multiple archives
**Command:**
```
gzip file_name_01 file_name_02 file_name_03
```
## Decompress multiple files:
**Action:**
--- Decompress multiple files
**Details:**
--- Decompress multiple files from multiple archives
**Command:**
```
gzip -d archive_01.gz archive_02.gz archive_03.gz
```
## Compress a directory:
**Action:**
--- Compress all the files in a directory
**Details:**
--- Compress multiple files under a directory in one single archive
**Command:**
```
gzip -r directory_name
```
## Decompress a directory:
**Action:**
--- Decompress all the files in a directory
**Details:**
--- Decompress multiple files under a directory from one single archive
**Command:**
```
gzip -dr directory_name
```
## Verbose (detailed) output while compressing:
**Action:**
--- Compress a file in a more verbose manner
**Details:**
--- Output more information about the action of the command
**Command:**
```
gzip -v file_name
```

View File

@@ -0,0 +1,41 @@
# The `zip` command
The `zip` command is used to compress files and reduce their size.
It outputs an archive containing one or more compressed files or directories.
### Examples:
In order to compress a single file with the `zip` command the syntax would be the following:
```
zip myZipFile.zip filename.txt
```
This also works with multiple files as well:
```
zip multipleFiles.zip file1.txt file2.txt
```
If you are compressing a whole directory, don't forget to add the `-r` flag:
```
zip -r zipFolder.zip myFolder/
```
### Syntax:
```
zip [OPTION] zipFileName filesList
```
### Possible options:
|**Flag** |**Description** |
|:---|:---|
|`-d`|Removes the file from the zip archive. After creating a zip file, you can remove a file from the archive using the `-d` option|
|`-u`|Updates the file in the zip archive. This option can be used to update the specified list of files or add new files to the existing zip file. Update an existing entry in the zip archive only if it has been modified more recently than the version already in the zip archive.|
|`-m`|Deletes the original files after zipping.|
|`-r`|To zip a directory recursively, it will recursively zip the files in a directory. This option helps to zip all the files present in the specified directory.|
|`-x`|Exclude the files in creating the zip|
|`-v`|Verbose mode or print diagnostic version info. Normally, when applied to real operations, this option enables the display of a progress indicator during compression and requests verbose diagnostic info about zip file structure oddities|

View File

@@ -0,0 +1,44 @@
# The `unzip` command
The `unzip` command extracts all files from the specified ZIP archive to the current directory.
### Examples:
In order to extract the files the syntax would be the following:
```
unzip myZipFile.zip
```
To unzip a ZIP file to a different directory than the current one, don't forget to add the `-d` flag:
```
unzip myZipFile.zip -d /path/to/directory
```
To unzip a ZIP file and exclude specific file or files or directories from being extracted, don't forget to add the `-x` flag:
```
unzip myZipFile.zip -x file1.txt file2.txt
```
### Syntax:
```
unzip zipFileName [OPTION] [PARAMS]
```
### Possible options:
|**Flag** |**Description** |**Params** |
|:---|:---|:---|
|`-d`|Unzip an archive to a different directory.|/path/to/directory|
|`-x`|Extract the archive but do not extract the specified files.|filename(s)|
|`-j`|Unzip without creating new folders, if the zipped archive contains a folder structure.|-|
|`-l`|Lists the contents of an archive file without extracting it.|-|
|`-n`|Do not overwrite existing files; supply an alternative filename instead.|-|
|`-o`|Overwrite files.|-|
|`-P`|Supplies a password to unzip a protected archive file.|password|
|`-q`|Unzips without writing status messages to the standard output.|-|
|`-t`|Tests whether an archive file is valid.|-|
|`-v`|Displays detailed (verbose) information about the archive without extracting it.|-|

View File

@@ -0,0 +1,76 @@
# The `tar` command
The `tar` command stands for tape archive, is used to create Archive and extract the Archive files. This command provides archiving functionality in Linux. We can use tar command to create compressed or uncompressed Archive files and also maintain and modify them.
### Examples:
1. To create a tar file in abel directory:
```
tar -cvf file-14-09-12.tar /home/abel/
```
2. To un-tar a file in the current directory:
```
tar -xvf file-14-09-12.tar
```
### Syntax:
```
tar [options] [archive-file] [file or directory to be archived
```
### Additional Flags and their Functionalities:
|**Use Flag** |**Description** |
|:---|:---|
|`-c`|Creates Archive |
|`-x`|Extract the archive |
|`-f`|Creates archive with given filename|
|`-t`|Displays or lists files in archived file |
|`-u`|Archives and adds to an existing archive file|
|`-v`|Displays Verbose Information |
|`-A`|Concatenates the archive files |
|`-z`|zip, tells tar command that creates tar file using gzip |
|`-j`|Filter archive tar file using tbzip |
|`w`|Verify a archive file |
|`r`|update or add file or directory in already existed .tar file |
|`-?`|Displays a short summary of the project |
|`-d`|Find the difference between an archive and file system |
|`--usage`|shows available tar options |
|`--version`|Displays the installed tar version |
|`--show-defaults`|Shows default enabled options |
|**Option Flag** |**Description** |
|:---|:---|
|`--check-device`| Check device numbers during incremental archive|
|`-g`|Used to allow compatibility with GNU-format incremental ackups|
|`--hole-detection`|Used to detect holes in the sparse files|
|`-G`| Used to allow compatibility with old GNU-format incremental backups|
|`--ignore-failed-read`|Don't exit the program on file read errors|
|`--level`|Set the dump level for created archives|
|`-n`|Assume the archive is seekable|
|`--no-check-device`|Do not check device numbers when creating archives|
|`--no-seek`|Assume the archive is not seekable|
|`--occurrence=N`|`Process only the Nth occurrence of each file|
|`--restrict`|`Disable use of potentially harmful options|
|`--sparse-version=MAJOR,MINOR`|Set version of the sparce format to use|
|`-S`|Handle sparse files efficiently.|
|**Overwright control Flag** |**Description**|
|:---|:---|
|`-k`|Don't replace existing files|
|`--keep-newer-files`|Don't replace existing files that are newer than the archives version|
|`--keep-directory-symlink`|Don't replace existing symlinks|
|`--no-overwrite-dir`|Preserve metadata of existing directories|
|`--one-top-level=DIR`|Extract all files into a DIR|
|`--overwrite`| Overwrite existing files|
|`--overwrite-dir`| Overwrite metadata of directories|
|`--recursive-unlink`| Recursivly remove all files in the directory before extracting|
|`--remove-files`| Remove files after adding them to a directory|
|`--skip-old-files`| Don't replace existing files when extracting|
|`-u`| Remove each file before extracting over it|
|`-w`| Verify the archive after writing it|

View File

@@ -0,0 +1,57 @@
# The `gunzip` command
The `gunzip` command is an antonym command of [`gzip` command](015-the-gzip-command.md). In other words, it decompresses files deflated by the `gzip` command.
`gunzip` takes a list of files on its command line and replaces each file whose name ends with _.gz_, _-gz_, _.z_, _-z_, or *\_z* (ignoring case) and which begins with the correct magic number with an uncompressed file without the original extension. `gunzip` also recognizes the special extensions *.tgz* and *.taz* as shorthands for *.tar.gz* and *.tar.Z* respectively.
### Examples:
1. Uncompress a file
```
gunzip filename.gz
```
2. Recursively uncompress content inside a directory, that match extension (suffix) compressed formats accepted by `gunzip`:
```
gunzip -r directory_name/
```
3. Uncompress all files in the current/working directory whose suffix match *.tgz*:
```
gunzip -S .tgz *
```
4. List compressed and uncompressed sizes, compression ratio and uncompressed name of input compressed file/s:
```
gunzip -l file_1 file_2
```
### Syntax:
```
gunzip [ -acfhklLnNrtvV ] [-S suffix] [ name ... ]
```
### Video tutorial about using gzip, gunzip and tar commands:
[This video](https://www.youtube.com/watch?v=OBtG8zfVwuI) shows how to compress and decompress in a Unix shell. It uses `gunzip` as decompression command.
### Additional Flags and their Functionalities:
|**Short Flag**|**Long Flag**|**Description**|
|:---|:---|:---|
|-c|--stdout|write on standard output, keep original files unchanged|
|-h|--help|give help information|
|-k|--keep|keep (don't delete) input files|
|-l|--list|list compressed file contents|
|-q|--quiet|suppress all warnings|
|-r|--recursive|operate recursively on directories|
|-S|--suffix=SUF|use suffix SUF on compressed files|
||--synchronous|synchronous output (safer if system crashes, but slower)|
|-t|--test|test compressed file integrity|
|-v|--verbose|verbose mode|
|-V|--version|display version number|