Red Hat / Fedora :: Running Mulitple Command Through Ssh Not Working?
Aug 19, 2010
I am trying to execute 3 commands stacked together on a remote server. The purpose of the commands are to get the oldest path name, then the filename of the oldest file in that path, and then the date/time of that file.
The command I am running is: stat -c %y $( find -L $( find -L /home/data -depth -maxdepth 6 -mindepth 6 -type d | sort -f | head -1 ) | grep txt | sort -f | head -1 ) This command works fine if I execute it on the command line of the server. However, when I try to use it in a bash script and execute it from one server on the other server using ssh, the command does not work.
I don't know why the command will execute if I run it straight on the server but not through ssh. I broke it down to just the 2 Find commands and saw with verbose turned on that the path from the first (innermost) Find is not being passed to the second Find so it is not returning a filename which inevitably makes the Stat command fail.
Also, if there is an easier way to do what I am trying to accomplish without stacking these 3 commands like this, then I welcome those suggestions as well since I am a Linux newbie.
I want to capture all packets from site "www.examplesite.com" so I checked its ip address in an ip address look up and it was 123.456.abc.def.So I set my filter to "dst host 23.456.abc.def"However I then realised that multiple ip address point to ww.examplesite.com, for example say the following ips also go to987.654.321.000111.222.333.444So is there a filter that will automatically capture all traffic going to www.examplesite.com or do I have to go and manually find all it's ip addresses and pass them all to the filter?
I'm trying to get synergy+ to work on Fedora 12 on start up. I'd like to be able to log into Fedora using my keyboard and mouse through synergy+. I've tried adding the line Code:synergyc <localipaddress> at the end of the /etc/rc.local file but I still can't use my keyboard and mouse to log in. I've also tried adding the lineCode:su <username> -c "synergyc <localipaddress>" to /etc/rc.local but it still doesn't work. Just to clarify, I do have synergy+ working on Fedora but I need to start it after logging in on each reboot by switching my keyboard over to the other computer.
I'm trying to start an Oracle Integration server as user "oracle" at system startup and my approach was to place a couple of lines in /etc/rc.localsu oracle/home/oracle/startallSomething is not quite right about this as it seems to leave some processes owned by root.
In Fedora 13 64 bit, Ctrl+C does not terminate the running programing in terminal window but in Unbuntu this shortcut key works. If I hit Ctrl+Z, this makes the running program run in background which is something I definitely dont want. what is the shortcut for terminating a program in terminal window? What is the shortcut key for canceling the command I have typed but not run yet no matter where the cursor is in the command ? Ctrl+U works but only if cursor is at the last character of the command.
I am quite new to Linux and fedora. I am trying to run some molecular simulation software whose shell scripts create X windows with the xterm command. How do I get xterm on Fedora 14?
(xcdroast:22631): WARNING **: Failed to access cdrecord. Please check the permissions and ownership of /usr/bin/cdrecordcdrecord is a link to wodim, i'm running as root all the permission are +xrw and still does'nt working
It's an acer Aspire One D257-13478.Download the correct firmware and tar it into the appropriate dirctories and I'm still running a wall.I don't know how to get the b43/b43legacy in the lsmod list.I've also tried use the rfkill command and using yum to install it gives me this response:"cannot retrieve repository metadata" I also went into the F2 setup menu and couldn't find anything to alter the bios wireless.After installing Fedora 15 almost all the drivers remained intact including enumerators for usb mice.I don't know what's going on.
I finally got magicjack working under a winxp running on a vbox. But somehow I have to login as root and run the vbox as root. otherwise if I run the vbox as a normal user, I cannot mount the magicjack usb device, it appears as a grey disabled box. I am sure this is some kind of permission issue, but not sure how to grant the permission.
I get the following error in the logs when i run 'at now -f task' as root. atd[4737]: Failure setting user credentialsI am trying to auto shutdown the PC but, it fails.I am also pasting the /etc/pam.d/atd config file which
# The PAM configuration file for the at daemon # #
I am trying to email some log files from my RHEL 5.3 server to my Outlook corporate account and nothing happens. Here is the command I use:[root@server1]# mailx -s "server info" my_id@my_corporate_domain < server_infoThe file server_info does exist and is a small log file. I checked for sendmail and seems to be running OK as follows:
I'm not at all familiar with mail clients or mail system in Linux. Is there anything missing? I don't have to use mailx, I could use an alternative. Just please let me know how to sent a simple mail from this server to my corporate account using any tools possible (and maybe how to set it up)
I tried using the jobs command in bash in F14 but nothing happens.
Code: [root@Fedora ~]# jobs -l [root@Fedora ~]# Code: [root@Fedora ~]# which jobs
[Code].....
If jobspec is given, output is restricted to information about that job. The return status is 0 unless an invalid option is encountered or an invalid jobspec is supplied.
If the -x option is supplied, jobs replaces any jobspec found in command or args with the corresponding process group ID, and executes command passing it args, returning its exit status.
Is the jobs command dropped for the ps command instead ?
I want to print Landscape and I would normally use Code: lp -ddestination -olandscape However this isn't working, it could be another problem (I am passing to a windows print spooler) but I would like to know if I have got the command right.
Defining tcsh aliases through a .aliases file has worked perfectly for me for years and years using cygwin and older versions of mandriva. I am encountering very annoying and mysterious problems when attempting to do the same thing with a .aliases file in a fedora 64-bit VM. Strangely, if I define aliases in the file, they won't work, but if I do so on the command line, then they will.
Here's a simple example: Suppose I define an alias for "ls" in the file: alias ls '/bin/ls' Then source the file. This happens: me: ls : Command not found. me: alias ls /bin/ls me: /bin/ls file1 file2 file3 etc. me: unalias ls me: ls file1 file2 file3 etc. me: alias ls '/bin/ls' me: ls file1 file2 file3 etc.
A second example: if I place either of these lines in my .aliases file: alias d '/bin/ls -alF !:1' alias d '/bin/ls -alF !*'and source the alias file, this happens:/ me: d Bad ! arg selector. However, if I define the alias on the command line: / me: alias d '/bin/ls -alF !*'then the alias behaves correctly:/ me: dtotal 376 drwxr-xr-x. 10 r r 4096 Apr 14 16:05 ./ drwxrwxr-x. 6 r r 4096 Feb 21 16:15 ../ drwxr-xr-x. 3 r r 4096 Apr 14 16:05 bin.v2/ -rwxr-xr-x. 1 r r 193872 Apr 14 15:35 bjam* -rw-r--r--. 1 r r 52804 Apr 14 17:20 bjam.my.log drwxr-xr-x. 77 r r 4096 Nov 17 09:49 boost/ -rw-r--r--. 1 r r 989 Nov 17 04:51 boost.css
I'm runing FC11 and have compiled the vanilla kernel 2.6.33.4 to support Dazuko. It has broken my NFSD server in the process, and I can't figure out why. I get these errors on boot. FATAL: Module nfsd not found. FATAL: Error running install command for nfsd
I installed Fedora 12 64 bit on my HP dx2255 Desktop. The audio was working fine until I ran "Sound Preferences" application to test Microphone, the audio stopped working and the "Output" tab in "Sound Preferences" application showed "Dummy Output". After restarting the Computer audio started working. All of a sudden it stopped working when I tried to run "Sound Preferences" application to test the Microphone. This happens the same way all the time. I am able to get my audio back without restarting the Computer by running the command "pulseaudio --kill", but still the issue persists. I mean when I try to run "Sound Preferences" application to test Microphone, audio stops working and I have to run the "pulseaudio --kill" command or restart my Computer to get the audio back.
When originally installing 11.04 I had problems getting my Ralink 5390 wireless card to work.
Today my computer froze completely and I had to turn it off via the power switch. When I turned it back on, wireless was no longer recognized! My iPod can connect to the network just fine, so it must be an Ubuntu problem. There are no problems with my ethernet connection either.
I researched this and found several threads about blocking and unblocking wireless devices using the rfkill command. Well, unfortunately for me the rfkill command doesn't work. When I type sudo rfkill list or sudo rfkill unblock all, nothing happens; it just returns me to my bash prompt. I even tried uninstalling and reinstalling rfkill...nothing.
Using netbook asus 1005ha with lucid beta 1 with most of updates on learning to use the CLI and headaches cd command does not seem to reconise directories here is a sample
Code:
yeh i know read the f#####g manual i am but any help would be greatly accepted tried sudo with same commands same problem did have a problem on my debian system that was to do with paths this is not the same on a different footnote anyone thinking of upgrading to lucid sit tight on 9.10 there are still to many issues that need ironing out for a system that is your main system.
i have a shell script which some of the lines should be running as root and some other not.the problem is that su is not practically work,it means it take root password from me but it does not run the commands in script.the other problem is thatthere are some commands which should be run as normal user so how it exits from root mode and run that particular command. i tried exit in script file but it dos not work.
Let's say 4 users have logged in on 4 different Virtual Consoles:tty1 .... tty4On tty4 is logged in User4.How can I log out the User4 from my console using the root login?I just checked out the man page of shutdown but didn't find any hint there. The logout command is also not doing the work. We cannot specify a username wit it to log him/her out.
I am trying to use the at command to run a script file. The test was quite simple, wanted to run today and every 2 days.Here is the at command:at 15:20 today + 2 days -f every2daysDo.shHere is the script:echo "every2daysDo.sh ran on $(date)" >> /home/stacy/attest.logI see the 'output' of the echo command in my log file on today+2 days, but not on the day that I start it.
I'm running this command, and seems not to work, following the command:Quote:for nic in `ls /sys/class/net | grep -v lo`; do echo ${nic}; udevinfo -a -p /class/net/{nic} | grep -i address; doneThe output is the following:Quote:eth0eth1But the output should show something like this: (showing the MAC address)uote:
I am trying to run an scp command on my linux server, this is working fine, however I changed the output folder to one which has spaces and now when run, it's coming up saying SCP ambiguous target
I have two load balancing boxes... One primary (box1) and one backup/failover (box2). I want to make sure the heartbeat is running on both boxes via a script. While I'm on box1, I want to run as any user: ssh box2 service pulse status and not have box2 ask for a password.
I am doing a audit on some Linux servers about 40. One off the recuirments is a list of Applications currently running on each server. Does anyone have a command that I can use to show the required info?
I want to run a command on startup (Via startup applications) that has to wait for another program to run first.I don't seem to be able to use sleep to delay the command as it is stored in a .desktop file.How do I make it run later, preferably without having to create a script just for this one command.Also, how do I make the system start with compiz? Change "/desktop/gnome/session/required_components/windowmanager" ? Or do it the clean way by (Somehow) configuring gnome to use compiz?