All Questions
527 questions
0
votes
1
answer
66
views
Creating in Linux files in GB or MB range by various size by read a file
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
73
views
Open 2 mate-terminal instances and run commands
I am trying to set up a script that runs 2 mate-terminal instances, each with a different command.
The script is set up as a cronjob.
The problem is, while the script works fine when executed manually,...
0
votes
0
answers
28
views
how to change error (std-err) color [duplicate]
Because standard error is a separate device in UNIX-like environments, and programs or shell scripts can redirect their errors to it, it would be logical to configure terminals (any displayer) to ...
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
3
answers
103
views
how to process a sequence of items in groups of N at a time
Sequentially one after another:
for i in $(ls -1) ; do command $i ; done
All at one time:
for i in $(ls -1); do \
( \
command $i ; done ; \
) & \
done; wait
How to say only for example 4 or ...
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 ...
-2
votes
2
answers
50
views
Remove last 9 character in alternate lines of file in unix
I need to remove last 9 character from a file starting from Line number 4 and remove only on alternate lines 6,8.. like that to last Line of file
-3
votes
1
answer
77
views
How to convert multiple columns to rows in shell (unpivoting)
I have a tab separated table with hundreds of columns and rows, like that:
OTUId AC0184 AC0250 AC0257 AC0258 AC0262 AC0263 AC0289 AC0293
OTU549024624 51659 0 0 0 0 0 0 0
OTU565712448 108 0 0 0 0 0 0 0 ...
1
vote
0
answers
325
views
Bash terminal lagging one input behind
After a recent update, I've noticed that working on any terminal for more than a few minutes causes a delay between inputting a keypress and seeing it reflected on the screen.
Specifically, if I were ...
0
votes
3
answers
80
views
How to match a pattern instead of a single letter/number using brackets?
I want exclude MSG, PDF and DOC from my path with shell parameter expension using brackets.
When I place MSG between brackets only deletes the M instead of MSG. I looked around on the internet and ...
2
votes
1
answer
404
views
Enabling command hashing in tcsh
It seems command hashing is disabled by default in our tcsh environment, and I'm not permitted to get it enabled across the board. Instead I'm looking to enable command hashing within individual ...
0
votes
0
answers
32
views
Does bash explicitly allow commands like passwd, su, etc., to run in setuid while disabling other custom binaries? [duplicate]
I know that /bin/bash has certain built-in protections that prevent the abuse of the Set-UID mechanism. So if I create a custom binary and execute it, it won't run with SUID 0 (refer the below image). ...
1
vote
1
answer
125
views
Force tcsh to check whether command exist in the path before attempting to execute it
I've noticed that tcsh, regardless of whether "-f" flag is passed on the shebang line, will iterate through $PATH, and try to execute the command from that path until the command is found. ...
0
votes
1
answer
68
views
Can't the user which is executing the program access the not permissible files if the SETUID is set? [duplicate]
I have two users first being ace and the second being ej
ace has a file in its home directory, which is a shell script, with the following permission set ( setuid i have used )
-rwsr--r-x 1 ace ace 15 ...
0
votes
1
answer
52
views
saving xargs ouput from multi files to one file
I have these three text files :
#1.txt
hey stackoverflow
#2.txt
hey stackexchange
#3.txt
hello world
I am using this command to list the last 3 files in my dir and then cat them and then save ...