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

0
votes
2answers
117 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
76 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
187 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
56 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
214 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
154 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
432 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
1k 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
113 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
60 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
476 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
252 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
47 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
233 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
255 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
149 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
121 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
63 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
121 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
100 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
53 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
207 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
200 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
849 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
654 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
128 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
62 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
95 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
699 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
147 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
153 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
298 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
47 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
525 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
3k 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
59 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 ...
3
votes
4answers
325 views

Bash one-liner that shows a running countdown until a DNS update (TTL expiration)

I find myself frequently tasked with updating DNS records and needing to know exactly when the refresh will begin (a.k.a TTL expiration). I came up with this bash one-liner that gives me the output I ...
0
votes
1answer
40 views

Sort the output of the “who” command

I'm trying to sort the output of the who command but I guess I'm kinda lost on this one. I want to sort it based on who just logged in. Thanks
-1
votes
2answers
139 views

Try the command multiple times [closed]

I need to execute a command and also check if it was successful. If there was an error, I should try again and the following code is working as expected. But what if I need to try the same command 3 ...
1
vote
1answer
919 views

could not stat config file “slapd.conf” to add entries to LDAP

I got a problem when I adding some entries in LDAP slapadd -l /etc/openldap/root.ldif -f slapd.conf -d 10 slapadd -l /etc/openldap/people.ldif -f slapd.conf -d 10 slapadd -l ...
0
votes
1answer
39 views

Protect against inadvertent command entry

I have a couple boxes in production and then some in a test environment. Anyone have any clever ways to protect against typing in inadvertent commands into boxes? i.e. I want to put a confirmation ...
-1
votes
2answers
1k views

Shell script :: Reading a column from file & store it in array [closed]

I am working on shell script where i want to store O/P of the command in array. I have a file containing rows & columns from where i want to extract 3rd column & store all values in a array. ...
2
votes
3answers
102 views

how to get [ current_path ] in shell bash prompt?

Is it possible to have the name of the current working directory in the prompt in shell ? Im working on OSX and CentOS in multiple projects under /srv/... and a mistake for wrong directory is quickly ...
-1
votes
3answers
100 views

grep command does not search the complete pattern [closed]

I am facing a problem while using the grep command in shell script. Actually, I have one file (PCF_STARHUB_20130625_1) which contains below records. ...