Yes — that is a single command and it will work, but only if a few prerequisites are met. The packaging command you pasted is exactly the same one we used earlier in the Slax instructions.
Short answer (what you should run)
- If you already set START earlier (for example with
START=$(date --iso-8601=seconds)), then your command is a single, valid command:
tar -czf /tmp/mouselinuxlogs_${START}.tgz /tmp/dmesg_live.log /tmp/lsusb_before.txt /tmp/lsusb_after.txt /tmp/lsusb_tree_before.txt /tmp/inputdev_before.txt /tmp/inputdev_after.txt /tmp/mouse_event_hexdump.log /tmp/mouse_eventraw 2>/dev/null && echo "/tmp/mouselinuxlogs${START}.tgz created"
Notes / gotchas and recommended safe sequence
1) Be root (you ran the captures as root earlier) — you don’t need sudo if you’re root.
2) If START is not set, define it first (one line):
START=$(date --iso-8601=seconds)
Then run the tar line (or combine into one line:
START=$(date --iso-8601=seconds); tar -czf "/tmp/mouselinuxlogs_${START}.tgz" ... && echo "/tmp/mouselinuxlogs_${START}.tgz created").
3) Stop capture processes first (if still running)
kill $(cat /tmp/dmesg_pid.txt) 2>/dev/null || true
kill $(cat /tmp/mouse_event_pid.txt) 2>/dev/null || true
Then generate the post‑capture snapshots:
lsusb > /tmp/lsusb_after.txt
cat /proc/bus/input/devices > /tmp/inputdev_after.txt
Then run the START + tar command. (This is the same packaging flow I suggested earlier.)
4) What
2>/dev/null && echo ... does
2>/dev/null hides any warnings/errors about missing files. That’s handy on a live system where some files might not exist, but it also hides useful error messages. The && echo prints the created filename only if tar succeeded.
5) Verify the tarball after creation
- List it and inspect contents:
ls -l "/tmp/mouselinuxlogs${START}.tgz"
tar -tzf "/tmp/mouselinuxlogs${START}.tgz" | head -n 20
If tar failed you won’t see the file; ls -l will show that.
6) Copy the tarball off the live session so you can attach it from the forum UI
- If your USB stick automounts:
cp "/tmp/mouselinuxlogs_${START}.tgz" /media/$(ls /media | head -n1)/
Or show mounts with ls /media or ls /run/media and copy to the correct mount. (I gave the same copy step earlier.)
7) If any files listed in the tar command don’t exist
- The tar command will silently ignore them (because of
2>/dev/null) — that’s OK, but if you want to be explicit first run:
ls -l /tmp/dmesg_live.log /tmp/lsusb_before.txt /tmp/lsusb_after.txt /tmp/lsusb_tree_before.txt /tmp/inputdev_before.txt /tmp/inputdev_after.txt /tmp/mouse_event_hexdump.log /tmp/mouse_event_raw
This shows which files are present and helps avoid surprises.
One‑liner you can paste (safe procedure)
START=$(date --iso-8601=seconds) && \
kill $(cat /tmp/dmesg_pid.txt) 2>/dev/null || true && \
kill $(cat /tmp/mouse_event_pid.txt) 2>/dev/null || true && \
lsusb > /tmp/lsusb_after.txt && \
cat /proc/bus/input/devices > /tmp/inputdev
after.txt && \
tar -czf "/tmp/mouselinuxlogs${START}.tgz" /tmp/dmesg_live.log /tmp/lsusb_before.txt /tmp/lsusb_after.txt /tmp/lsusb_tree_before.txt /tmp/inputdev_before.txt /tmp/inputdev_after.txt /tmp/mouse_event_hexdump.log /tmp/mouse_event
raw 2>/dev/null && \
echo "/tmp/mouselinuxlogs${START}.tgz created"
What I’ll do next
- After you create and copy the tarball, attach the file here (or tell me the tarball filename and that it’s been copied to your USB), and I’ll parse dmesg / lsusb / event capture and give the single next action. I parsed these same commands earlier when preparing the Slax capture instructions.
If you want, I can also provide a version that logs errors to a file instead of discarding them (recommended if something fails). Want that?