Bash Scripting
Generate a Password
tr -cd '[:alnum:]' < /dev/urandom | fold -w31 | head -n1
export PASSWORD=`tr -cd '[:alnum:]' < /dev/urandom | fold -w31 | head -n1`
echo $PASSWORD > code-server-pass.txt
How to append to path
PATH=$PATH:/home/$USER/.local/bin
https://unix.stackexchange.com/questions/26047/how-to-correctly-add-a-path-to-path
Use Input Output Redirection
Lesscan be used to view files similar to cat>can output a text into a file>>if exists append to a file<is like accepting input2> and 2>>if error output that as well2>&1Output working command to terminal- One can output to
dev/nullfor death of the output chmod u+xUse this cause it limits use to a specified userheadsee first 10 lines of a filetaillast 10 lines of a file
TODO
permissions - How to insert text into a root-owned file using sudo? - Unix & Linux Stack Exchange
https://superuser.com/questions/67765/sudo-with-password-in-one-command-line
bash - How to redirect the output of the time command to a file in Linux? - Stack Overflow
shell - How to check if a file contains a specific string using Bash - Stack Overflow