All Questions
33 questions
0
votes
1
answer
64
views
How can I remove all files by pattern from bash with except for specific files? [duplicate]
I try to automatically remove all files from directory but exclude the specific files
The syntax $ rm *.!(vmx*|vmd*) works good if I run it from terminal, but if I create some bash script file (for ...
0
votes
1
answer
795
views
script to find the Position of Substring in Given String bin/bash
we have to write a shell program that will tell the position (index) of the substring in a given string.
sample input:-
Code Quotient - Get Better at Programming
at
sample output :-
28
i have ...
0
votes
1
answer
1k
views
How can i copy the data from subdirectories to one level above using Linux
I have the directory and file structures like below.
path/A/1/a/11.txt
path/A/1/a/12.txt
path/A/2/a/21.txt
path/A/3/a/31.txt
I want to copy these files to another path but one level above. Please ...
0
votes
1
answer
2k
views
Close terminal window once application is opened
Is it possible to close the parent terminal window once an application has been loaded?
I have a program I need to run using root privileges to work properly and currently I have made a script file ...
0
votes
2
answers
164
views
keying in password through a bash file
I have written a bash script that downloads several movies from different directories in a remote cluster. My problem is that the bash file asks me my password in the remote cluster for downloading &...
-1
votes
1
answer
1k
views
I need to bruteforce a 4-digit-pin locked executable program in Linux terminal. Help? I am new to Linux
I have a program called program-5.exe that takes one 4-digit argument. If it is correct, I get access and complete the challenge but otherwise it just denies access. What I think I mainly need to know ...
-1
votes
1
answer
899
views
How to pass a date-like argument [closed]
I want to,pass a j argument where j= date +%d%m%Y in my shell script, so how to pass that inside for loop
#!/bin/sh
for ((i=1;i<=25;i++))
do
wget --output-document=$i.jpg http://sambadepaper.com/...
0
votes
1
answer
347
views
Terminal unable to recognise shell script commands
I've a shell script that updates the proxy settings on my system.
I tried running the command chmod +x filename.sh which ran successfully. And then I ran ./filename.sh on the terminal that also ran ...
0
votes
0
answers
651
views
Want the terminal output (stderr and stdout) of the previous command executed in terminal
I'm trying to store both stdout and stderr from the terminal (and if possible stdin given by user) in a file for every command.
So I started creating a trap function to execute every command in an ...
0
votes
1
answer
9k
views
How to count number of files in a directory that are over a certain file size [duplicate]
Is there a way to count how many files in a specific directory are over some file size? Say, 100 MB?
0
votes
1
answer
792
views
How can I generate random answer string like "yes,no,maybe maybe not?
I dont know how can I generate random answer.
exemple result:
user:~$ ./question.sh do you love me ?
user:~$ yes
or
user:~$ ./question.sh do you hate me ?
user:~$ maybe
I try to put all the String ...
1
vote
0
answers
156
views
open a new terminal, let it stay, and switch back to original terminal, run command [duplicate]
I want implement like this
at terminal A, open a new terminal B, run command in B, leave B runing, and back to terminal A, run other command.
I have following script, but not what I expected
#!/bin/...
-1
votes
1
answer
840
views
Terminal commands not working
I moved all files starting with lib from /../ to some folder as,
mv /../lib* /to/some/folder
after which I can't move it back.It comes as
-bash: /bin/mv: /lib64/ld-linux-x86-64.so.2: bad ELF ...
0
votes
1
answer
497
views
Why do Linux command line scripts use '-' and '--' as a parameter prefix? [duplicate]
Why do scripts in Linux use - and -- as parameter prefixes?
What I mean is why do they use - (for example $ git --help) instead of something like >, (so it would be $ git >>help) or even ...
1
vote
1
answer
3k
views
strange characters in the log file from bash + how to avoid them ?
I am not understand why we got the following strange characters in out log
example -
^[[1m
or
^[(B^
or
^[[1m
or
^[(B^[[
or
^[[1m
from the log: ( example )
STATUS OF SERVICES
^[(B^...