General :: Running SCP Command With Spaces?

Jan 21, 2010

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

Here's my string:
expect -c 'spawn scp -r /var/lib/asterisk/backups/Everyday/ administrator@192.1.1.1:
/Volumes/Data1/My Backup Folder/ ; expect assword ; send "MYPASSWORD " ; interact;'

View 4 Replies


ADVERTISEMENT

General :: Bash Command To Remove Spaces

Sep 14, 2010

I am reading the output of /proc/acpi/thermal_zone/ATF0/temperature in a program to read my CPU temp. I am using cat like the following:

Code:
#cat /proc/acpi/thermal_zone/ATF0/temperature
temperature: 49 C

I basically want to get rid of the spaces in between temperature and the actual temperature. Is there a command I can pipe the cat output to, to remove the spaces. I have seen suggestions for sed, or tr, but for some reason I cannot get them to work properly.

View 14 Replies View Related

General :: Spaces In Command Line Switches

Oct 6, 2010

I am trying to encode files via mencoder. The file name has spaces in it. "test file.mkv". When I manually type the command in the terminal, everything works. But when I use a bash script (I'm reading it from a file) it doesn't. It gives me

Code:
File not found: '"test'
Below is the bash script I wrote

Code:
#!/bin/bash
# For testing, we have already built a file list, so just use that.
# ls *.mkv>files.lst
exec 10<files.lst
let count=0
while read -u 10 FILE; do
LINE="mencoder -of lavf -lavfopts format=mp4 -vf scale=1024:-3 -ovc x264 -x264encopts crf=28:vbv_maxrate=1500:nocabac:global_header:bframes=0 -oac faac -faacopts br=160:mpeg=4:object=2:raw -channels 2 -srate 48000 "$FILE" -o test.mp4"
echo $LINE
exec $LINE
done

exec 10>&-
files.lst contains only a single line (no newline) with
Code:
test file.mkv

On a related note, when I was first trying this simply on the command line, I had a file that had a double exclamation point. I found out that that is a shortcut of some kind for the previous command. My kludge to get around this was to try to execute a single exclamation point as a command, then to change the double exclamation point to a quadruple exclamation point. Is there a proper way (escape sequence or something) to pass double exclamation points to a command?

View 2 Replies View Related

General :: Access Files With Spaces From Command Line?

Mar 17, 2011

How do I access files with spaces from the command line?
for example I want to go to a file called "New File" and let's say is in Downloads/Books/(and here is the file)
how do I input the space since the command line doesn't recognize it?

View 2 Replies View Related

General :: Shell - Rename A File From Something Without Spaces To Something Containing Spaces?

Jan 26, 2010

Is it possible, in Linux, to rename a file from something without spaces to something containing spaces? I know I can create directories and files with spaces by doing:

mkdir "new dir" and:

touch "new file.txt"

I want to rename files from:

imgp0882.jpg to something like:

20091231 1243 some topic.jpg

And how would it look in a shell script that uses parameters like:

for i in *.jpg do
rename "$i" "$somepath/$mydate $mytime $mytopic$extension"
?

I'm new to Linux (using PCLinuxOS 2009.2), coming from Windows, and I've written myself a little shell script to download files from my camera and then automatically rename them according to a date-and-topic pattern. As you can guess by now, I'm stuck on the bit about renaming. If you want to see my script, here's a copy. I'm not using jhead for this renaming because that only works with JPEG files but I want a single solution for any media format including videos.

View 2 Replies View Related

Ubuntu :: Command To Remove Spaces From Filenames?

Aug 18, 2010

I have just switched to banshee as my media player and imported my films and music. Problem is, the video list is quite hard to read because all the video files have spaces in their names which are replaced by % signs, numbers and letters. I'm wondering if there is a command I can use in the directory that will automatically remove all the spaces from the filenames or better still, replace the spaces with hyphens or underscores?

View 6 Replies View Related

Software :: MV Command With Files Name Include Spaces

Oct 3, 2010

One system send files to linux machine and it is name contains spaces and I tried to move it from one directory to other, but it show error:
Ex:-
mv -f file one file two
mv: target 'one' is not a directory

View 6 Replies View Related

Programming :: Unix Command To Remove White Spaces?

Sep 18, 2010

Im using this unix command(in a php file) to remove a certain string and then remove the whitespace left by that string. Unofrtunately in many cases, the files get completely erased. Is there a workaround?

Code

<?php
$dir = "./";
$rmcode = `find $dir -name "*.php"

[cod3e]....

View 14 Replies View Related

Ubuntu :: Remove All Foldernames Which Contains Spaces In Desktop With A Single Command?

Jun 8, 2011

How to remove all foldernames which contains spaces in Desktop with a single command?

View 7 Replies View Related

General :: Running Script As Command?

Jan 16, 2011

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.

View 1 Replies View Related

General :: At Command Not Running 'today'?

Nov 17, 2010

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.

View 3 Replies View Related

General :: Running This Command, And Seems Not To Work?

Jun 3, 2011

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:

View 6 Replies View Related

General :: Run A Command After An Already Running, Existing One Finishes?

Sep 11, 2011

If I start a script that is going to take a long time, I inevitably realize it after I've started the script, and wish I had a way of doing some kind of alert once it finishes.

So, for example, if I run:

really_long_script.sh

and press enter...how can I run another command once it finishes?

View 4 Replies View Related

General :: Command That Will List All Running Services?

Apr 2, 2011

i know that there is already a command for it but it comes out with a lot of letters that makes it hard to find the services that are runningi'm talking about services like DNS, APACHE, DHCP, SAMBA, SSH etcis there a command that will list these services and related services that are running instead of showing a bunch of jumbled and lettered mess thats hard to comprehend

View 6 Replies View Related

General :: Stopping Ksh From Exiting After Running A Command?

Nov 26, 2010

I want to launch a gnome-terminal with a korn shell, and I want to specify in advance a command to execute, and then hand control back over to ksh. ex.

Code:

gnome-terminal --execute ksh -ic ls

I expect that to run ksh, do an 'ls' for example, and then give a prompt. I thought the -i switch (for interactive) meant that the shell would resume control, but this doesn't happen. The window just closes quicker than I can see what was output.

View 3 Replies View Related

General :: Running Command On Remote System

Jun 29, 2010

I want to remote login as a non root user and then run a command under the root account.I have set up the ssh/scp for the non root user and this configuration works fine. What I dont know is how to run a command under root once remotly logged in as the non-root account.I have to run this command under root, it cannot be changed.

View 5 Replies View Related

General :: Running Sh Scripts From Csh Command Line?

Apr 21, 2010

i use the csh shell at work. you can either log on to servers locally or to the NFS mount. is is important to know which you are mounted to when executing scripts. csh is the only shell that lets me know which high availability server i am currently on.

before i write a shell script to complete a task, i have to type sh or bash at the prompt, hit enter and then configure the script. then when i am done, hit control -d to get out the bash or sh shell.

is there a way to run sh or bash scripts from the csh command line - i have tried typing this at the csh command line: /bin/sh (or ./bin/bash) while [ 1 ]; do ps auxwww | grep fire | wc -l ; done ... etc, but it does not work.

we do not have the zsh shell at work

View 6 Replies View Related

General :: Command Prompt Ftp To Ftp Server Running On Windows?

Dec 27, 2010

I am using on Windows Vista, Filezilla server. I have it set up to be accessed via outside IPs and when I use a client on the IP I have it connects normally using Filezilla client. On the same machine I have Ubuntu running in a virtual box and when using filezilla client in there it works fine. Now I want to try the command prompt. So I do the ftp xxx.xxx.xx.xxI enter the name and password and i get the ftp command prompt, but the commands are not working properly. when trying "ls" or "cd" these commands do not work. "cd" tells me that the current directory is "/" root, but this does not make sense in the windows operating system. Now the filezilla client is taking the user in the application window directly to the root folder of the permitted filespace granted to that user. How can the same be done from the command prompt, if there is a way? It is as if the command prompt takes me to the root which does not exist or even have correct permissions to move in. Is there any way to be taken to the correct directory directly, or move there especially when the slashes are the wrong way around etc?

View 1 Replies View Related

General :: Running Open Office From The Command Line?

Apr 7, 2011

Yesterday I installed OpenOffice on my Linux server. But when I go to run it through the command line, it says command cannot be found. I've also tried other things like OOWriter, etc. Has anyone had this problem? Installation process went like below: root@aserver [OOO330_m20_native_packed-1_en-US.9567/RPMS]#

rpm -i *.rpm
package openoffice.org-ure-1.7.0-9567.i586 is already installed
package ooobasis3.3-core01-3.3.0-9567.i586 is already installed
package ooobasis3.3-en-US-3.3.0-9567.i586 is already installed
package ooobasis3.3-core02-3.3.0-9567.i586 is already installed

[Code]...

View 2 Replies View Related

General :: Aliases Work After Running Sudo SU Command?

May 7, 2010

I can make aliases fine by editing the .bashrc file in my home directory, but the first thing I do when I open a terminal window is sudo su so I don't have to type sudo in front of every command. The problem is, I am then not able to use my aliases. How can I make aliases that work after I run the sudo su command?

View 2 Replies View Related

General :: 10.10 - Running Command On Startup (Remap Keys)

Jan 23, 2011

I want to run this command on startup.
xmodmap /etc/xmodmap
I am running Ubuntu 10.10 and need to remap keys. It only seems to work when I run it in terminal after I login.

View 2 Replies View Related

General :: Command To Check Whether Service Installed / Running?

Feb 26, 2010

Is there a unique command ( common to all Linux Distros, Solaris, Windows ) to know whether a service is installed and running on my system or not??

View 5 Replies View Related

General :: Command / C Function To See Cpu Number On Which Process Running?

Feb 22, 2011

When I fork multiple processes, is there some command or c function to see the cpu number on which the processes are running?

View 3 Replies View Related

General :: How To Use Grep To Display All Users Running Particular Command?

Mar 19, 2010

Can someone please tell me how I can use grep to display all users running a particular command.

View 3 Replies View Related

General :: Specify Password For Sudo Command When Running Bg Process?

Jun 23, 2010

I'd like to start a background job using the sudo command and route its output to a file. This presents a problem because the prompt for the password doesn't work properly. It looks something like this when I try it:

Code:
Mac:server user$ sudo php crossdomain_server.php > data/crosscomain_output.txt &
[3] 30303
Mac:server user$ Password:
[3]+ Stopped sudo php crossdomain_server.php > data/crosscomain_output.txt
Mac:server user$

Basically I'm not properly prompted for the password and as soon as I type anything in my background job fails because it didn't receive the password. Is there any way to execute a sudo command by supplying the password on the same line as the command?

View 9 Replies View Related

General :: Administrator - Command Used To View Processes Running

Nov 9, 2010

The command used to view processes running on the Linux machine is?

View 8 Replies View Related

General :: Running DF Command - Huge Space Between Columns

Jul 13, 2011

I am running the command on a Mac but due to it being a generic unix command and a command line query.. I thought I can write on this forum.. I am running the command

Code:
df -h | grep '/dev/'
I get
Code:
/dev/disk0s2 389Gi 62Gi 327Gi 16% /
/dev/disk0s3 76Gi 24Gi 52Gi 32% /Volumes/Backup
/dev/disk3s2 500Gi 47Gi 453Gi 10% /Volumes/Misc
Note the huge space between the 1st and 2nd Column..

This is because currently I have some NAS drives mounted which are not showing due to grep. When they are not mounted. The output is fine with equal spaces between each column (like between col 2 and 3.. or 3 and 4). I want to do a (dare I say) sed or awk or something to reduce the space between 1st and 2nd col. So that it has space like between col 3 and 4.. or 2 and 3. This is because I am showing this output somewhere and because of the space its not showing up correctly.Also I hope the command will still work when the NAS drives (afp) are not mounted.. basically consistency. The spaces are not showing properly in the quote tag. Changed it to CODE tag.

View 12 Replies View Related

General :: Command Running Multiple Jobs On Servers

Jul 26, 2010

How to submit multiple jobs onto a Linux server. The only way I know to submit and run a job on a server is using qsub, and verifying the status of the job using qstat. I usually run my scripts using qsub -cwd so that I can run it on my own directory (instead of having the results sent to a scratch folder).

1. However, assuming qsub/msub are not available, is there another way to do it? What commands can I use instead?
2. I know that some jobs can run in the background, is that an alternative? How do I do it? And would I still be able to check the status of the job or delete it?

View 2 Replies View Related

General :: Running Script On Ssh Command Line Want To See Output?

Jun 2, 2011

I'm trying to remotely run a script on a target machine though the ssh command-line using passwordless login. I know the keys are set up correctly because if I remove the call to the script, the ssh session succeeds and I can log into the remote machine, but when I call the csh script, I don't get any output on the command line. If I call an identical bash script, I do get the output. Specifically, calling line 1 below just returns me to the command line, but running line 2 echo's hello then returns to the command line (both scripts simply contain a single line to echo hello, and both work when run locally on the remote machine). Why do my csh scripts send any output through the ssh link whereas the bash does?

Code:
1) ssh -i /root/.ssh/id_rsa user@remotemachine /tmp/test.csh

2) ssh -i /root/.ssh/id_rsa user@remotemachine /tmp/test.bash Update: I have further determined that nothing I add to the csh gets run either. I've tried touching files and making directories in the scripts, and all gets run using the bash script, but calling the csh script like line 1 above does nothing, nothing is touched or created.

View 4 Replies View Related

General :: Disable The Terminal Beep When Running The Shutdown Command?

Sep 3, 2009

I've used the following script here: [URL] to upgrade Alsa to 1.0.21 in Ubuntu 8.04. Now whenever I run:

Code:

sudo shutdown -h <time> or sudo reboot from the terminal I get a rather annoying beep sound. What's even more annoying is if I use the shutdown command to specify a time I get a beep every 10 minutes or so.
I've tried disabling the terminal beep in the terminal profile, disabling the beep in System/Preferences/Sound, adding "blacklist pcspkr" to /etc/modprobe.d/blacklist, and running gconf-editor from the terminal and setting /desktop/gnome/peripherals/keyboard/bell_mode to 'off' rather than 'on'.

View 6 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved