In Mac how do I signal end of file (EOF) on the shell
8,080
- cat > filename
- you press CTRL + D and that is EOF
Author by
anjanbacchu
Updated on September 18, 2022Comments
-
anjanbacchu over 1 year
IN windows, I press F6 function key to introduce the CTRL + Z character that signals the end of file.
c:\> copy con filename
copies the command line input to the given filename. At the end, after pressing text, I will enter the F6 key which introduces the CTRL + Z(EOF) character.
1) what is the equivalent command to copy the command line input to a given file ?
2) what key introduces the end of file character in the above command ?
-
pqnet over 9 yearsnote: CTRL+D works only in a new line, after pressing ENTER
-
pqnet over 9 yearsalso,
cat > filename
works in windows command shell too -
Daniel B over 9 yearsIt also works without LF, just press it twice. Same as Linux, really.
-
Pikachu almost 4 years@pqnet OP has asked about MAC not PC. ctrl does not even exist on mac. And also this key combination command + d does not work on mac.
-
pqnet almost 4 years@Pikachu mac keyboard has CTRL. It is on the left of alt, which is on the left of command. Press ctrl + D, as I said, not cmd + D because that splits the terminal screen