General :: Ssh Exec Command And Exit Session

Jan 13, 2011

is it possible to execute command and terminate session all in one phrase

something like this connect to server hostname and than execute command "ls" and than some command

ssh username"at"hostname ls "something"

without "something" this phrase connects to server and lists directory, I need something that after listing directory, terminates session.

View 1 Replies


General :: Exec Command With Grep Output?

Feb 15, 2011

I have a requirement to find the files having its name as ack_reply. However, there are many other files in the same directory as these resides. Now I have to remove these files from the folder and retain others after 7 days. So I tried to write the below script with grep command.

find $directory -type f -mtime +7 | grep ack_reply

how can I pass this output to -exec command.

If I am not using grep command my script would be as

find $directory -type f -mtime +7 -exec {}\;;

How can I use -exec with grep and find.

View 4 Replies View Related

General :: Use '{}' To Redirect Output Of A Command Run Through Find's -exec Option?

Jan 10, 2011

I am trying to automate an svnadmin dump command for a backup script, and I want to do something like this:

find /var/svn/* ( ! -name dir -prune ) -type d -exec svnadmin dump {} > {}.svn ;

This seems to work, in that it looks through each svn repository in /var/svn, and runs svnadmin dump on it.

However, the second {} in the exec command doesn't get substituted for the name of the directory being processed. It basically just results a single file named {}.svn.

I suspect that this is because the shell interprets > to end the find command, and it tries redirecting stdout from that command to the file named {}.svn.

View 2 Replies View Related

General :: Way To Execute Top Command Once And Exit ?

Jan 6, 2010

Is there a way to execute top command once and exit...i.e. stop refreshing window and continue console without pressing 'q' or 'ctrl+c'...

View 3 Replies View Related

Server :: Start Mongrel In Ssh Session And Then Exit In Ubuntu 10.04?

Oct 6, 2010

I'm deploying a Rails application in a Ubuntu 10.04 server withmongrel web server (a lightweight http web server). I connect to server and do stuffs in a ssh client(PuTTY on windows). And I'm getting stuck with a strange issue:1. After I connected to server, I start mongrel with : $ start-stop-daemon -S -d . -x script/server -b -- -p 80802. I left the ssh console and launch firefox from my Win7 box and openthe website, it runs well. I can see the homepage3. I go back to the ssh console. Close the terminal (and window too)it by : $ exit4. Then in firefox, I press F5 to refresh and nothing shows up. It'sjust an empty space in whole webpage. I tried to use addon to capturethe HTTP data and see that te server returns nothing , even HTTPheaders5. I connect to server again, run "ps -Af" to check and see that the process's still running. And again, leave the console, switch to firefox and refresh -> the homepage shows everything. 6. But if I exit the ssh session and refresh browser, the web server returns nothing againI thought that using start-stop-daemon command could help me runmongrel as daemon and then I can exit my session just as apache does.

View 2 Replies View Related

General :: X Window KDE Logout / Exit From KDE And Go To Command Line?

Mar 28, 2010

every time I logout from Xwindow KDE, it doesn't redirect me to Linux command line, instead it was halted without the machine being shut down. How can I exit from KDE and go to Linux command line?

View 10 Replies View Related

General :: Debugger For Shell Script - Get Rid Of Multiple Exit Command ?

Jun 14, 2010

My two doubts:

(i) In office i open many terminal windows when i start my day and in each terminal i keep on login as different users many times in a day to do some task, by the end of the day when i need to exit from all terminals in a safeway instead of directly closing it i need to execute exit command or CTRL+D many times to close a single terminal safely. Can anybody tell me a way to exit from each terminal in single go, is there any command to acheive this ? I wish if we had a command like exitall like in vi we have :qa command to close multiple files opened in single window. I hope friends you have got what i am asking for ?

(ii) I want a software for debugging shellscripts searched a lot but dint got it.

View 7 Replies View Related

General :: Shell Command Equivalent To (Ctrl+C) To Exit From A Process?

Apr 1, 2011

I write a script to read a file which is something like a pipe (or) queue , which shows the running status.In normal case, if i open this file with cat command, i have to use ctrl+c to exit this . What command shall i use to do the same inside a shell script ? I have tried ^C in my script , but it does not exit the process.

View 6 Replies View Related

Programming :: Exec And Ssh : Command In Scripting?

Aug 4, 2010

I am a newbie, I am writing a script file to execute some programs.

# ! bin/ bash


echo "*************************************"
echo "*************************************"
#exec ssh automatix

problem 1 : I can ssh to the required space but after the terminal prompts me for password it stops ececuting the script.

problem 2: after performing the 'exec' command for the first time. its not executing anything after that line. is there any work around for this.

View 1 Replies View Related

General :: Run A Second Command In Same Screen Session?

May 5, 2011

I'm starting the first command in screen like this: screen -d -m -S testen -t lalala watch df -h Now I have a screen session running in background and I can reconnect at a later time. But how can I run a second command (in a new window) in the same screen session?

View 1 Replies View Related

General :: Execute A Command On X-session Owned By Another User?

Jul 13, 2011

Is possible (by root of course) to run a command from console, that will be executed on X-session owned by another user on the same linux box/machine ? Example: Can root open xclock for another local user logged into X11 ?

View 2 Replies View Related

General :: Command Line To Open A Second Telnet Session ?

Mar 15, 2010

On my ubuntu 9.10 pc i am not running a GUI.

Every thing is run from command line.

How do i start a second telnet session from command line.

Plus can i have 4 telnet session open and move from one to the next and back again.

View 5 Replies View Related

Programming :: Filer Doesn't Take Exit Command

Jul 6, 2009

I am trying to write a python script which logs into a NetApp filer and fetches some data. I am using the telnetlib library. Filer does not take exit command. So it expects Control-D. How to send that via python script?

View 5 Replies View Related

Programming :: Keep The Bash-script Running If "exec Command" Fails

Aug 13, 2010

Is there a way to use exec, but if exec fails to go on with the script?


#!/usr/bin/env bash
exec startx
echo "Starting of X failed"

If startx fails, the echo will be seen on the screen. I tried all kind of stuff, but guess it ain't of much use to post it here. I searched the web, but searching for "exec and bash" in one sentence does give results which are not what i am looking for.

View 6 Replies View Related

Fedora :: Echo Exit Status After Command Is Run In Terminal?

Feb 19, 2010

command will just execute and exit with a status of "0" -"Every command returns an exit status (sometimes referred to as a return status ). A successful command returns a 0, while an unsuccessful one returns a non-zero value that usually may be interpreted as an error code. Well-behaved UNIX commands, programs, and utilities return a 0 exit code upon successful completion, though there are some exceptions."[URL]With the command . . .


# dosfsck -v /dev/sdb

it could be very helpful (and decide my next move) to see the exit code as 0, 1, or 2 . the man page suggests the command exit code will specify if the message I get - "Cluster size is zero" (I think it is a "1")is a recoverable or fixable error by the utility. or is non-recoverable - a pretty nifty feature if I understand this right. [URL] is there anything like this script COMMAND_LAST used in the following link. [URL] that can be entered in the terminal window after - or at end of - my dosfsck command or any command. just to see if it has a 0, 1, or 2 status ?

View 2 Replies View Related

Ubuntu :: Takes Back To The First Script When Use The Exit Command

Oct 3, 2010

I was writing a bash script which attached to another script. The issue I'm having is, when I use the exit command written in the script, it takes me back to the first script. How do I disable this?

View 1 Replies View Related

Fedora :: How To Exit Out Of Session In Fedora 11?

Aug 2, 2009

I'm just wondering how to exit out of an a session in Fedora 11. I used to be able to use ctrl+alt+F1,2,3..etc to go to command line. Please don't tell me you no longer allow users to exit out of x-sessions. Also what about verbose mode during boot up. I used to be able to boot interactivly to diagnose problems.

View 12 Replies View Related

CentOS 5 :: Can't Seem To Save Changes / Exit Screen To Get Back To Command Prompt

Dec 14, 2009

im following a tutorial to setup a dns server, after editing vi etc/sysconfig/syslog, i cant seem to save me changes or exit the screen to get back to a command prompt. have tried to google the answer to no avail, any ideas? also im using putty to ssh, is the answer the same as using the terminal directly?

View 2 Replies View Related

Programming :: Exit In Script Files Cause Konsole Terminal Itself To Exit?

Apr 11, 2010

I noticed that if I have "exit" in a bash script file., e.g.,that when the word "exit" is reached, and the script file being executed is not in the PATH nvironment, i.e. ".", the whole konsole shell profile is exited! What gives here? Is there another command compatible to "exit" to prevent this, or will I just have the leave the "." part in the PATH enviroment, which is, to my understanding, is not recommended? I desire for a "goto" function in bash script files

View 11 Replies View Related

Programming :: Why New Threads Exit When Main Thread Exit

May 22, 2010

In linux, creating thread is same as process (clone()), except the virtual address space gets shared with the parent.If a running main process(thread) creates new thread, and if main thread exits, why should the new thread too exit? both are different entities, The same doesn't happen if the child thread exits, the parent thread would be alive.

View 1 Replies View Related

General :: Using PHP Exec With Java

Feb 17, 2011

izzit possible to use a php exec function to trigger a jar file using -java method?ters/new.png"');However when I run the index.php, it doesn't trigger action.Instead when I run this code in the terminal, it works perfectly well.So is there any configuration needed to perform such action?Oh btw I'm using XAMPP in linux ubuntu and CBSim.jar to convert some images.

View 2 Replies View Related

Ubuntu :: General, How To Exec On Ls Results?

Feb 10, 2010

Find a file and need to do something to it, think there must be a single line solution for:

$ ls *.c
$ cat *.c

View 1 Replies View Related

General :: Unmount The Partition With Exec Permissions?

Aug 9, 2010

My hosting company said: You need to unmount the partition with exec permissions, install memcached and re-mount it with no-exec as a security measure.


[root@server tmp]# pecl install memcache
WARNING: channel "" has updated its protocols, use "pecl
channel-update" to update


View 4 Replies View Related

General :: /usr/bin/xterm: Could Not Exec /bin/bash: Permission Denied

Sep 24, 2010

I'm in trouble when I log in the fedora as a normal user(not root) today. When I fill the username and the password press enter key. Then pop up a little window locate at top left corner. And have one line message : "/usr/bin/xterm : Could not exec /bin/bash : Permission Denied" Then I log in as root, it's ok. And when I open shell and type "su username" then the console print "su: /bin/bash: Permission denied" I have checked the perms of "/bin/bash" , it's 755. And I have tried all things which suggested from articles searched through Google. like change / or /root and other directory's permissions but failed.


[root@localhost lib]# ldd /bin/bash => (0x00687000) => /lib/ (0x05846000)


View 2 Replies View Related

Debian :: Ssh Session Freeze After Any Command?

May 26, 2010

I have debian squeeze server at work, acting as gateway, and home computer with debian sid (amd64). OpenVPN is working on server ecure connections from internet. So my home computer is connected to work server via openvpn almost 24/7. Some days ago i faced strange problem - when i make ssh session from home to work, via openvpn connection, i can login to work server, but after any command on remote console i have blank screen and nothing happening on it. Only exit is pressing Enter ~ . In server's auth log are messages about session opening and closing only.When i ssh to server from local network at workplace - via putty or native ssh - it works without any problems. I can do anything.But from home I can only login.

View 1 Replies View Related

OpenSUSE Install :: What Is Command To Start Gui Session

May 6, 2010

I am having a brain fade, I have an putty session connected ( X11 forwarding enabled) what is the command to start a gui session ( Opensuse 11.0).

View 3 Replies View Related

Software :: Record A Command Line Session To A File?

May 19, 2011

I recently borked my video driver with a series of upgrades and found my system booting to the TTY with no access to the desktop, graphical login, or even X. I spent some days troubleshooting the problem and experimenting with possible fixes. I found myself wishing for some way to copy and paste from the TTY, or at least log all input and output to a file.


# bash 2>&1 | tee /tty-session.log

View 5 Replies View Related

Ubuntu :: X Session:warning :x Rdb Command Not Found :x Resources Not Merged

Mar 1, 2010

I have installed ubuntu Server 9.10 [ubuntu-9.10-server-i386]in ma machine. After giving the command startx i couldnt goto gui . It saying x session : warning: x rdb command not found resource not merged.

View 1 Replies View Related

Ubuntu :: Change Desktop Environment/Session From Command Line?

May 12, 2010

I had chosen automatic logon. Then updated to 10.04. During logout to change Desktop Environment/Session, I noticed that GDM login screen had an option for KDE session although I had not installed KDE. I got curious. So I tried it. System hangs. Restart does not help because somehow gdm proceeds to the KDE session although I did not choose it to be default session. So I had only CLI left.

I got over it by stopping gdm (/etc/init.d/gdm stop) and removing gdm and installing xdm. Anyway, what is the proper way? How to order desktop environment from CLI and/or where is the default desktop environment option written in a file?

View 2 Replies View Related

Ubuntu :: Command For Indicator Applet Session LogOut Dialog?

Jun 9, 2010

Ubuntu have two logout dialogs. One is well known LogOut dialog with Switch User option and second is standalone LogOut dialog from Indicator Applet Session.Did somebody know the command for Indicator Applet Session LogOut dialog?

View 1 Replies View Related

Copyrights 2005-15, All rights reserved