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
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
207 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 ...
1
vote
2answers
433 views

Changed shell and can't ssh login to root account

I used the command usermod -s /bin/fish root to change the root user's shell and now I can't login to my root account. Why is this happening? I am trying to SSH into a server running Ubuntu through ...
2
votes
3answers
126 views

Can I use EC2 as a random Unix shell? [closed]

I have a small, low-cost, VPS that I use for some "grey-beared-Unix-guy shell stuff": basically, hosting a Debian running a XMPP bot, keeping long lived shell sessions with tmux under intermittent ...
2
votes
2answers
403 views

rsync not deleting folders

I have a problem rsyncing my folders. In my home there is folder named "workspace". Recently I changed its content a lot, creating new directories, deleting old ones. New folders were successfully ...
0
votes
2answers
146 views

xargs remove file name containing $

I am using xargs to remove files from remote server. xargs -a /var/log/del.log -i -exec ssh root@abc.com 'rm -rf "{}"' del.log contains path of the files which are deleted on local server and I ...
0
votes
1answer
324 views

dsh (dancer's shell): is it possible to specify ports in config file?

Using dsh you can define the list of machines in ~/.dsh/machines.list in the form: <user>@<host> I'd like to have multiple hosts with different ssh ports, like this (I tried): ...
2
votes
3answers
2k views

gpg-agent says agent exists, but gpg says agent doesn't exist?

I'm struggling with some issues while scripting gpg with bash on a Debian 6.0.6 box. I have a script that does a batch of operations and wants to make sure that a gpg-agent is available before it ...
2
votes
1answer
71 views

Is there a Linux utility to return an error code for a particular input?

I'm running Puppet, and I need to run one of the defined exec commands only if a line does not exist in the output from a different command. I can set up a contingency with a unless clause (which ...
2
votes
2answers
3k views

ssh root access denied after changing shell

after i tried to change my server shell, i cannot login as root anymore. First, i installed the z-shell (zsh) as root and then i wanted to change it to my default shell. Therefore i used "chsh". My ...
12
votes
2answers
616 views

backslash at the beginning of a command

In Installing RVM manual I see a lot of lines starting with '\': Install RVM with ruby: $ \curl -L https://get.rvm.io | bash -s stable --ruby I'd think it is just mistype but they repeat ...
-2
votes
1answer
413 views

ls: cannot access file : No such file or directory. [closed]

In the shell script, I will have to access the binary logs stored in /usr/local/mysql/data. but when I do this, STARTLOG=000002 ENDLOG=000222 file=`ls -d ...
2
votes
3answers
1k views

Upstart script vs. command-line: why this difference in behavior?

I'm trying to set up Tomcat to start with upstart. I find the following works: description "Tomcat Server" start on runlevel [2345] stop on runlevel [!2345] respawn respawn limit 10 5 ...
-2
votes
1answer
282 views

sh dev/null Permission denied apache

I am using Mac osx Mountain Lion for development. I am trying to execute a shell command in php using the 'exec' function. At the end of my command I am putting the output to > /dev/null 2>dev/null ...
-1
votes
1answer
43 views

Different behavior from ubuntu server and ubuntu client on windows [closed]

#!/bin/bash # Reading cat /home/radiare/Desktop/first.txt | while read LINE do if [ "$LINE" == "false" ]; then echo "Inside first loop" break fi done cat /home/radiare/Desktop/second.txt | while ...
0
votes
2answers
151 views

Debian shell script to update server software

A lot of my server software is installed via apt-get and I was wondering if there is a small shell script I can get which will will update all of this software. Also do I need to restart my server ...
2
votes
2answers
213 views

Appending data to file with a single open/close from a shell script

I need to adjust my shell script and write to $log multiple times. Opening and closing the file repeatedly will cause an increase in runtime. How can I write everything at once to the file, ...
1
vote
1answer
479 views

Group permission inheritance and umask

Edit: in my case virtual_use_local_privs=TRUE did the trick. i'm trying to force newly created files and directories inside foo/ directory to be owned by nginx user and to set the right permissions ...
-1
votes
2answers
353 views

“su” does not work on FreeBSD

Below I sun "su" command on FreeBSD: FreeBSD rand.vstyle.local 9.0-RELEASE FreeBSD 9.0-RELEASE #0 amd64 This is server RAND :) [svn@rand ~]$ su logostudiotest1 /bin/ls Password: /bin/ls: /bin/ls: ...
0
votes
6answers
3k views

Bash script runs manually, but fails on crontab

I'm a newbie to shell scripting. I have written a shell script to do incremental backup of MySQL database.The script is in executable format and runs successfully when executed manually but fails when ...
0
votes
2answers
176 views

Get memory usage in CentOS formatted

What is the best way in CentOS via a shell command to get the memory usage/free memory formatted like: Memory used: 389MB of 1024MB I know about free -m but parsing it, provides a challenge.
1
vote
4answers
75 views

Howto: command/tool ability check

When developing a shell script that should run on various unix/linux derivates, i sometimes have the problem that some tools have to be called in a different way compared to other systems. For example ...
0
votes
1answer
84 views

ZSH escaping / file matching pattern

This works from command line: scp -r ^.git b:/home/wopi/blyzics/. when I paste the above line in a script like this: #!/usr/bin/env zsh scp -r ^.git b:/home/wopi/blyzics/. And run it ...
1
vote
1answer
377 views

Counting the number of flows in a tcpdump file

I have a large tcpdump file which I need to parse to identify the number of flows in the capture based on the ( source ip + source port , destination ip + destination port ) pairs. Does tcpdump / any ...
0
votes
1answer
339 views

replace dates in XML file on a Linux server

I'd like to change the date format in the contents of an XML file from 2013-01-21 to January 21 The following script works on my mac, but not on a linux server (I'll be running it as a daily cron ...
0
votes
1answer
260 views

Error when sending an email from the shell using sendEmail

I'm using sendEmail to send emails using google account .. it is working fine on number of identical servers but on one if the servers it gives me the following error smtp.gmail.com:587 failed: ...
2
votes
1answer
474 views

Can't set TERM permanently in fish shell

I use the fish shell. I'm trying to run vim inside tmux with the solarized theme, but the colors are broken unless I run: set -lx TERM screen-256color-bce; before running tmux attach. It's ...
-3
votes
2answers
342 views

Simplest way to jail users for git [closed]

I'd like to create a couple user accounts on my server such that the users can check out a specific git repository. Ideally, the user would not be able to gain access to a shell or copy any files ...
0
votes
2answers
583 views

Cannot change chmod from bash script

I made a script to copy an image to a temporary directory, convert it to an another format, then move it to a final directory. But i can't get the chmod command to work, the file is copied to the ...
1
vote
2answers
186 views

Making a user account dedicated to a single script in centos

I am trying to make a SSH login for someone on my box. But when they login I want it to auto load a perl script and for them ONLY to be aloud to see / use that perl script. I only know how to use ...
1
vote
1answer
112 views

What shell script is calling rsync? [closed]

For the last couple of days, I've woken up to find rsync churning away with 1.6GB of memory, slowing my Mac down significantly. Activity Monitor only says that rsync is coming from sh, but I'm trying ...
0
votes
4answers
404 views

Daemon process exiting when shell closes

I have a script which starts a daemon process and then sleeps for 20 seconds. If I run the script on SLES11 SP1 or RHEL6 then after the script exits the process is still running. If I run the script ...
2
votes
3answers
1k views

Reboot if tomcat7 service is not responding

I am running a web app on a Tomcat server. There is a hard-to-detect problem within the server code that causes it to crash once or twice everyday. I will dig in to correct it when I have time. But ...
2
votes
1answer
152 views

How can I calculate the total size of an extremely large number of files with a particular extension?

I've got a directory in Linux that contains a large number of files (tens of thousands), plus directories that may contain thousands of files as well. At some point the following du command fails ...
2
votes
1answer
2k views

Force “net user” command to set password longer than 14 characters

I'm issuing some "net user" commands to setup a local user on my desktop for some testing purposes and require setting a password longer than 14 characters. In doing so Windows barks back a propmt to ...
0
votes
2answers
535 views

How to add a variable into a grep command

I'm running the following grep command var=`grep -n "keyword" /var/www/test/testfile.txt` This work just as expected but I need to insert the file name dynamically from a loop like so: var=`grep ...
1
vote
4answers
635 views

run php script in the background

is there a way to launch a php script and let it run on the server until it finishes? I use this php5-cgi /var/www/script.php -q & connecting via putty. When I close it (the session) the ...
0
votes
1answer
452 views

Error while trying to unrar

unrar: error while loading shared libraries: libgcc_s.so.1: cannot open shared object file: No such file or directory Both rar & unrar are in the /bin folder I followed this tutorial: ...
0
votes
2answers
194 views

Tool to execute shell script

I have a requirement to execute multiple shell scripts on the Linux severs regularly. Is there any tool in windows that connect to a Linux server and execute the given script with given user and shows ...
2
votes
2answers
1k views

How can I kill and wait for background processes to finish in a shell script when I Ctrl+C it?

I'm trying to set up a shell script so that it runs background processes, and when I ctrl+C the shell script, it kills the children, then exits. The best that I've managed to come up with is this. It ...
1
vote
1answer
890 views

List files with last access date in linux

I'd like to clean up a server that my webmaster let turn into a mess. I know how to list all files not accessed within the last x days using find and -atime, but what I'm looking for is to come up ...
2
votes
4answers
588 views

Recursively delete directory except for some files in Windows

In Windows, I need to recursively delete a directory except for a short list of files to be kept. The files may be nested in subdirectories. I tried making the files read-only before running "rmdir ...
2
votes
4answers
698 views

SSH connection closes as shell fails to load

I have FreeBSd running with OpenSSH. I set up everything and the connection via SSH worked perfectly. Then I decided to get rid of some not used ports and I obviously uninstalled one that was used by ...
0
votes
1answer
1k views

reading stdin in shell

#!/bin/sh #myVar=`date`#case 1 #myVar=`cat /dev/stdin`#case 2 myVar=($(< /dev/stdin)) #case 3 echo $myVar exit 2 case 1 works case 2 and 3 don't work. When I test with either 2 or 3; there is no ...
1
vote
1answer
1k views

changing network speed to 1000Mb/s

I am trying to change the server uplink from 100Mb/s to 1000Mb/s ethtool eth0 output # ethtool eth0 Settings for eth0: Supported ports: [ TP MII ] Supported link modes: ...
0
votes
1answer
109 views

Parenthesis in cronjob results in error

I am trying to run the following cronjob and I am getting the following error: /bin/sh: -c: line 0: syntax error near unexpected token `)' for the line: mysqldump --opt -Q -h localhost ...
0
votes
1answer
57 views

date and other commands no longer working in sh script

I have a shell script that used to run find on Ubuntu 10.04 but since I have moved to 12.04 it doesn't work as before throwing the following messages: /home/checks.sh: 1: /home/checks.sh: date : not ...
4
votes
3answers
217 views

How to execute a command on multiple hosts using IPv6 only?

First of all there is pdsh which is essentially a parallel distributed shell which may execute commands on a list of given hosts. However, I find myself in an IPv6 only problem setting. It seems that ...
0
votes
4answers
189 views

Sudoers file permissions

I'm trying to run the following command without the need for sudo: echo 1 | sudo tee -a /sys/block/$hd/device/delete The $hd variable changes dynamically from sdb -> sdi for each one of my HDD's in ...
4
votes
2answers
1k views

Disabling the shell of user “daemon” (/bin/false)

on a Linux system there are lot's of users by default: daemon, bin, sys, games, etc. According to my /etc/passwd most of these users have a shell assigned (/bin/sh) which seems some kind of insecure ...