Quantcast
Channel: nixCraft: Linux Tips, Hacks, Tutorials, And Ideas In Blog Format (RSS/FEED)
Viewing all articles
Browse latest Browse all 2612

How to append text to a file when using sudo command on Linux or UnixnixCraft

$
0
0
I am trying to add entry to /etc/hosts file using 'sudo echo '192.168.1.254 router' >> /etc/hosts' but getting an error that read as, -bash: /etc/hosts: Permission denied. How do I insert or append text to a file when running sudo command on Linux or Unix-like system?

Viewing all articles
Browse latest Browse all 2612

Trending Articles