A shell is terminology for a command-line interpreter most commonly used with Unix-like operating systems, but also used to interact with GUI-based operating systems in a more granular fashion. Not only does it allows the user to run programs from a text interface, but frequently offers basic ...

learn more… | top users | synonyms

1
vote
2answers
374 views

Gnu parallel & pipe

I want to send each line of a file to another program's stdin, e.g. input.txt line1 line2 line3 I want to use the gnu parallel like this (i.e. pipe each line as stdin to the more command) cat ...
1
vote
2answers
153 views

How do I iterate bash arrays and make an SCP command efficiently?

I need to scp the files from machineB and machineC to machineA. I am running my below shell script from machineA. I have setup the ssh keys properly. If the files are not there in machineB, then it ...
3
votes
0answers
165 views

Security Warning: Enable “Jail Apache” in the “Tweak Settings”? [closed]

I have VPS running WHM on CentOS 6.5 and I have root access. A security warning appearing in the Security Advisor. Warning: Enable “Jail Apache” in the “Tweak Settings” area. I entered the tweak ...
1
vote
1answer
34 views

How to generate a signature with a launchd plist? [closed]

Is it possible to implement the following shell script completely as a launchd plist to generate a signature with timestamp in the StandardErrorPath / StandardErrorPath files? #!/bin/sh echo "Hi, ...
0
votes
2answers
82 views

redirect command executed along with output shell

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!
0
votes
2answers
57 views

best practice for setting PATH variable in nested user env

In my user environment I/(macports) have set my PATH to be in the form of PATH=app1/bin:app2/bin/:...:$PATH However if I have nested shells the PATH variable gets concatenated all the time, of ...
3
votes
3answers
1k views

Log commands executed over ssh

I would like to log all commands executed over SSH. Say, ssh something@server.com COMMAND I want to log "COMMAND" on server.com I did search extensively but could not find anything. There is ...
17
votes
3answers
921 views

How do I ssh on slow/flaky connections?

I am dealing with a really slow shell connection. It is in the cloud and I am very far from the server. My connection also breaks sometimes as it is over the internet and I may also be using shared ...
0
votes
2answers
122 views

How to regain an interactive shell that was disconnected via SSH?

Scenario: I am on windows, using putty to login to a root shell. It is currently running an interactive process which prompts for input to continue. Typical interactive process, its probably waiting ...
1
vote
1answer
2k views

Insserv rejected the script header

I was trying to make an init script for my debian install for supervisor. insserv: Service \$remote_fs has to be enabled to start service supervisor insserv: Service ...
-1
votes
2answers
77 views

Setting IPtables rules into a file

Currently I have a debian install with a shell script which has the following content (as an example): # Setup iptables IPT="/sbin/iptables" # Flush old rules, old custom tables $IPT --flush $IPT ...
0
votes
1answer
211 views

Installing PIP on debain - Unknown command pip

I'm having a bit of a hard time installing PIP on a debian linux machine. This is the code I am using in a shell script: # Install setuptools python -c 'import setuptools' > /dev/null 2>&1 ...
1
vote
1answer
59 views

cp/rsync command with destination as symlink to a directory

I am working on a cPanel backup solution at the moment. We are now informed about this exploit. Exploit : Full ROOT ACCESS to server 1.) create malicious file from, normal user account: mkdir root ...
2
votes
2answers
234 views

executing .bash_profile alias via SSH

I would like to remotely execute a .bash_profile alias, but I cannot find the proper command. I tried: ssh user@host "bash -ic myalias" but it doesn't work I get: bash: cannot set terminal process ...
1
vote
2answers
227 views

scp only files with defined extension

I want to transfer only files with special extensions (like only *.tar.gz, *.war) in one scp command (Debian Linux). Is this possible, if yes how is the syntax? Should be someting like: scp ...
2
votes
1answer
524 views

Despite #!/usr/bin/env php I need to call the file with php, why?

I'm trying to call the shell wrapper for phing phing ...but it doesn't recognize the env, I get a -bash: phing: command not found ...even though the file starts with: #!/usr/bin/env php ...
0
votes
2answers
2k views

Allow www-data to execute shell script

I have a shell script called boot.sh on an Ngnix server I am trying to call it via PHP, but I don't think I have permissions. How can I give www-data permission to run boot.sh - and only boot.sh ...
0
votes
1answer
127 views

Transfer used ram to swap and free more physical ram

I have a vps with 256m physical ram and 512m swap space, I am trying to use a software that need more than 256m and less than 512m ram, so it uses swap. The problem is at some moment of the ...
0
votes
1answer
66 views

cron to anacron migration process

I have a script that I want to run nightly on my lab's RHEL 5 and 6 workstations, so I'm deploying the script to each system's /etc/cron.daily/ directory and making it executable there. But some ...
2
votes
3answers
586 views

Shell access for a KVM VM

I would like to access my KVM VM with a shell. I created it via proxmox 2.3, Ubuntu 12.04 is installed on it via an official template. I would like to find the same command as vzctl enter ...
-1
votes
1answer
276 views

Cacti Export Tool Script [duplicate]

I'm looking for any script that possible to export graph of Cacti into CSV/text format. I have several interfaces in different devices, so I want to export those graph by using cron's job for sending ...
0
votes
2answers
49 views

Change/Deactivate the shell for an amount of users on SUSE Enterprise Server

I have a SUSE Server to which ~300 users are connecting. About 100 of them have to be deactivated. I think it would be nice to change their shell to /bin/false either with chsh or with usermod. ...
1
vote
3answers
1k views

Running ssh-agent from a shell script

I'm trying to create a shell script that, among other things, starts up ssh-agent and adds a private key to the agent. Example: #!/bin/bash # ... ssh-agent $SHELL ssh-add /path/to/key # ... The ...
-1
votes
1answer
258 views

Display Power on hours of hard disk from shell

Is there a program which can display the power on hours of a hard disk from a *nix shell? I'm rewriting a server benchmark program, and this would be a useful value to compare.
0
votes
1answer
34 views

list all files with the same name in order of when they were modified

I have a directory, let's call it htdocs/live/. Many different directories are underneath this directory, each with a file commonFunctions.js living in the js directory. For example, here is the ...
0
votes
1answer
282 views

(bsnmpd), uid 0: exited on signal 6 (core dumped) / Syntax error: word unexpected (expecting “then”)

I'm using FreeBSD 9.2-RELEASE: # uname -a FreeBSD f9.alexus.org 9.2-RELEASE FreeBSD 9.2-RELEASE #0 r255898: Thu Sep 26 22:50:31 UTC 2013 root@bake.isc.freebsd.org:/usr/obj/usr/src/sys/GENERIC ...
2
votes
2answers
152 views

monitor a directory with a shell script

I'm looking for shell command like the kernel's inotify function. Is there a command that will monitor a directory, that could be used like this: while [ 1 ]; do name-of-monitor-program . ...
4
votes
2answers
122 views

Is there a good reason not to add sbin to the default PATH?

Background: The PATH environment variable specifies the directories to be searched through when a command is issued without specifying a path. "sbin" paths (/sbin, /usr/sbin) are intended to house ...
1
vote
0answers
64 views

Why Parent Class In a TC Rules Tree Not Working

The parent class in my TC rules script doesn't work as it garanteed! Can somebody tell me what is wrong with my script? Here are some details about my question: From the chapter "9.5.4.4. Sample ...
1
vote
1answer
125 views

How to prevent users from renaming files while providing write permissions on Linux [closed]

For some special purpose, I want to prevent non-root users of the Linux Server from changing/renaming the filenames. However, they can modify and write to the contents of the file. How to do this from ...
0
votes
2answers
102 views

What seems wrong with this bash script? [closed]

I found an initscript that for some reason insists on starting the specified application as the root user. I can't wrap my head around why it is doing this, any hints? The script runs on Redhat ...
1
vote
1answer
54 views

remote shell to and from server core. So I can “dir”

What are the prerequisites for \\serverNameOrServerAddress\C$ to work in Cmd? So I can catch a file for my firewall in server core.
1
vote
2answers
233 views

find: how to not have errors (stderr) when no files exists

I have a custom script which gzip log files when they are one day old. In my script all errors (stderr) are logged to a file and at the end of the script I use this file to know if its execution was ...
1
vote
2answers
262 views

Strange characters from output in shell

Over the past few years there have been some Linux systems that will output strange characters when running various commands. Here's an example of my output from the sensors command on one of those ...
1
vote
1answer
990 views

Can't stop mysql too many connections

running mysqladmin shotdown gives mysqladmin: connect to server at 'localhost' failed error: 'Too many connections' Can't find a solution to reboot mysql
2
votes
2answers
798 views

Shell script command output in if condition comparison fails to compare to same value string

I'm incorporating a script snippet which determines Android version via: adb shell getprop ro.build.version.release which returns: 4.1.2 or 4.0.4 The snippet currently looks like this: if [ "$(adb ...
0
votes
1answer
34 views

Running jobs in a HPC cluster [closed]

I'm quite new to HPC environment. Is there any difference in running a job on a node utilizing 8 cores and running the same job on 8 nodes utilizing I core in terms of performance or walltime used. ...
25
votes
3answers
2k views

Did a cat /dev/urandom - Broken terminal

Out of curiosity, when your shell character set breaks from doing something like cat /dev/urandom is there a way to fix that in place?
-1
votes
1answer
139 views

`pwd -P` preventing bash script from running in supervisord [closed]

I'm running supervisord to execute gunicorn. My problem is when my script contains CURR_DIR=`pwd -P` and run the script via supervisord, it STOPS the process. My script is located in /var/www/conf and ...
1
vote
2answers
70 views

enabling shell access for cyrus user

My current cyrus user in /etc/passwd looks like this: cyrus:x:76:12:Cyrus IMAP Server:/var/lib/imap:/sbin/nologin I want to be able to give it shell access but restrict it to /var/lib/imap and ...
1
vote
2answers
105 views

If I know the PID number of a process can I know its name?

If I have the PID number for a process (on a UNIX machine), how can I know the name of its associated process? What do I have to do?
15
votes
2answers
732 views

Bash Prompt Below Output - Background Log Tail

I used to work for a company who had a customised shell for management of one of their products that was running on Linux and I'm looking to replicate a key feature of this shell. All the work was ...
1
vote
1answer
156 views

Shell script error on filename with spaces

I have a bash script that search for every static file located under my server root and stores a gzipped version next to each file. I got it from ...
2
votes
2answers
170 views

How can I get an integer output on BSD ping?

I am trying to perform a simple check on an integer value output from ping. In Linux this was working quite nicely, but the FreeBSD ping outputs a float value with percentage sign suffixed. ...
-1
votes
3answers
60 views

What shell scripts have run [closed]

Is there any way to determine what shell scripts ran within a certain time frame? I.e. I need to know all the shell scripts that ran yesterday between 2:00 an 5:00.
0
votes
1answer
306 views

Cron job does not generate expected log file

I'm trying to execute a shell with crontab. The cron job executes the shell but doesn't generate the log file i need. This is what i'm using for my cron: 10 * * * * /home/user/3nvo.sh This is a ...
0
votes
1answer
49 views

Store pid of a forked process in a file

I have the following but I'm worried about $! being overwritten prior to the echo command taking place. How do you guys recommend going about this? sleep 100 & >/dev/null ; echo $! ...
5
votes
1answer
588 views

Are ulimits inherited by the shell, by the user, or a combination?

When a process spawns a subshell, how is the ulimit inherited? Is it by user, by shell, or a combination? Specifically, this was found in the context of HP Server Automation jobs failing on some ...
-2
votes
1answer
4k views

Cannot find a valid baseurl for any repo in centos 6.4

when I want to install any repo I found this error Error: Cannot find a valid baseurl for repo: rpmfusion-free I'm using centos 6.4 I tried to check other packages I found the same error ... so ...
3
votes
1answer
60 views

Is it possible to attach a shell to an existing ssh tunnel?

I have a few SSH tunnels setup for auto-connection/re-connection with Shimo. Is there a way of attaching shell access to those existing tunnels and how if so? Or will I have to establish a new ssh ...