Skip to main content

Questions tagged [unix-shell]

1 vote
1 answer
401 views

Can anyone help me scheduling a job on crontab that will run on 12th of each month and if 12th falls on weekends it should run on the next Monday. I found something from Internet but it's not working ...
Kunal's user avatar
  • 11
0 votes
0 answers
262 views

I am trying to add system/device mac address in syslog. No solution is working for me. Following command gives me mac address, just wanted to use in rsyslog template. mac_addr=$(ifconfig en0 | awk '/...
sandip karanjekar's user avatar
0 votes
1 answer
81 views

am working on a scenario where i need to Change Ubuntu server password every 7 days and do autologin. i tried with breaking the problem: command to create user with password: useradd -p $(openssl ...
user9990's user avatar
2 votes
0 answers
327 views

On ESXi Hypervisor, If I run a command on the terminal via SSH, the commands are logged in the shell.log file, i.e if i run this command [root@esxi04:~] ls -la then I can see this command in shell.log ...
Cool Guy's user avatar
2 votes
2 answers
8k views

I'm trying to suid a shell and it's not working. I need help understanding why, and how to fix it... I'm following these steps (as root) cp /usr/bin/bash /usr/bin/bash-emergency chmod 4755 /usr/bin/...
mikem's user avatar
  • 480
2 votes
2 answers
413 views

I want ONLY directories and files that contain the letter. I've been able to recreate it from a previous question. But the tar is not a gzip. And when trying to make it a gzip it...doesn't remove ...
Zweks's user avatar
  • 23
1 vote
1 answer
169 views

Migrating from rssh to rush... I can't figure out what it means by not an absolute directory name. see logs below: Aug 31 14:07:24 secmgrprd04 systemd: pam_unix(systemd-user:session): session opened ...
Russell Fulton's user avatar
2 votes
2 answers
2k views

Linux distributions place some important scripts and config files in the skeleton, from where they are copied to each new user's home directory. Ideally system-wide files would be used instead of ...
Tronic's user avatar
  • 121
0 votes
1 answer
384 views

below is my use case , I have to take a input from a user for a specific command which need to run on a remote machine.But my problem is I am not able to access that machine directly so what I am ...
Mohan's user avatar
  • 1
1 vote
1 answer
554 views

Problem context I am trying to implement a job orchestrator whose agent/worker programs, connect to machines via an SSH session/shell. I would like to transfer (potentially binary) files to these ...
Daniel Gray's user avatar
0 votes
1 answer
532 views

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 ...
sumit vedi's user avatar
1 vote
3 answers
645 views

I'm writing shell script on my custom board. In this script I use openssl to encode file at runtime using this command: openssl des3 -salt -in file.txt -out my_file.des3 -k my_password Is there a way ...
init's user avatar
  • 13
0 votes
2 answers
192 views

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 ...
Nikhil Vijayan's user avatar
0 votes
1 answer
203 views

PFB script dd=$(perl -e 'use POSIX;print strftime "%Y%m%d",localtime time-172800;') Date=$(perl -e 'use POSIX;print strftime "%d%m%Y",localtime time-172800;') for i in `cat /path/Path_CDR.txt` do cd ...
Bhushan's user avatar
0 votes
0 answers
45 views

I am running a cron job everyday at 21:00 UTC which downloads few csv files from sftp server, renames the downloaded files and then loads the files in database(mysql) and updates the time in database (...
Roy's user avatar
  • 1
1 vote
3 answers
151 views

I want to replace in this string Wed Apr 10 06:44:10 UTC 2019 all whitespaces with comma and along with that trim off UTC part. What I have tried : var1="Wed Apr 10 06:44:10 UTC 2019" echo ${var// /,...
Alex's user avatar
  • 302
0 votes
2 answers
825 views

I would like to parse mail log files, which originally look like this: 2018-10-23 23:27:51,026 INFO [ImapServer-4] [ip=10.10.11.50;oip=168.232.24.2;via=10.10.11.50(nginx/1.7.1);ua=Zimbra/8.8....
Labsy's user avatar
  • 53
0 votes
2 answers
784 views

I'm writing a script to change few setting according to location and to do this i selected hostname as a benchmark. My aim is, if my hostname condition comes true then do this. For this i'm writing a ...
root's user avatar
  • 39
2 votes
1 answer
4k views

I'm in the cur folder of a maildir store. I want to cat a message .. pipe it to a command .. and have the body of the message spit out. Simple. Example: If its a mime message .. and there is a ...
user avatar
-3 votes
1 answer
2k views

What command can I run to tell whether SunOS 5.10 is running a SPARC or Intel chip?
Kellen Stuart's user avatar
4 votes
2 answers
6k views

We had a guy retire on us, and the documentation left behind is a little on the light side. Need a little help identifying and using part an older client-server system. The server itself is ...
JonathanDavidArndt's user avatar
0 votes
1 answer
256 views

I'm completely new to the scripts and hence need help to fix this. We've around 3000 VMs & 450 Physical servers which are Linux based servers (few of then ubuntu starting from 9.x & few of ...
Hrish's user avatar
  • 87
-2 votes
1 answer
2k views

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's user avatar
  • 1
1 vote
1 answer
2k views

Ok if subject is not clear i will explain my doubt.I have a shell script kept at my local user called (executeAdM.sh), and when i execute this script i am connecting to SUDO user by taking commands ...
Tushar Sharma's user avatar
0 votes
1 answer
148 views

This question has been asked previously in https://joomla.stackexchange.com/questions/20697/securing-a-joomla-installation-on-apache-mod-php but it may belong here better since it is not Joomla ...
ExternalUse's user avatar
1 vote
1 answer
158 views

In my system, df -hT outputs something like this: > df -hT Sist. Arq. Tipo Tam. Usado Disp. Uso% Montado em devtmpfs devtmpfs 1,9G 8,0K 1,9G 1% /dev tmpfs tmpfs 1,...
j4x's user avatar
  • 105
0 votes
2 answers
2k views

I am facing a weird but a sensible issue, I have 2 ORACLE_HOMEs, 1st one points to ORACLE Database Software and 2nd one points to ORACLE Client Software. Why I am forced to do this - reason is: In my ...
Gaurav Bhaskar's user avatar
0 votes
1 answer
324 views

I have a program that generates large logs on the standard output. Actually I don't care about the log, but I do want to know the last 1000 lines or so if the program finishes or crashes. I want ...
steve00's user avatar
-1 votes
2 answers
2k views

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 ...
BashN00b's user avatar
0 votes
1 answer
163 views

What I'd like to do is run the same command twice while hitting enter once, with minimum typing. This would be the long version for example: # sudo puppet agent -tv --server foo.bar && sudo ...
spoovy's user avatar
  • 366
0 votes
2 answers
285 views

We have multihomed servers. And to simplify things, I would like to know the dns of the interface trough which I'm logged in. (e.g. to set PS1 thus it can be used in scp commands) My solution for ...
Thomas SV's user avatar
1 vote
1 answer
186 views

The PID file for this statement is created but it is always empty. When running the shell with -x I see that $! empty, yet at the end the java job is left running in the background as desired. Why is ...
Neil H Watson's user avatar
0 votes
1 answer
373 views

script abc.sh is on machine M1 and xyz.sh is on machine M2 script abc.sh: #!/bin/bash ssh -l user1 host.com ./xyz.sh -b1 arg1 -b2 arg2 script xyz has certain user prompts like pwd etc When I ...
S.Singh's user avatar
1 vote
1 answer
2k views

When I run df -hl | grep '/dev/disk1' | awk '{sub(/%/, \"\");print $5}' I'm getting the following error: awk: syntax error at source line 1 context is {sub(/%/, >>> \ <<< "\")...
KinsDotNet's user avatar
0 votes
2 answers
233 views

Is there any good existing solution for moving files from host A to host C, using host B a an passive intermediate storage area. A -> B -> C Limitations Host A and host C are on separate networks ...
error's user avatar
  • 117
3 votes
1 answer
203 views

I am doing a some PHP development on an IBMi running ZendServer6. I have to call PHP by its full path of /usr/local/zendsvr6/bin/php-cli. Is there a dotfile I can edit in my home directory or some ...
Justin Dearing's user avatar
14 votes
2 answers
23k views

I have a source directory on a machine with a bunch of files, all with the same permissions, that I want to copy to another directory, that is mounted via SMB. [tmark@dexter JR09141045 ...
tmark's user avatar
  • 141
0 votes
1 answer
954 views

I have a shell-script which extract details from a log file between two dates and executes a command on the output to generate some report.The log files are on different server and scripts are ...
anand's user avatar
  • 152
14 votes
5 answers
2k views

(From : https://stackoverflow.com/questions/15245144/copy-file-permissions-but-not-files, closed because off-topic) I have two copies of the same directory tree. They almost have the same files in ...
Mariano Paniga's user avatar
-2 votes
2 answers
1k views

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 ...
transilvlad's user avatar
5 votes
2 answers
44k views

For some reason my cron job scripts aren't exiting cleanly and they're backing up my server. There are currently a couple hundred processes running for one of my users. I can use the following command ...
I wrestled a bear once.'s user avatar
0 votes
1 answer
2k views

I'm unable to run a script in linux using plink.exe. I'm using my user x to login and script is under y user, which I need to sudo to y and run it. I was able to at command prompt manually but not ...
sagar's user avatar
  • 1
2 votes
1 answer
256 views

Is another question extended from the previous one [1] I have a compressed file and stream them to feed into a python program, e.g. bzcat data.bz2 | parallel --no-notice -j16 --pipe python parse.py ...
Ryan's user avatar
  • 6,351
1 vote
1 answer
943 views

Curl is working fine on the node itself: [ec2-user@smokebase1 ~]$ curl -s -I --retry 3 --header 'Host: smoke-base.dev-test.com' localhost:8080/test/api/search?where=where%20%2Fxml%2Fitem%2Fcategory%...
A_01's user avatar
  • 133
2 votes
3 answers
2k views

I am working on migrating an application from OpenVMS to RedHat Linux 6. The application is a green screen terminal application. The users will log into Linux via SSH and the application should ...
greyfox's user avatar
  • 267
0 votes
1 answer
841 views

I am trying to install RVM on a Solaris 11 system, the curl -sSL https://get.rvm.io | bash -s stable went through, but when I actually try to use rvm, it simply stats "ERROR: Missing GNU tools: grep ...
Metaphox's user avatar
  • 101
0 votes
2 answers
199 views

I would like to redirect the command executed along with the output to a file. for example: #ls >ls_out.txt ls_out.txt should be something like : ls file1 fil2 Thanks!
kumar's user avatar
  • 481
0 votes
1 answer
2k views

I want to Check processor status- check processor/cpu status and failed/off status so for that I used command prtdiag and want to fetch the cpu status only from that. how can i do that?
user2189689's user avatar
2 votes
2 answers
322 views

I have a c++ tool that outputs to STDOUT via printf i.e. printf ("%s\n", logline); I then pipe that to rotatelogs i.e. tool | rotatelogs /tmp/logs/log_%s 60 Everything works great, but ...
Brian Haines's user avatar
1 vote
1 answer
113 views

1) Here is the command to install special package (for example system/header) #pkg install system/header 2) ALso we can install several packages #pkg install system/header network/ssh package/rpm 3)...
pavelartlover's user avatar