How to show the oldest process of each user listed in the command who?
I've tried using the command
ps -u $user --sort +start_time
but couldn't find a way to filter the users and extract the PID from ...
I have 2 CSV files which look like follows:
I am a beginner in Unix commands as I am currently studying how to write scripts. However, I can't understand how to actually access a variable.
Suppose I have a variable called name ($name), I see ...
I have a block of text that I want to cat into bash and then send to python so I can work with it more.
So my command line is
cat input_file | sh bash_file.sh
My sh file is
I have a pretty long bash process that generate a few temporary files, some of them, with generated and almost random names.
I will like to avoid to manually delete them after a process failure.
I have a system with a watch folder where people/companies can upload new files via FTP. In this watch folder they should always upload 2 files:
One binary file with a prefix name of ABC* and always ...
Hei, I need help with how to print script name infront of exit status.
For instance my script name is myprog.sh and in it I have written exit 123. So when I run the script and then type command echo $...
I have a small script that copy some files from linux OS to usb when the machine shutdown.
My goal is I want the systemd service stop shutdown process then run script and then shutdown the machine.
We have a simple script where we execute the script using the command:
script.sh 123 456
Instead of using $1 and $2 inside the script, can we pass the command ...
I'm trying to run a script that launches retropie and pushes the output (the game) to the remote display.
I've gotten this to work perfectly on PI3 b+ running the Raspi OS, but I can't seem to get it ...
I have a script that prints a string to terminal,
and I want to check value of myScript output.(in this case resultString)
I tried with this method, but it didn't worked.
(for simplicty i replaced my ...
im a beginner,
And i want to writing a script ('for' loop) -
Requests a number
Multiply the number by 2 and start a raw of asterisks
And presents as here: (for example the number is 4)
Is it plausible that mget command may not be able to retrieve a large file 100mb, 1gb, due to it still being written by the host?
Is there a method to check? I would need to check FTP status codes, ...
I have a directory which has many sub-folders and under sub-folders there are other sub-folders. I want to copy all the directory and subdirectories into another location with copying only files with ...
I have a need where I must work with a set of files based on time elapsed (as I do not have control over when new files are added to the remote directory).
I must do several operations with this set ...
this probably is very easy to do but I just can't get my head around it
I've got a script that grep some values from a file (file1)
var1=$(cat file1 | grep foo | grep bar)
if I echoed $var1 ...
I am working on a HPC where I have to submit jobs via TORQUE. I was able to create output file for the following but unable to do the same when going through job queue.
I was able to write hello.txt ...
I have some jar services running in my machine .. i ran below command there
ps aux| grep java
this command gave me results .. but now what i want is if any of jar is not running then it should send ...
I've been trying to run a simple script named 'post-install.sh':
sudo apt-get update -y
This script is in ~/bin.
% echo $PATH
I have been looking at two pages https://gist.github.com/dpino/6743226422594b6c02c7150b6e5e7df7 (no nat) and https://gist.github.com/dpino/76b0bf7f522bd0d2e442eca06ae9db76 (nat but I don't know what ...
Good Morning - I wrote a bash script to read several files and to ping the host to see if it's available, if it's down then send an email. This will be ran in cron. The part i'm stuck on is when i'm ...
It is known that the character (!) Is reserved, the curious thing is that it works on the common user, but does not work as root, I tried some approaches to solve my problem, but without success, I ...
My file contain below comma separated data , where first row is the header
File data :
I need to display decreasing order count down timer from 20 sec till 00 sec
If he/she fail to enter password within the given 20 sec
then exit with message your time is over
you have 20 sec ...