All Questions
674 questions
-1
votes
1
answer
75
views
Creating in Linux files in GB or MB range by various size by read a file [closed]
In Linux with Bash, there is the File numbers_in_one_line.
In this file there is only one line with several numbers, all separated by spaces.
These numbers are the value in bytes for creating files ...
0
votes
1
answer
86
views
How to create splittet random files and join them with dmsetup
In Linux in Bash, there is a script, a part of the script is this
while true ; do
echo
awk -v x=$(<"$TEMPDIR"size_container_in_byte) -v n=$(<"$TEMPDIR"parts) 'BEGIN{...
-7
votes
2
answers
93
views
How can I pick random items from a list, but some more often than others, in a Bash config file? [closed]
In Linux, using Bash, I have two scripts:
script.sh is the main script, and
script_config.sh is the configuration for script.sh.
In script.sh, I do source script_config.sh to load all the config ...
-3
votes
1
answer
50
views
Rename files, remove the first four signs [duplicate]
There are many files in this format:
IMG_20240717_191421.jpg
IMG_20240620_165358_BURST001_COVER.jpg
IMG_20240624_173513_2.jpg
how can they renamed in Linux in Bash to:
20240717_191421.jpg
...
-1
votes
1
answer
72
views
Best tool to convert xlsx to csv
I need to install something that allow me through a script bash or if I can do it without install any external tool it would be great.
The thing is I read about csvkit but is a tool of python and i ...
2
votes
1
answer
167
views
select in a script
In Linux in Bash in a Script i use this:
#!/bin/bash
while true; do
while true; do
read -r -p 'enter number [4-999]: ' num
if [[ $num =~ ^([4-9]|[1-9][0-9]{1,2})$ ]]; then
...
-4
votes
2
answers
110
views
How to write in Linux in Bash in shellscript a part that can do something like this
How to write in Linux in Bash in shellscript a part that can do something like this
enter a number
must be in a range from 4-999
if not, ask again to enter
enterednumber * 5 * randomnumber [1-9] (...
1
vote
1
answer
110
views
add a randomize option in a bash script
in a bash script i do run this:
seq 1 $(<howmany.txt) | xargs -I% -n1 -P$(<parallel.txt) mycommand --infile file% --option A --outfile file%.new
it works.
the values in howmany.txt and parallel....
0
votes
0
answers
25
views
how to check how many loop-devices in a linux system are possible to use? [duplicate]
how to check how many loop-devices in a linux system are possible to use?
i need this in a script, are not more than X possible, than end the script with some message...
0
votes
2
answers
44
views
Capture and print on the exact match from a file
I am trying to use grep to match only a specific part of a row in a file.
The file is a huge csv file with some columns containing json with commas so it is hard to figure out which column what I am ...
0
votes
1
answer
124
views
How to add some random data at certain places in a file
With my Computer, it runs a Linux kernel and bash, i will make a technical-experiment.
I have a file, file.dat, size = 1.048.576 byte.
I will add at certain places in file.dat some irregular (1...8 ...
0
votes
2
answers
116
views
How to copy the value from one "column" to another in Bash?
I have a file with lines:
username="user1" email="[email protected]"
I need to take the username from the email address and replace the username value with it,
so the end result ...
0
votes
1
answer
36
views
Linux Shell Script replace last shown lines at the screen, not write it under the last once
i run a script from bring formated numbers to the screen :
#!/bin/sh
while true ; do
echo
awk -v x=987654321 -v n=8 'BEGIN{srand(); while (--n) {$++NF = int(rand() * x / n); x -= $NF}; $++NF =...
0
votes
1
answer
60
views
join a specific number of files/devices in linear mode together in a linux system
For joining in Linux files/devices in linear mode together i have this script dm-joinlinear.sh from
join files/devices in linear mode together in a linux system , thanks telcoM
#!/bin/sh
usage() {
...
0
votes
1
answer
70
views
Use fallocate with numbers from text file
For testing i create at my Linux-System the file list.txt. In there are numbers like:
4 1 5 2 3
(sometime there are more or less numbers)
How do i run these numbers with fallocate?
fallocate -l ...