Live data from Hacker News

The Windows equivalents of the most used Linux commands

techkettle.blogspot.com

31–40 of 72 posts

Re: The Windows equivalents of the most used Linux commands

#31
post #30
post #5

My most used windows command is, and will always be, `ls`. Then I'm reminded that it's not a know file or directory.

Same! Closely followed by 'cat' lol. 'type' just doesn't register in my brain

VMS also uses type to dump a file to stdout.

I understand that DEC TOPS 20 influenced CP/M and MS-DOS, so that could be the source for type.

https://en.wikipedia.org/wiki/TOPS-20

Edit: type has its own wiki, and TOPS-20 implemented it.

https://en.wikipedia.org/wiki/TYPE_(DOS_command)

Re: The Windows equivalents of the most used Linux commands

#32
post #3

Not bad, but one big criticism, never do a 'kill -9' first, that will stop the program from cleaning up after itself if killed using -9. Use one of these instead: -TERM then wait, if not -INT then wait, if not -HUP then wait, if not -ABRT If you are sure all of these fail, then use -9 (-KILL). But assume the program has a major bug and try and find another program that will do the same task and use that instead.

Never use `kill -9`, instead refer to the signal directly. 9 is not always the same signal on all platforms.

Re: The Windows equivalents of the most used Linux commands

#33
post #3

Not bad, but one big criticism, never do a 'kill -9' first, that will stop the program from cleaning up after itself if killed using -9. Use one of these instead: -TERM then wait, if not -INT then wait, if not -HUP then wait, if not -ABRT If you are sure all of these fail, then use -9 (-KILL). But assume the program has a major bug and try and find another program that will do the same task and use that instead.

Maybe this logic should be built into the "kill" command (or some other standard command). Given that this is the right way, it shouldn't be more tedious than the wrong way! It could also monitor the target process and inform you immediately when it exits, saving you the trouble of using "ps" to confirm that the target is actually gone.

Kill is not a command to kill processes, it is a misnomer. Kill is meant to send signals to processes.

Re: The Windows equivalents of the most used Linux commands

#35
post #3

Not bad, but one big criticism, never do a 'kill -9' first, that will stop the program from cleaning up after itself if killed using -9. Use one of these instead: -TERM then wait, if not -INT then wait, if not -HUP then wait, if not -ABRT If you are sure all of these fail, then use -9 (-KILL). But assume the program has a major bug and try and find another program that will do the same task and use that instead.

Maybe this logic should be built into the "kill" command (or some other standard command). Given that this is the right way, it shouldn't be more tedious than the wrong way! It could also monitor the target process and inform you immediately when it exits, saving you the trouble of using "ps" to confirm that the target is actually gone.

Different programs may take different amounts of time to cleanup and close. To know if a signal failed takes human judgment or heuristic. A program receiving a signal is even able to show a confirmation dialog for the user to save stuff, etc. before closing.

Re: The Windows equivalents of the most used Linux commands

#36
post #3

Not bad, but one big criticism, never do a 'kill -9' first, that will stop the program from cleaning up after itself if killed using -9. Use one of these instead: -TERM then wait, if not -INT then wait, if not -HUP then wait, if not -ABRT If you are sure all of these fail, then use -9 (-KILL). But assume the program has a major bug and try and find another program that will do the same task and use that instead.

HUP is usually sent to daemons to instruct them to reinitialize and reread their configuration files.

Is it still passed when a terminal is disconnected? I understand a dial-up modem was involved in the original intended use.

Re: The Windows equivalents of the most used Linux commands

#37
post #3

Not bad, but one big criticism, never do a 'kill -9' first, that will stop the program from cleaning up after itself if killed using -9. Use one of these instead: -TERM then wait, if not -INT then wait, if not -HUP then wait, if not -ABRT If you are sure all of these fail, then use -9 (-KILL). But assume the program has a major bug and try and find another program that will do the same task and use that instead.

How often does plain 'kill ' not work, but some other signal other than SIGKILL works? Usually the process is either working correctly and terminates when asked, or else not working correctly and needs to be KILLed.

It is possible to install a handler for most signals, and that handler can be configured to ignore the signal.

Signal 9 cannot be ignored.

Re: The Windows equivalents of the most used Linux commands

#40
post #30
post #5

My most used windows command is, and will always be, `ls`. Then I'm reminded that it's not a know file or directory.

Same! Closely followed by 'cat' lol. 'type' just doesn't register in my brain

Back before "type" we had "copy FILE CON".
Post reply on HN