All Questions
23,869
questions
-1
votes
1
answer
34
views
Any way to run a script on Linux VM connected via SSH from a python program
I am connecting to linux machine via below code
client = paramiko.SSHClient()
client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
client.connect(hostname, port, username=username, password=...
-2
votes
0
answers
24
views
Understanding the Connection and Differences between Shell, Bash, Unix, Linux [closed]
This is my first question on StackOverflow!Over the last months, I have been struggling to get my mind around the topics that I have mentioned above in the title.I have been trying to learn key-...
-1
votes
0
answers
23
views
linux send mail configuraiton [closed]
I'm trying to send html email with sendmail plugin on linux. But I need to set smtp server url how can I set while sending this mail.
(
echo "To: [email protected]"
echo "Subject: Test"...
1
vote
1
answer
39
views
run an input/output waiting application in function in background getting output of that function
I have a shell function
func() {
read < /dev/ttyUSB3 &
PID=$!
echo "$PID"
}
do not focus on its exact purpose, the thing is that I need to run some app (in this case read)...
1
vote
2
answers
77
views
How to delete all files except the last day files in Linux?
Suppose these are my files:
file1 ==> 2024/07/10
file2 ==> 2024/07/9
file3 ==> 2024/07/9
file4 ==> 2024/07/8
I'm going to delete all files, except files which create date is yesterday (...
0
votes
1
answer
28
views
I am receiving a response url not found on server when I try to delete file in Google Drive using a Linux bash script and curl
I am trying to delete a file using a bash shell script that I uploaded to a shared google drive using a different shell script. I am able to list the contents of the folder that the file is in and ...
0
votes
0
answers
36
views
Why timeout works differently when executed from terminal vs from a shell script file
I wanted to implement a unit testing shell script file that runs a command, compares the expected and actual output, and also add timeout constraints.
I used actual=$(timeout 2s ./bf --file ./test/inc-...
0
votes
0
answers
23
views
How to Log all commands executed by any user in Linux [closed]
I saw the following command log in /var/log/audit.log on the internal server
2024-07-08_23:05:10 --- <username> pts/2 (10.220.200.2) --- 1000 --- less /var/log/message
...
I would like to ...
1
vote
1
answer
74
views
Create an alias in bashrc file [duplicate]
In Linux terminal, normally I can copy files from another unix server using:
scp -r [email protected]:/data/filename ./
which secure copies the remote file to my current directory. I've made sure ...
0
votes
3
answers
81
views
Pass multiple arguments to single command in custom position xargs
I want execute a command where I have the args as single string but they need to be in a custom position. E.g. in the following example I want the args to be positioned before any fixed args that I ...
1
vote
3
answers
95
views
Linux command to replace placeholder in one file using value from another file [duplicate]
I have env.config file containing environment variables, and app.config file for my application config. I want to copy values from env.config and paste them in app.config.
I tried to use both awk and ...
0
votes
2
answers
47
views
Append output file content in sql select query in where clause as a condition
I have a requirement where there is a select query and I have a spooled output.txt file. I want to use this output in select query to put in where clause condition as shown in below example. Can it be ...
1
vote
2
answers
78
views
Renaming jpg files in sequential order in Mac or Windos [duplicate]
I have 100 files that are named 1.jpg,2.jpg,3.jpg....100.jpg in a folder. I would like to rename them sequentially starting from number 83. Eg: 1.jpg becomes 83.jpg, 2.jpg becomes 84.jpg and so on..
I ...
-1
votes
1
answer
50
views
Is there any way to restart a script that I closed with ^D in linux [closed]
I am new to Linux and am trying it first in wsl2.
I started a script with script command which recorded my shell activities, but after I closed it with ^D, I realized I forgot to record another ...
0
votes
2
answers
53
views
Command works fine, but does not in Bash script
EDIT: I'm not really experienced with scripting. I'm in a cyber program, so what is being said has to be used, even if there is a simpler way. Sorry!
Currently, I need to make a script using cat, awk, ...