The shell tag has no wiki summary.
0
votes
2answers
31 views
How to search directories in home directory?
I want to find all dot directory in home directory
find ~/ -name .* -Olevel 1
But it can not work
2
votes
2answers
22 views
Change shell on Cent OS 5 to rssh: “Shell not changed”
I installed rssh on CentOS 5 from RPMForge. Then I tried to change the shell to rssh to one existing user like this:
[root@ddinvps ofertoza]# chsh -s /usr/bin/rssh ofertoza
Changing shell for ...
1
vote
3answers
27 views
Script to open multiple gnome-terminals with individual telnet sessions
I'm just curious if this is possible. I'm working with dynagen/qemu rather frequently (CCIE training), and would love to be able to run script 'x' to open 10 windows for me, all telnet'd to ...
-1
votes
0answers
19 views
Can I execute complicated linux command inside perl? [closed]
Possible Duplicate:
how can execute complicated linux command inside perl
Sir,
#!/usr/bin/perl
@HOSTS = ("192.168.14.112", "192.168.14.90", "192.168.160.1", "192.168.160.100");
...
1
vote
0answers
43 views
Automate an interactive command which use /dev/tty
well pretty much it's in the title.
I've a interactive command. This one ask for a password through /dev/tty. I use this command within a shell script. So the command should read the information ...
1
vote
1answer
37 views
How do I detect the version of find on OSX
I need to detect which version of the find command is used from a shell script. GNU find supports the --version argument but the find command on OSX apparently does not support that. Is there a way to ...
4
votes
1answer
47 views
How to split a PEM file
Note : This is not really a question because I already found the answer but since I didn't find it easily here I will post it so that it can benefit others.
Question : How to read a concatenated PEM ...
0
votes
1answer
36 views
Whats the output format of “df -ki” in AIX?
I just wanna know the output format (the order of columns) when running the command df -ki in an AIX system. I dont have access to an AIX system , and since it doesnt run on x86 machines , i cant try ...
0
votes
0answers
50 views
CentOS 6.2 Hangs on Boot, /bin/sh: error while loading shared libraries
I have a Dell R310 server. Installed CentOS 6.2 (minimal) and it won't boot. It hangs at the following error.
/bin/sh: error while loading shared libraries: /bin/sh: supported version 25416 of ...
1
vote
1answer
11 views
How to automatically reconcile /etc/group and /etc/gshadow
Running grpck to check the groups, I see these errors:
'twinky' is a member of the 'foo' group in /etc/group but not in /etc/gshadow
'dipsy' is a member of the 'foo' group in /etc/group but not in ...
-1
votes
0answers
40 views
How to allow webserver run java from shell [closed]
The question is directly related to the one I've posted on stackoverflow. Problem is as follows. I want to run java -jar from a php script with exec function. Unfortunately, it looks like the _www ...
0
votes
1answer
34 views
How can I tell what is causing a delay in ssh connection startup? [closed]
Possible Duplicate:
ssh delay when connecting
This is a toss up between superuser and serverfault but I figure it's more a serverfaulty question.
I do development on a solaris box...
...
1
vote
1answer
50 views
Command: move all files inside a directory to another directory (including hidden files)?
I tried to move all files inside a directory to another directory like this:
$ mv /directory_one/* /directory
However, the hidden files (such as .htaccess) in /directory_one won't be moved.
What ...
-3
votes
0answers
37 views
How can I add a user to ubuntu and apache (from xampp) using a sh script?
I found this script here:
#!/bin/sh
user=$1 #first argument
apache="www-data"
passuser=$2 # second argument
newpasswd=$(perl -e 'print crypt($ARGV[0], "S@LtStR!Ng")' $passuser)
...
16
votes
3answers
542 views
What's the difference betwen the single dash and double dash flags on shell commands?
I'm new to working in the shell and the usage of these commands seems arbitrary. Is there a reason one flag has a single dash and another might have a double dash?
1
vote
4answers
28 views
Stripping “extra spaces” in du -sk for bash script?
I am trying to use du -sk to get the size of two folders
dirsize_temp=`du -sk /folder/path/here`
and then an if statement to compare the sizes. The only issue is that when you run the command, it ...
1
vote
2answers
74 views
BASH: Bind Program's Existance to Another Program
I want to create a script that runs two programs. That part's simple, but there's a catch: I want to kill the second one if the first one exits. How can I do that?
Edit
I tried killing the program ...
0
votes
3answers
58 views
In a shell script, perform different actions depending on the file on a another server (web accessible)
I've been having trouble with firewalls lately on a few different servers. And im wanting to create a script that will run once every hour or so, and check a file on an external server and execute the ...
1
vote
1answer
56 views
Encoding to base32 from the shell
I'm looking to encode an input string to base32 encoding directly from the shell. I'm looking to do this in ubuntu, but I imagine flavor doesn't particularly matter here.
Are there any existing ...
2
votes
2answers
69 views
tar Exiting with failure…?
i'm untaring with this command tar -pxvzf filename.tar.gz an everything seems to be going fine but, it unexpectedly exits with the error below. Is there a reason why I'm receive this error and / or ...
2
votes
2answers
73 views
Deleting folders with rsync “move”?
rsync can be coaxed into moving folders very similarly and superiorly to traditional mv with the following options:
rsync -axvvES --remove-source-files source_directory /destination/
However one ...
3
votes
2answers
53 views
How to Update Text in File within Unix Shell Script
I'm creating a shell script that needs to update the sudoers file. So basically I want to be able to append ":/usr/local/bin/" to the following text in /etc/sudoers:
secure_path = ...
1
vote
1answer
79 views
use sed in shell script to replace IP Address in a file
I have a script that finds a string in a file replaces it with a new string.
$ sed -i 's/$old_string'/'$new_string'/g' $FILENAME
Now I need the condition to be a regular expression that also check ...
2
votes
1answer
28 views
nl command + number each line in a text file only from the third line
I want to number each line in a text file on Linux/solaris by nl command
but only from the third line - is it possible ? and if yes please advice how ?
for example
line1
line2
1 line3
2 line4
0
votes
2answers
42 views
making one computers bash prompt match anothers
The computer who's prompt I'm trying to copy:
[root@CompanyName-LAMP-DEV:/current/path]$
We'll call that computer computer A.
The prompt my computer - computer B - currently has:
[root@ip-x-x-x-x ...
2
votes
3answers
236 views
redirect temporarily STDOUT to another file descriptor, but still to screen
I'm making a script that executes some commands inside, and these commands show some output on STDOUT (and STDERR as well, but that's no problem). I need that my script generates a .tar.gz file to ...
1
vote
1answer
46 views
Can I change the ownership of all the files of a specific user?
Is there a way to recursively find all files owned by a user and change them to another user/group in Gnu/Linux?
I assume there must be some magic one liner but my command line wizardry skills are ...
3
votes
1answer
203 views
How to interpret output from Linux 'top' command?
Following a discussion made HERE about how PHP-FPM consuming memory, I just found a problem in reading the memory in top command. Here is a screenshot of my top just after restarting PHP-FPM. ...
2
votes
4answers
114 views
bash : “set -e” and check if a user exists make script exit
I am writing a script to install a program with bash, I want to exit on error so I added "set -e" in the beginning of my script.
The problem is that I have to check if a user exists inside of my ...
2
votes
5answers
173 views
Run compiled c program from any location
Quick question. After compiling a program, I always have to explicitly tell it to run from the current directory by prepending ./ to the name. For example $ ./testprog -argument1
Is there a way to ...
0
votes
1answer
72 views
Home folder only SFTP connection has limited access
I have configured sftp access for user using this guide:
Linux shell to restrict sftp users to their home directories?
I have problem though.
I have taken all steps.
I have chown'ed root:user the ...
1
vote
2answers
44 views
Shell background processes: what do characters in termination message mean?
I had three background processes, and here's what I've got:
[1] Done zcat jan.txt.gz > j
[2]- Done zcat feb.txt.gz > f
[3]+ Done ...
2
votes
2answers
112 views
How to run a shell script in another user without typing password
I'd like to automate one job in hudson, but hudson always uses the user hudson to run the scripts. What I want is to run the script as another user.
I've looked through ServerFault answers, but ...
0
votes
0answers
161 views
Jenkins shell command isn't executing
In Jenkins project I add command for executiong
rm /var/www/ru.liveyurist.ru/tmp/*
But when I build project I get error:
Started by user anonymous
Building in workspace /var/www/ru.myproject.ru
...
1
vote
2answers
142 views
how to run multiple shell scripts in parallel
I've got a few test scripts, each of which runs a test php app.
Each script runs forever.
So, cat.sh, dog.sh, and foo.sh, each run a php script, and each shell script runs the php app in a loop, so ...
3
votes
3answers
79 views
Linux web console for multiple machine
I'm looking for a web-based tool allowing me to do the following:
Have a single web-based UI for multiple servers
Services monitoring: for each server I want to see all running daemons and be able ...
0
votes
1answer
151 views
Both bashrc and bash_profile won't seemingly source? VirtualMin Clean install
I am not too familiar with this level of management on a nix server however I am unable to get either the bashrc or bash_profile to source at login.
Details about the server:
Centos 6.0 - Basic GUI ...
0
votes
0answers
32 views
How write .sh script to remote copy files between linux [closed]
Possible Duplicate:
How to pass password to scp command used in bash script?
when use scp to remote copy file between servers then type "YES" and "PASSWORD"
I don't know how to auto type ...
0
votes
2answers
140 views
Migrating users and mailboxes from postfix / Maildir to Postfix with Mysql backend
So I've got 60 or so users on a hand rolled postfix installation on openbsd and I'd like to move their mailboxes to our new mail server running iRedMail (postfix, vmail/mysql back end)
Does anyone ...
1
vote
2answers
113 views
How to untar a single file from an archive with randomly generated directory names?
I'm trying write a script that will download a tarball from github and extract a single file from it.
However the top level directory inside the tarball has some random characters in it, which I ...
0
votes
3answers
48 views
Shared Hosting Shell limitation? [closed]
I have a small project for a client and there are some requirement that initially pointed me toward using a VPS.
However, after reading a bit more online, I saw I could work out with shared hosting ...
0
votes
1answer
44 views
Apache print syntax errors to console instead of logfile
Some of my apache configs are failing like this (because of a bug in control panel, but I need a workaround till this gonna be fixed):
/etc/init.d/httpd start
Starting httpd: Syntax error on line 30 ...
2
votes
3answers
95 views
How do I exclude directories when listing files?
How do I exclude directories when listing files in the current directory?
ls .
^ will include directories in the listing.
1
vote
2answers
42 views
delete files which are not inside another folder
I have two directories called thumb and thumb2. They contain the same file names but are different in size. Unfortunatelly there are some files in thumb2 that are not in thumb which need to be ...
2
votes
4answers
302 views
Linux / mysql: is it safe to copy mysql db files with cp command from one db to another?
Most guides recommend mysqldump and simple SQL for copying one table to anoter db. How about linux shell cp? Can I just simply do
cp /db1/mytable.frm /db2/mytable.frm
5
votes
4answers
184 views
Calculating total file size by extension in shell
We have a set of directories containing lucene indexes. Each index is a mix of different file types (differentiated by extension) eg:
0/index/_2z6.frq
0/index/_2z6.fnm
..
1/index/_1sq.frq
...
1
vote
2answers
61 views
Unix to run commands repeatedly on shell without using crontab
Say if I need to run a command checkstatus --jobnumber 12345 to check the job status. The command prints out the info to standard output. Is there any way to run this command on shell repeatedly every ...
1
vote
3answers
80 views
changing default shell to /bin/bash of at job scheduler like in CRON
Is there a way to change the initial shell used by the atd job scheduling service? Esp. in Ubuntu.
at by default uses /bin/sh in every Linux and Solaris I've deployed products on.
GNU's crontab ...
20
votes
5answers
1k views
Linux server out of space
I have been asked this question in two consecutive interviews, but after some research and checking with various systems administrators I haven't received a good answer. I am wondering if somebody can ...
4
votes
1answer
50 views
How to concatenate streams?
I know cat can concatenate files, but I need to concatenate a mix of files and streams and pipe the result to another process.
To make the question more concrete, I want to concatenate cat abc.sql ...