How to unset a ">" echo in Linux

1

I've just realized I don't know how to unset an echo I set with >.

The exact current situation is I just set dmesg > /var/log/syslog and now wanted to unset it, realizing I've never done that before. I know I could restart, but I'd rather learn from someone with more experience.

Sorry if this is answered somewhere else, but I don't know what it is called when you set a location to echo with a >, so my queries were bound to fail.

Thanks all

erds

Posted 2016-02-07T02:26:04.023

Reputation: 13

Answers

3

> redirections last for the duration of the process, most probalbably dmesg has finished so you need do nothing further to stop it.

If however you did dmesg -w and it's still running, typing ctrl-c will stop it.

Jasen

Posted 2016-02-07T02:26:04.023

Reputation: 499

I left out details and you still figured out what I did. Thank you--I'll mark your answer as soon as it lets me. :) – erds – 2016-02-07T02:36:36.333

0

You can't really "unset" what you've done though. Since what you did is "overwrite /var/log/syslog with the output of dmesg".

So your previous system logs are probably gone. It's sort of harmless though.

Tom Yan

Posted 2016-02-07T02:26:04.023

Reputation: 4 744

FWIW, if you used >> instead of >, it would be "append" instead of "overwrite". – Tom Yan – 2016-02-07T16:40:43.703