How to choose default version of CLI PHP on Ubuntu?

How to synchronize files from remote server?

Maslosoft
  • Blog
  • Products
  • Apps
  • Websites
  • Learn
  • Contact

More results
Home page Knowledge Base How to echo to file with sudo - using tee?

How to echo to file with sudo - using tee?

bash echo sudo tee files file

Often we want to echo some content into file, for which we need root permissions. There is a command tee to help with that. It will display passed string and at the same time write it to file.

Example of trimming log file:

echo "" | sudo tee error.log
To append to a file add -a parameter to tee:
echo "manual" | sudo tee -a mysql.override

You might also like:

How to select HTML element without attribute with CSS?

css html selector attribute

How to select HTML element without attribute with CSS?
How to underline link with different color than text?

css underline style text

How to underline link with different color than text?
How to proxy JavaScript observable with getters and setters?

javascript knockoutjs observables proxy getter setter

How to proxy JavaScript observable with getters and setters?
How to expand ext4 filesystem to fill partition with command line on ubuntu?

ubuntu filesystem

How to expand ext4 filesystem to fill partition with command line on ubuntu?
How to reset GIT to origin/master?

git reset master composer

How to reset GIT to origin/master?
How to move FileZilla settings to Ubuntu 17.10?

ubuntu filezilla desktop 17.10

How to move FileZilla settings to Ubuntu 17.10?
How to use bash array?

bash array shell multiline line

How to use bash array?
How to clean old snaps?

ubuntu linux snap cleanup bash

How to clean old snaps?
  • Featured Products
  • Framework
  • Mangan
  • Manganel
  • Addendum
  • Signals
  • Embedi
  • Binder
  • Hedron
  • Staple
  • Awe Share
  • Playlist
  • Miniview
  • Whitelist
  • About
  • Contact
  • Privacy policy
  • External Resources
  • GitHub
  • Packagist

Contact us

Maslosoft LLC

16192 Coastal Highway
Lewes, Delaware 19958, USA

  contact@maslosoft.com

  +48 514 920 103


© 2012 - 2025 Maslosoft LLC

CMS and Hosting Bene Best