From f459755ade69235bea694bbea68384c4d6699cf7 Mon Sep 17 00:00:00 2001 From: Jacob Chapman <7908073+chapmanjacobd@users.noreply.github.com> Date: Sat, 14 May 2022 13:10:26 -0500 Subject: [PATCH] Use ctrl+d instead of ctrl+c --- README.md | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 4ab8425..0d4ce6f 100644 --- a/README.md +++ b/README.md @@ -2837,12 +2837,26 @@ var=$((var+1)) cat filename|rev|cut -f1|rev ``` -##### Cat to a file +##### Create or replace a file with contents ```bash cat >myfile let me add sth here -exit by control + c -^C +# exit with ctrl+d + +tee myfile +let me add sth else here +# exit with ctrl+d +``` + +##### Append to a file with contents +```bash +cat >>myfile +let me add sth here +# exit with ctrl+d + +tee -a myfile +let me add sth else here +# exit with ctrl+d ``` ##### Clear the contents of a file (e.g. filename)