Is there a way to stop having to write 'sudo' for every little thing in Linux?

Two options come to my mind:

  1. Own the directory you want by using chown:

    sudo chown your_username directory 
    

    (replace your_username with your username and directory with the directory you want.)

  2. The other thing you can do is work as root as long as you KNOW WHAT YOU ARE DOING. To use root do:

    sudo -s
    

    and then you can do anything without having to type sudo before every command.


Generally speaking, always work as your own user unless you're doing something with a system-wide impact.

If there are files that you want to put up on your web server, work as your own user and then use sudo to drop the files in place in the web serving area of your filesystem. Usually, that would be performed by an installation script, and you would run something like sudo -u webmaster install-webserver-files, or better sudo -u webmaster git update (or the version control system of your choice).

If you're working on a development server and want your files to be accessible instantly, create a directory in the web server area and make it owned or at least writable by you. After that one-time operation (sudo chown … or sudo -u webmaster setfacl …), you won't need elevated privileges for day-to-day operations.

It is sometimes convenient to allow multiple users to write in a directory, or otherwise to have different permissions for several users other than the owner or for multiple groups. Access control lists give you this ability. See Permissions issues for shared directory on a server or Backup script permission issue.


Yes, login as root which give you super user access control.
Same concept in windows, you can login into your terminal using administrator.