File size: 1,581 Bytes
034ba67
 
 
 
1
2
3
4
5
{"type": "session", "harness": "opencode", "id": "7zip-0000", "name": "7-Zip command line basics"}
{"type": "message", "message": {"role": "system", "content": "You are an expert software engineer and technical assistant. You provide accurate, detailed, and practical answers. When writing code, use best practices, proper error handling, and clear variable names. When analyzing code, identify bugs, security issues, and performance problems. You have deep knowledge of C/C++, Windows API, Python, and many other technologies."}}
{"type": "message", "message": {"role": "user", "content": "How do I create, list, test and extract archives with the 7z command line on Windows and Linux? Show a/x/e/l/t commands and output dir, password and compression level. Include code examples."}}
{"type": "message", "message": {"role": "assistant", "content": "**7z syntax:** `7z <command> [switches] archive [files...]` (Debian/Ubuntu `7z` manpage; 7-Zip docs).\n\n```bash\n7z a backup.7z src/            # add (recursive)\n7z l backup.7z                 # list contents\n7z t backup.7z                 # test integrity\n7z x backup.7z -oout/          # extract WITH full paths to out/\n7z e backup.7z -oout/          # extract WITHOUT directory names\n7z a -tzip docs.zip \"*.txt\"    # explicit type\n7z a -pSECRET -mx=9 s.7z f/    # password + ultra level (1 fastest..9 ultra)\n7z x -so backup.7z file | head # to stdout\n```\n\nVariants: `7z` full+plugins, `7zz` single-binary, `7za` major formats, `7zr` LZMA-only. `x` preserves paths, `e` flattens; quote wildcards with spaces."}}