Questions tagged [unix-shell]
130 questions
0
votes
2 answers
Remove parts of a path using parameter expansion... but how?
I need to remove the part
man1/bmtoa.1.gz
from the full path
/usr/share/man/man1/bmtoa.1.gz
so that it results in
/usr/share/man/
I've tried ${path#[!/]*/*} and ${path#/*/*} but both result in wrong paths.

Trollhorn
- 203
- 3
- 10
0
votes
1 answer
My Server is sending malicious SSH requests
I am facing weird issue on my server (Unix). There are couple vendors reported me that my server is sending malicious requests to their server by using SSH Protocol.
I have already checked the system logs under /var/log but didn't get anything…

sumit vedi
- 11
- 1
- 1
0
votes
2 answers
Bash & blocking processes
Could you help me with the Bash syntax to achieve the following?
Run a blocking process without blocking execution of the rest of the script.
Run a standard "non-blocking" process (e.g. lsof).
"Rejoin" the blocking process so that ^C will stop that…

xyz
- 501
- 2
- 7
- 13
0
votes
2 answers
What if I want to delete files that are not accessed for a few days in unix?
What if I want to delete files/folders that are not accessed for a few days in Unix?
Say there are some files that were last accessed 5 days ago in a particular location.
I want to delete those. What is the shell command for that?

Nikhil Vijayan
- 3
- 1
-1
votes
2 answers
bash script to detect when a file is added to folder and command exec
I am trying to write a script to detect whenever a file is added to a specific folder and run a command using the last file added name. What I am specifically trying to do is to create a QR code for each file I add in a specific folder.
So what I…

BashN00b
- 13
- 1
- 4
-1
votes
1 answer
What file is in every unix login?
I was asked that question and to be honest not sure if I understood that. I would say shell but instead of shell we can run any other program so ...
any idea by unix gurus?

Radek
- 1,153
- 4
- 26
- 39
-2
votes
1 answer
How to hide the 'dn:' value in Ldap unix shell commands?
I got a problem to solve.
How do i hide the 'dn:' part ?
dn: uid=trebbouh,ou=2017_paris,ou=2017,ou=paris,ou=people,dc=42,dc=fr
This is the command I used :
ldapsearch -x -LLL uid=$USER -W

Muska
- 1
- 1
-2
votes
2 answers
Create symlink if source exists
I'm trying to make a symlink to a directory if it exists only and cannot figure out how.
I tried various ideas I found and none worked.
Most notable idea that i thought would do the job was to use ln -s ls /path to test the dir for ln but it did not…

transilvlad
- 173
- 14
-2
votes
2 answers
Run bash script with command line arguments
I want to do
/usr/bin/bash myscript.sh -args
which, as it stands, runs the script but doesn't pass the args to it. I realize that the conventional syntax is simply
./myscript.sh -args
but I'm curious as to what I need to do in order to call the…

Trey Parkman
- 59
- 1
- 3
-3
votes
1 answer
Solaris - How to tell whether machine is running SPARC or Intel Chip
What command can I run to tell whether SunOS 5.10 is running a SPARC or Intel chip?

Kellen Stuart
- 97
- 4