Is there a way in Linux to make sudo command to remember the password the user entered for in the first of the lines? For example, for a list of commands that the user has to enter, the some of then requiring a sudo prefix, how can one make sure that if the user copy+pastes the instructions into a terminal all in one go, is only asked the password once?Example:mkdir ~/acpiinfo ; cd ~/acpiinfosudo acpidump > acpidump.txt# enter password sudo acpixtract acpidump.txtls *.dat | while read i; do iasl -d ${i}; donepid=`sudo dmidecode -s system-product-name`vid=`sudo dmidecode -s system-version`name=$pid.$vidmkdir ${name} && cp *.dsl ${name}/ tar czf ${name}.tar.gz ${name}/ && ls -l $( pwd )/${name}.tar.gz
sudo to remember password for list of commands?
command line;sudo
Double sudo is not necessary:sudo sh -c apt-get update && apt-get -y dist-upgrade && apt-get -y autoremove && apt-get autocleanThis works fine even if one command can take very long.