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

5
votes
1answer
647 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 ...
3
votes
4answers
376 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
41 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
163 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
1k 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
2k 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
108 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
102 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. ...
1
vote
1answer
73 views

Search log files newer than a time

I have a log file which has entries like below. I want to find only the log entries newer than a given time. What would be a suitable shell script for it? [2013-06-23 21:31:19,972] INFO [2013-06-23 ...
0
votes
1answer
249 views

Why is this cron job with shell script failing? [duplicate]

I created a cron job to do a daily backup, to store it in the directory /backups This backups directory is located at the root [/] of the VPS server and is a separate backups partition provided by ...
0
votes
1answer
268 views

automatically start and and selectively stop multiple instances of couchdb on osx

I have successfully installed couchdb via homebrew: % brew install couchdb ...and invoked mutiple instances as directed here: % OLD=/usr/local % NEW=/tmp/couchdb % mkdir -p $NEW/etc/couchdb/ % ...
2
votes
1answer
134 views

How do I find the biggest files on multiple servers and sum up their size?

I am trying to find the biggest files in the /export/home directory and add up (sum) their sizes. Script: #!/bin/bash filename=hostnames > export_home.log while read -r -a line do ...
2
votes
2answers
88 views

Are passwords sent via a bash script retrievable?

As part of running a backup script for a linux server, I have commands like mysqldump within a bash script which contain the mysql root password, and certain ftp server passwords. Are these ...
2
votes
2answers
428 views

Is there a shell to change password when connecting over SSH?

This is a pretty odd question, but I'd like my users to be able to change their passwords for my FTPS server, which is using local accounts. Currently all these users have /bin/false set as shell, but ...
2
votes
1answer
1k views

Linux- Permission denied?

I'm installing Neo4j server as a linux service, but when I install it, I get the following message: /sbin/insserv: Permission denied What is this? What should I do? I'm running everything with ...
0
votes
4answers
2k views

The opposite of su: run a command without root privileges

I'm writing a shell script where most commands don't require root privileges. The script should be ran by the administrator. But I would like to be able to "su" to a normal user account for the parts ...
1
vote
3answers
702 views

How can I suppress the “…this does not map back…” message when using SSH?

I am writing a script that attaches to several of our machines via SSH to check some usage stats. Each time I do: ssh -i ~/.ssh/ourkeyfile.pem user@host I get the typical message: Address ...
1
vote
4answers
510 views

move files from one device to another

I am trying to automate a remote backup on our centOS server, I run the current command : nice -n 10 mv -vfb /media/localbackup/* /media/remotebackup/ however when this is ran I get the following ...
-2
votes
1answer
2k views

accessing own XAMPP directory through shell putty [closed]

I am trying to compare directories from a shared host server and directories located in my own computer. Own computer has XAMPP as the server. To compare these two directories, I need access to the ...
0
votes
2answers
84 views

Copy file to backup directory preserving folder structure

I have to copy a file in a directory, to its backup directory, preserving the folder structure. Ex. The file aaa in MyFolder/Test/aaa to .MyFolder.bck/Test/aaa I tried to use cp --parents ...
0
votes
2answers
512 views

SSH direct stdin and stout to and from postgres client

my local can connect to remote , but it cannot connect to dbserver. remote can connect to dbserver (with psql). I want to run sql scripts from my local against the db. I am looking to a way to open ...
1
vote
1answer
396 views

w command not showing users when not root

I have multiple users logged on my server (ubuntu 12.10), with ssh. None of them has root privileges. If I log in with my admin account and type w the resulting output is: 17:21:05 up 10 days, ...
5
votes
3answers
3k views

chsh: PAM authentication failed

i want to change default shell env and run chsh -s /bin/zsh as root user, but a error message appeared: chsh: PAM authentication failed. i find this thread ...
1
vote
2answers
55 views

I want to filter out two lines from the output of a program [closed]

I have a command that outputs a bunch of data, but I only want two lines. Grep doesn't work because the lines I want are not next to one another. I can't seem to figure out sed... Help please. :) ...
0
votes
1answer
611 views

expect script not working with bash script

I want a script that ssh to remote server and then run a script which is at my local machine and then store the output on my local machine Expect script for ssh to remote server: #!/usr/bin/expect ...
5
votes
1answer
1k views

nc (netcat) hangs, waiting for more data, in UDP mode.

I'm trying to send a small string to statsd via nc inside of a read block: while read line; do printf "folder.counter:value|1c" | nc -q 0 -u $host $port done Unfortunately, when in UDP mode, nc ...
0
votes
1answer
409 views

APC Network Shutdown script on vMA

I'm trying to configure the APC Network Shutdown script for 3 ESX hosts, and it doesn't seem like I can run my test script on my vMA appliance. I'm trying to verify I've set it up correctly using a ...
-1
votes
1answer
230 views

filenames, ASCII unicode escaped sequences to UTF8 [closed]

I'm not sure if I've grasped the issue here so if I haven't just say so and I'll edit the title. My problem is the following: I have an Ubuntu 12.04 server (UTF-8 locale) to which users upload files ...
0
votes
4answers
214 views

Move files to subdirectories: /img/ab123.jpg --> /img/ab/ab123.jpg

I have a linux webserver with about 25.000 images in one directory. They are all lowercase and in the format two letters, three digits and jpg as the extension. Because that many files in one folder ...
-1
votes
1answer
666 views

Automate git-pull, stuck with keychain

I'd like to create a cronjob to automatically run a git-pull every minute. The problem is that my repo is private, I had to create keys on my system (Ubuntu Server 12.04). I installed keychain and ...
0
votes
0answers
25 views

Running command from script won't give desired output

If I run sudo /usr/lib/update-notifier/apt-check -p &> ~/update-list.txt directly on terminal, I get the update-list.txt file with all the updates in it. But if I write the same command in a ...
2
votes
1answer
143 views

Where is $HOME set in Centos 6.3

WHere is the $HOME environment variable set in Centos 6.3? I've looked in: /etc/profile /etc/profile.d/* /etc/bashrc ~/.bash_profile ~/.bashrc Also, the second to last column in /etc/passwd has ...
0
votes
1answer
375 views

Linux how to run a script in the background on a remote server? [closed]

I'm on a linux machine. I would like to run four perl scripts on a remote server. Each script produces a single output file but it can take hours to run. I would like to run the scripts in the ...
0
votes
0answers
216 views

shell command queuing system linux (like atd)

I need to queue shell commands depending on current available resources. I know of atd and it's exactly the type of tool I would like to find but with consideration for RAM and possibly disk ...
1
vote
2answers
97 views

Exporting paths and configs in ubuntu

I am trying to add some exports using the following method: # SETUP CONFIGS sudo bash -c "cat >> /etc/bash.bashrc" <<'EOF' export AWS_CONFIG_FILE=/etc/test/aws.txt export ...
-1
votes
1answer
61 views

How to tar into a directory. [duplicate]

I would like to be able to tar all of my files so that when the are extracted they're in a sub directory I have specified. For example if I have File1 File2 and File3 inside of my current directory I ...
0
votes
3answers
2k views

Cant run rc.local manually and doesn't run automatically on ubuntu

This is quite a simple one. I created an rc.local file here: /etc/rc.local I made it executable. However, it doesn't run when I boot the server. I can see it in the directory and when I try to run ...
0
votes
1answer
342 views

can't access sourced variables inside Upstart script stanzas

I'm trying to use the variables defined in /etc/environment in an upstart script. I'm able to export the variable to the child process but for some reason I not able to use them in the upstart script ...
0
votes
1answer
255 views

Shell - Fix 80 column wrap limit

I have several Centos servers that enforce an 80 column limit when I ssh into them, rather than being dynamic and going to the width of whatever shell I am using as seen here: . Is there a way to ...
0
votes
1answer
223 views

Mysql select query not generating result on cron but is ok via terminal

We have a C program (source is below). We compile it with: gcc -Wall -Wextra -g $(mysql_config --cflags) get1ReceiveSource.c $(mysql_config --libs) -lrt -o get1Receive The select give results ...
1
vote
1answer
95 views

How do I run a shell script only any files are modified in a folder?

I need to replicate a folder over a very slow link to several destinations. Currently I create a text file with find. find "$sourcedir" -exec ls -la {} \; > "$statefile" I then compare it to a ...
1
vote
1answer
361 views

Trying to use sudo with bash subshell: env variables not working

I have read a few other posts, it appears cumbersome to do multiple commands within sudo. Heredocs suffer from limitation of not being able to do redirection of stdin/stdout. Here in any case is a ...
0
votes
1answer
181 views

Attempting to change shell to ZSH on Amazon Linux: Asking for ec2-user's password

What do I enter? I use the provided private-key to authenticate when SSH-ing to the server, so I don't think I actually have a password for the user... Also tried this:
0
votes
2answers
112 views

IPv6 reverse not resolving for Linux shell “last” and “who”

IPv6 is properly resolving in DNS: > host 2607:fa18:0:2::17 7.1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.0.0.0.0.0.8.1.a.f.7.0.6.2.ip6.arpa \ domain name pointer sine.xmission.com. However, the ...
3
votes
4answers
687 views

Download a file from the shell when button click is required

I have a link to a file that I would like to download from the shell. Unfortunately, the URL redirects to a software license agreement page which requires clicking an accept button. This is fine when ...
0
votes
1answer
123 views

Why is dash the new default shell among Debian squeeze [closed]

Can anybody tell me why Debian changed the default shell from bash to dash? I run in different issues with the new shell and I would like to understand what's the cause for this change.
0
votes
1answer
208 views

Remove text between delimiters in linux [duplicate]

Server got hacked and a fair amount of files were edited. We noticed that the code that was inserted were typically done between delimiters (e.g. /*e21234*/ blah blah /*/e21234*/). What is the most ...