Difference between revisions of "Linux Cheat Sheet"

From
Jump to: navigation, search
(Overwrite File with specific content/string:)
(Append File with specific content/string:)
 
(4 intermediate revisions by 2 users not shown)
Line 3: Line 3:
  
 
== Overwrite File with specific content/string: ==
 
== Overwrite File with specific content/string: ==
 
+
==== Command: ====
 
''echo "<string>" > <filename>''
 
''echo "<string>" > <filename>''
  
''printf "<string>"" > <filename>''
+
''printf "<string>" > <filename>''
 
+
==== Example: ====
 
 
=== Beispiel: ===
 
 
 
 
''echo "hello" > beispiel.txt''
 
''echo "hello" > beispiel.txt''
  
Line 16: Line 13:
  
 
== Append File with specific content/string: ==
 
== Append File with specific content/string: ==
 
+
==== Command: ====
 
''echo "<string>" >> <filename>''
 
''echo "<string>" >> <filename>''
  
 
''printf "<string>"" >> <filename>''
 
''printf "<string>"" >> <filename>''
 
+
==== Example: ====
Beispiel:
 
 
''echo "hello" >> beispiel.txt''
 
''echo "hello" >> beispiel.txt''
  
 
''printf "hello" >> beispiel.txt''
 
''printf "hello" >> beispiel.txt''

Latest revision as of 09:49, 14 April 2025

This Page is for a Cheat Sheet of Linux commands.


Overwrite File with specific content/string:[edit]

Command:[edit]

echo "<string>" > <filename>

printf "<string>" > <filename>

Example:[edit]

echo "hello" > beispiel.txt

printf "hello" > beispiel.txt

Append File with specific content/string:[edit]

Command:[edit]

echo "<string>" >> <filename>

printf "<string>"" >> <filename>

Example:[edit]

echo "hello" >> beispiel.txt

printf "hello" >> beispiel.txt