3 edited tags
| link
2 added 68 characters in body
source | link

How can I compress files with the output name same as parent folder?

For example, I have a the folders:

ubup@neter:/NeuroNER-master/output$ tree
.
├── en_2017-04-28_20-26-59-439552
│   ├── 000_test.txt
│   ├── 000_test.txt_conll_evaluation.txt
│   ├── 000_train.txt
│   ├── 000_train.txt_conll_evaluation.txt
│   ├── 000_valid.txt
│   ├── 000_valid.txt_conll_evaluation.txt
│   ├── 001_test.txt
│   ├── 001_test.txt_conll_evaluation.txt
│   ├── 001_train.txt
│   ├── confusion_matrix_for_epoch_0005_in_valid_binary_evaluation.df
│   ├── confusion_matrix_for_epoch_0005_in_valid_bio_evaluation.df
│   ├── confusion_matrix_for_epoch_0005_in_valid_token_evaluation.df
│   ├── model
│   │   ├── checkpoint
│   │   ├── dataset.ickle
│   │   ├── tensorboard_metadata_characters.sv
│   ├── results.son
│   └── tensorboard_logs
│       ├── test
│       │   └── events.ut.fevents.493425627.er

I would like to compress the folder en_2017-04-28_20-26-59-439552 into en_2017-04-28_20-26-59-439552.tar.bz2

I could use with the free, open source program lbzip2:

sudo tar -c -I lbzip2 -f en_2017-04-28_20-26-59-439552.tar.bz2 *

However I don't want the command to contain the name of the archive file (en_2017-04-28_20-26-59-439552.tar.bz2), because in my application I don't know it ahead of time.

How can I compress files with the output name same as parent folder?

For example, I have a the folders:

ubup@neter:/NeuroNER-master/output$ tree
.
├── en_2017-04-28_20-26-59-439552
│   ├── 000_test.txt
│   ├── 000_test.txt_conll_evaluation.txt
│   ├── 000_train.txt
│   ├── 000_train.txt_conll_evaluation.txt
│   ├── 000_valid.txt
│   ├── 000_valid.txt_conll_evaluation.txt
│   ├── 001_test.txt
│   ├── 001_test.txt_conll_evaluation.txt
│   ├── 001_train.txt
│   ├── confusion_matrix_for_epoch_0005_in_valid_binary_evaluation.df
│   ├── confusion_matrix_for_epoch_0005_in_valid_bio_evaluation.df
│   ├── confusion_matrix_for_epoch_0005_in_valid_token_evaluation.df
│   ├── model
│   │   ├── checkpoint
│   │   ├── dataset.ickle
│   │   ├── tensorboard_metadata_characters.sv
│   ├── results.son
│   └── tensorboard_logs
│       ├── test
│       │   └── events.ut.fevents.493425627.er

I would like to compress the folder en_2017-04-28_20-26-59-439552 into en_2017-04-28_20-26-59-439552.tar.bz2

I could use

sudo tar -c -I lbzip2 -f en_2017-04-28_20-26-59-439552.tar.bz2 *

However I don't want the command to contain the name of the archive file (en_2017-04-28_20-26-59-439552.tar.bz2), because in my application I don't know it ahead of time.

How can I compress files with the output name same as parent folder?

For example, I have a the folders:

ubup@neter:/NeuroNER-master/output$ tree
.
├── en_2017-04-28_20-26-59-439552
│   ├── 000_test.txt
│   ├── 000_test.txt_conll_evaluation.txt
│   ├── 000_train.txt
│   ├── 000_train.txt_conll_evaluation.txt
│   ├── 000_valid.txt
│   ├── 000_valid.txt_conll_evaluation.txt
│   ├── 001_test.txt
│   ├── 001_test.txt_conll_evaluation.txt
│   ├── 001_train.txt
│   ├── confusion_matrix_for_epoch_0005_in_valid_binary_evaluation.df
│   ├── confusion_matrix_for_epoch_0005_in_valid_bio_evaluation.df
│   ├── confusion_matrix_for_epoch_0005_in_valid_token_evaluation.df
│   ├── model
│   │   ├── checkpoint
│   │   ├── dataset.ickle
│   │   ├── tensorboard_metadata_characters.sv
│   ├── results.son
│   └── tensorboard_logs
│       ├── test
│       │   └── events.ut.fevents.493425627.er

I would like to compress the folder en_2017-04-28_20-26-59-439552 into en_2017-04-28_20-26-59-439552.tar.bz2

I could use with the free, open source program lbzip2:

tar -c -I lbzip2 -f en_2017-04-28_20-26-59-439552.tar.bz2 *

However I don't want the command to contain the name of the archive file (en_2017-04-28_20-26-59-439552.tar.bz2), because in my application I don't know it ahead of time.

1
source | link

How can I compress files with the output name same as parent folder?

How can I compress files with the output name same as parent folder?

For example, I have a the folders:

ubup@neter:/NeuroNER-master/output$ tree
.
├── en_2017-04-28_20-26-59-439552
│   ├── 000_test.txt
│   ├── 000_test.txt_conll_evaluation.txt
│   ├── 000_train.txt
│   ├── 000_train.txt_conll_evaluation.txt
│   ├── 000_valid.txt
│   ├── 000_valid.txt_conll_evaluation.txt
│   ├── 001_test.txt
│   ├── 001_test.txt_conll_evaluation.txt
│   ├── 001_train.txt
│   ├── confusion_matrix_for_epoch_0005_in_valid_binary_evaluation.df
│   ├── confusion_matrix_for_epoch_0005_in_valid_bio_evaluation.df
│   ├── confusion_matrix_for_epoch_0005_in_valid_token_evaluation.df
│   ├── model
│   │   ├── checkpoint
│   │   ├── dataset.ickle
│   │   ├── tensorboard_metadata_characters.sv
│   ├── results.son
│   └── tensorboard_logs
│       ├── test
│       │   └── events.ut.fevents.493425627.er

I would like to compress the folder en_2017-04-28_20-26-59-439552 into en_2017-04-28_20-26-59-439552.tar.bz2

I could use

sudo tar -c -I lbzip2 -f en_2017-04-28_20-26-59-439552.tar.bz2 *

However I don't want the command to contain the name of the archive file (en_2017-04-28_20-26-59-439552.tar.bz2), because in my application I don't know it ahead of time.