General :: Way To Execute Top Command Once And Exit ?
Jan 6, 2010Is 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 RepliesIs 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 RepliesIs there a way to execute some command and then after the command completes utomatically reboot the system and then after the system reboots execute another command ? For example look at the sequence shown below(1) Execute command-1(2) After the command-1 in (1) is completed,reboot the system (3) Execute command-2(4) After execution of command-2 reboot the sytemIs there a way i can automate this process so that i need not reboot the system manually
View 5 Replies View Relatedis 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.
I have a script which builds a project and then runs junit tests. However, if the build fails, the junit tests fail with the same error message.Therefore the command which runs the junit tests should only be executed if the build was successful.
View 3 Replies View Relatedevery 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 RelatedMy 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.
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 RelatedI want a quick and simple way to execute a command whenever a file changes. I want something very simple, something I will leave running on a terminal and close it whenever I'm finished working with that file. Currently, I'm using this: while read; do ./myfile.py ; done And then I need to go to that terminal and press Enter, whenever I save that file on my editor. What I want is something like this: while sleep_until_file_has_changed myfile.py ; do ./myfile.py ; done
Or any other solution as easy as that. BTW: I'm using Vim, and I know I can add an autocommand to run something on BufWrite, but this is not the kind of solution I want now. Update: I want something simple, discardable if possible. What's more, I want something to run in a terminal because I want to see the program output (I want to see error messages).
How do I set up SSH so I don't have to type my password? i execute the following command ssh -l admin hostname command but each time i execute it, it ask me to enter password.how i can give it password as default because i'm going to put in bash file ?
View 2 Replies View RelatedI am working in a CentOS environment with numerous CentOS machines. Currently there are multiple developers that each have their own login/home directory and then for various admin tasks we all share a single super user account.
The problem
I have a number of aliases, variables, functions, and settings that exist in my personal login's .bash_profile. None of these are available in the shared super user's .bash_profile. My current work around is that everytime I sudo in as the super user and I re-execute my .bash_profile from my personal user's home directory. I am not allowed to edit the init stuff for the super user
The Question
Is there any way I can automate my sudo sequence such that it will execute my personal .bash_profile after I've executed sudo without requiring me to edit the super user's bash init stuff?
When i click in one icon (for example), this icon executes "java -jar ...". In another words: Make a .exe on linux.
View 2 Replies View RelatedTop: error while loading shared libraries: libproc.so.2.0.6: cannot open shared object. I am not able to execute top and ps command.
View 6 Replies View RelatedMy problem is:
sub init() {
$Test->description("Establishing the connection to the client");
eval {
$Host = host($CLIENT) or die($@);
$Conn = connect("#ssh") or die "Client connection Failed" . $@;
};
if ($@) {
$Log->error("Unable to instantiate the Objects for the Test" .
[Code]...
Here I'm trying to connect windows machine using connect object which is working fine. But when I tried to execute the command on Windows machine from Linux machine by using:
[Code]...
I am having trouble getting the while loop to execute in the ssh command:ssh $USERID@serverX "while read line do echo $line done<$list_dir/cost_feed.lst.old"Error:bash: -c: line 1: syntax error: unexpected end of fileI have managed to use simpler commands with ssh like:ssh $USERID@serverX "pwd; cp x y"I expect that I need to add some combination of escape characters or semicolons
View 3 Replies View RelatedMy laptop has a dead battery. Even when it's fully charged, if the power cable is pulled out it only lasts for about 4 minutes before it dies. I'm running Ubuntu Lucid Lynx 32-Bit. What I want to do is create some sort of script or program that will immediately set my computer to go into hibernation once it detects that the power cable has gone dead. I'm willing to look into all ways of doing this. I can program in C, but I'm not familiar with the API used to manage Power Management in Linux.
[Code]...
On my ubuntu I have a command pm-suspend, which puts the computer to sleep. It has to be run with sudo. Since it is inconvenient to be forced to type the password every time I want my computer to sleep, I thought maybe there's a way around it. Naively I thought that if I'd create a script as root, that invokes pm-suspend, and then let anyone execute that script, I could run that script as my own user and then that script would be considered run by root and hence be allowed to run pm-suspend. Obviously that didn't work. The root-check procedure in pm-suspend still found out that the original executor was someone different from root.
Still I think something similar (although slightly more elaborate) should work.I'm thinking about the process that allows the user to mount hard drives for example. Normally root is required, but it is somehow bypassed by the gnome utility mounting.
How can I give execute permission to chmod command from run level 3.Because in GUI mode we have the execute option in the properties of file. E.g. I gave following command
chmod -x chomod
After that I want to give the execute permission (x) to chmod command again but how from command prompt?
within my bobje directory, I have many directories and some log files . I want to delete those log files without traversing the subdirectories. so i performed these commands and getting the mentioned errors.
[Code]....
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 RelatedI am working at a client who has a project where code is a mixture of different source control systems. So a layout might be like this
project/a/.svn
/a/subfolder/.svn
/b/.hg
/c/subproject/.svn
/d/.hg
So I am trying to put together a simple command that when executed from the project folder will run the appropriate hg/svn command in each project i.e:
[Code]...
Since the client has many such projects, Instead I am looking for a solution similar to find -exec where the svn/hg commands are automatically executed on each first level of match (i.e. svn up is run in the project/a folder but not in project/a/subfolder). How can such a command be constructed ?.
I just want to know that how can I execute my scripts (example.sh) files like other normal commands from command-line. Please describe the full method
View 5 Replies View RelatedI am trying to setup a system to allow normal users to execute a command without using sudo. Is this possible?
View 6 Replies View RelatedCommand to compile n execute a Fortran program on a Linux machine
View 6 Replies View RelatedI need a script that executes a command based on a folder's last modified time.
if "/var/data" was modified in less than an hour then "/usr/local/etc/searchd stop" should be run
can we use "find -mmin +60 -type d" in conjunction with second command
Code: cmd='date | wc'
$cmd If this script is executed, an error is generated. The reason written was that "The execution fails because the pipe is not expanded and is passed to date as an argument".What is meant by expansion of pipe. When we execute date | wc on the command line, it goes fine.then | is not treated as an argument. Why?
I have a big bash script ,its goal is to download movie one by one . But I often get into a problem: if this script is executed in cron,it often does not completely download the movie.I often find the movies it downloaded are several KB while the movie is actually 20MB.So I think it is because it did not wait for finishing one task ,and jump to download another.So I want to know ,is there a way to force the bash script to wait until one movie downloaded completely and then start to download another movie ?
View 8 Replies View RelatedI 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 Relatedcommand 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 . . .
Code:
# 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 ?
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 Relatedim 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