I don't think there is any syntax to 7z that will do what you want, and I wouldn't want to be shooting myself in the foot by having a command overwrite the input file with the output it's generating. Are you wanting the final result to be compressed archive that can be extracted by simply typing 7z x test.7z? That's no going to happen unless you extract the current test.7z into some temporary spot and then rebuild the archive, giving the compression level that you really want. If you don't do that, and use the "archive and rename" method that you had in your initial post, it's going to be a two-step process to extract the original files: the first "extraction" will basically "uncompress" the original archive, and the second step will be needed to pull everything out of that original archive; if I wanted to do that, I'd just gzip/xz/lzma/... the original test.7z and leave the new file with whatever .gz/.xz/.lzma/... suffix got put on it so that I'd know exactly what it was.