Tag: bash
-
How to switch users in Linux Bash Shell script and execute multiple commands as different user
If you search you will find different answers to this. You can do this in multiple ways, here I will talk about 2 ways, single command and multiple commands. First the idea is to switch from say root user to a named user you created or was created for you on your Linux server to…
-
Linux su command not working, does nothing but show $ prompt
So you found the magic sauce did ya? So you created a user with useradd or adduser and you try to switch over to that user in a terminal, probably logged in through ssh as root right. You are trying to use the su – username command but all you get is a $. And…
-
Bash how write large amounts of text to a file
I searched and tried for days to find the answer to this. All I wanted to do was be able to basically create a file and write text to it exactly as I had entered it in a shell script. Every suggestion on the internet was fubar. Note : to run these commands, put them…
-
How to make linux shell scripts wait for a command to finish before running another
I am writing this so when other people google how to do it, they have something to find to save them time. For days I tried to figure out how to make sure a command finished before another was run. I couldn’t find any information anywhere. If you are like me you may be thinking…
-
Linux commands resources and links
Linux commands cheat sheet – nice, useful list of Linux commands and examples of how to use them. Difference between Ubuntu apt-get autoclean, clean, autoremove commands – it is important to know the difference. Cleaning up with apt-get – how to clean up with apt clean command How To Upgrade Ubuntu Using Command Line? Linux…
-
BASH shell scripting links and resources
Bash scripting manual 5.1 Advanced Bash scripting guide Bash script cheat sheet Bash Scripting: Everything you need to know about Bash-shell programming Respond to prompt in Bash Script – a tutorial on how to respond to prompts in Bash scripts. How To Write a Bash Script That Answers Interactive Prompts MySQL: Run Query from Bash…