All Questions
110
questions
0
votes
1
answer
144
views
Linux Bash Wait Command Not Working
I am trying to use and bash file .sh to start other bash files in seperate terminals.
I want them to run one after the other as I use them to copy large numbers of files to the same Hard Drive. ...
0
votes
1
answer
897
views
ubuntu: how to check if a directory not exist or empty?
ubuntu: how to check if a directory not exist or empty?
if [not_exist "/path" || empty "/path"] then
command1;
else
command2;
fi
1
vote
2
answers
1k
views
Running shell Script via Crontab
So I've tried to run a shell script via crontab.
My Crontabs look like this:
00 20 * * * $HOME/Bilder/Hintergründe/.background_skript/background_night.sh
and my background_day.sh looks like this:
`#!/...
0
votes
0
answers
483
views
How to start gnome display manager from root shell in ubuntu?
How do I start the display manager (Gnome) from a bash shell on a Ubuntu system? More specifically, the shell obtained from modified the grub boot commands. It would be nice to use a desktop ...
1
vote
2
answers
660
views
How to have bash aliases usable from any directory?
As title sais I want to be able to use bash aliases from inside directories other than home. If file structure looks something like /home/Documents, do I have to create another .bash_aliases folder ...
0
votes
1
answer
247
views
Unable to move cursor to next line after reading secret input in shell script
I am trying to read multiple inputs from user in shell script,
#!/bin/bash
read -sp "Enter the secret api key: " var1
read -p "Enter the mount path:" var2
If I try to run this, I ...
0
votes
1
answer
358
views
Running shell script as system service
I'm running shell script as system service but then it isn't working like it works running normally
input="/home/sipl/inf"
while read -r line
do
sudo iptables -t nat -i $line -A PREROUTING ...
0
votes
0
answers
270
views
Create multiple compressed folders in Linux
I need using 7zip for create multiple compressed folders in Linux. Same case as here (But this guide is only for Windows): https://www.wikihow.com/Use-7Zip-to-Create-Multiple-Compressed-Folders-in-One-...
2
votes
0
answers
913
views
How to select the current line inside ubuntu terminal with hotkeys and copy it inside main clipboard
How can i select the whole line in ubuntu terminal only with hotkeys?
CTRL+U works, but puts it inside a buffer. How can i copy that buffer into the main clipboard?
Or how can i select/highlight the ...
0
votes
0
answers
3k
views
When using su to switch to a non root user, su fails to launch the user's shell program despite seemingly good permissions on everything
The error always looks something like this, depending on which shell is configured in /etc/passwd.
su: failed to execute /usr/sbin/jk_chrootsh: Permission denied
OR
su: failed to execute /bin/bash: ...
0
votes
0
answers
29
views
debian several ssh in shellscript file not works
In Ubuntu, I have a shell script file. In my script, the first ssh command to the Debian server works but the second ssh has error.
for example, if I have
ssh -t "$userName"@"$...
1
vote
1
answer
445
views
Can someone explain this property of the at and the tty command?
Can someone explain how this command :
echo "/bin/sh <$(tty) >$(tty) 2>$(tty)" | sudo at now;tail -f /dev/null
starts a root shell but this command :
echo "/bin/sh" | sudo ...
1
vote
0
answers
824
views
Ubuntu - Crontab seems to be running my script but not actually doing anything?
Ubuntu 18.04.5 LTS Bionic
sudo crontab -e
*/5 * * * * /bin/bash -c '/root/checker.sh'
checker.sh
#!/bin/bash
if ! (systemctl is-active varken.service)
then
/bin/bash -c 'service varken start'
fi
/...
1
vote
3
answers
999
views
Why doesn't ls -U list files in alphabetical order?
On my Xubuntu install, in some folders, if I list all the files with ls -U, sometimes they are not listed in alphbetical order. For example, once I had it list every single file in alphabetical order ...
1
vote
2
answers
163
views
Ubuntu CLI - run shell script with predefined arguments
I have a shell script that prompts the user for manual input (eg. 1 & enter, 2 & enter, etc).
I would like to automate this process by passing pre-defined arguments to the script while when ...