Ubuntu :: Use Multiple Cut Command To Print Output On A Line?
Apr 27, 2010
how to use multiple linux cut comman to display on same line ?
e.g ls -il | cut -f6 d:
ls - il cut -f9 -d:
The linux script output is
filename
123
How to use cut to display on same line ?
View 1 Replies
ADVERTISEMENT
Apr 29, 2010
I am creating a script to sync my important documents between two system. I want my script to generate a log file for the last action. can you suggest me a way to achieve this.Question: If I execute the rsync command with -v flag, it will print a lot of messages on the console. Is there any way. So, I can redirect these logs to a file?
View 4 Replies
View Related
Jul 11, 2011
I am trying to find a way to print PDFs from the command line. I was using "cups-pdf', but I want to be able to specify the output folder from the command line. Is there a way to do this? I guess what I am trying to do is the Gnome "Print to file" option in the terminal so I can easily print off a batch of file to whatever directory I wanted.
View 4 Replies
View Related
May 3, 2011
Let's say I am pinging a host, and want to output to a file each reply and its timestamp of when this started.
I know that it can be done with a loop and a shell script. Something like this
DO
echo "$(date)" >> results.txt ###includes the time and outputs results to txt###
ping -c 4 HOST >> results.txt ###a total of 4 pings at a rate of 1 per second###
REPEAT UNTIL USER PRESSES CTRL-C
Now, my first issue is that I need to be able to see results real-time as well.
Is there a way one can print to BOTH a screen and output? If one uses the ">>" command, it is essentially sending everything to the file. Running another ping command in parallel is not an option.
View 3 Replies
View Related
Mar 4, 2011
I am using an awk command to print a line from a cvs file.the awk command includes an if statement that filter the output-lets say i want to print all the lines that the price field is greater than 30.i have it working when i put the parameters myself.. but when i try to send them with vars it wont work..i am sending the sign of the if statement - can only be: == , < , >it looks like this:
cat file.csv | awk -v sign=">" -v field="2000" '{if($3 sign field) printf "%-12s%-12s%-12s%-12s
",$1,$2,$3,$4}' FS=,
the bold part is the problem , because when i put the sign parameter myself t works great.. i guess its a chars issue but i cant spot it
View 3 Replies
View Related
Oct 6, 2009
I work at The University of Alabama as a sysadmin on various HPC resources and also provide support for faculty using Unix systems. I've run into one problem that is affecting two different desktop systems running CentOS 5.3.oth of these systems have the latest updates. These machines have standard network-attached printers. One is an HP LaserJet 3250 and the other is a model that is pretty close to that one.Previously these users were able to print from graphical applications such as Firefox, but now when the print dialog is opened on ANY graphical application, it causes a hard freeze on that particular app.Printing from the commandline via `lpr` gives no issues and test pages from the Printer Admin interface also succeed.This problem has me stumped, so I'm looking for any insight as to what could have changed. I do not know what changed between the time when the printers worked graphically and when they stopped, but the users assure that they have changed no settings. The only thing I can suspect is a rogue update since this is affecting separate users on separate machines with separate printers.
View 4 Replies
View Related
Feb 3, 2010
I need to create a single line of output from multiple and variable lines of input in a Linux bash shell script.
My input file looks like this:
Where there may be any number of umsecondaryphonenumber lines; if there is not a umsecondaryphonenumber line for a telephonenumber, I don't want to write any output.
So, the output file should look like:
The script I have so far is:
My question is - how do print each of the elements of an array in one record - i.e. what do I put in place of howdoiprintarray?
View 2 Replies
View Related
Dec 21, 2010
How to print a sequence of line say line number 10 to 20 of a 50 line file ?
View 6 Replies
View Related
Jan 7, 2010
I have a requirement to print images (two to be precise) from the command line of a given size and without losing too much quality.
So, I may have two images, a.jpg and b.jpg which may be 4x4" and 6x4" respectively (the sizes may vary). I need to be able to print both these on a single sheet of paper (one under the other) at a given size for each - so a may be 2x2" and b may be 3x2" - the aspect ratio will always be maintained (or as near as possible!)
I am currently doing this a very messy way (because I don't know any other way!!) - basically I am converting the picture to a given size using a set density using convert and then concatenating the two using montage.
Here is part of my script:
Code:
Don't worry too much about the case statement at the end - that is just to be able to select to print either A, B or A and B.
The issue with this is that is doesn't work great if the aspect ratio is not maintained perfectly and also, it loses quite a lot of quality on the print.
I have a very old windows app which I wrote years back in VB (o dear! ) which does the same thing and the quality is fine (I am running it through wine). I want it to be command line though because I want to run it as part of other scripts etc.
View 4 Replies
View Related
Sep 22, 2011
I'd like to print only few groups from text matching a regex. How can I do that in the Linux command line?
What other tools for text processing are there in Linux?
View 3 Replies
View Related
Apr 3, 2011
CUPS was not originally installed on my server, I have installed it but cannot print to my network printer. On my laptop, I can... they are both running the same version of Debian. What could be missing?
Here are some details...
I have two computers running the same version of Debian. One is a server with no GUI and the other is my laptop with GDM installed. My laptop (which prints with no problem) is connected via Wifi. My server is connected directly to the router via Ethernet. I cannot print from the server.
The printer is a Canon Pixma MP495 that connects to the router via Wifi. I have downloaded drivers for the printer from [url] and installed them successfully using dpkg on both computers.
Right now I have a regular text file that I am using for a test page. To print from my laptop (with success) I type:
Code:
This does not work from the server. What could I be missing?
lpq run on server:
Code:
lpinfo readout:
Code:
View 14 Replies
View Related
Sep 6, 2011
If I grep -nr sumthin * in my source code directory, it also spews out very long lines from minified JavaScript or CSS files. I want to get just the first 80 characters per line. For example, a regular grep gives me this:
css/style.css:21:behavior: url("css/iepngfix.htc")
css/style-min.css:4:.arrow1{cursor:pointer;position:absolute;left:5px;bottom:10px;z-index:13;}.arrow2{cursor:pointer;position:absolute;right:5px;bottom:10px;z-index:13;}.calendarModule{z-index:100;}.calendarFooterContainer{height:25px;text-align:center;width:100%!important;z-index:15;position:relative;font-size:15px!important;padding:-2px 0 3px 0;clear:both!important;border-left:1px solid #CCC;border-right:1px ... etc.
But I'd like to get just this instead:
css/style.css:21: behavior: url("css/iepngfix.htc")
css/style-min.css:4:.arrow1{cursor:pointer;position:absolute;left:5px;bottom:
What Linux command can do this?
View 3 Replies
View Related
Jan 25, 2011
I try to write script and echo two command at the same line .
echo "A"
echo "B"
How can I pipe above two command at the same line in text file . So, in the output text file , you can see below ? Code: A B not Code: A B
View 4 Replies
View Related
May 31, 2010
I have the following shell:
export PATH=/u01/app/oracle/product/10.2.0/db_2/bin:/usr/sbin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin
ftp -u -v -n -i > /bk01/exports/FTP_OUTPUT.LOG <<EOF
open 197.0.0.78
user orabackup orabackup
cd /media/disco/BK_Oracle
bin
put FILE00001.LOG
put FILE00001.DMP
quit
EOF
Executing the shell from command line, the output is:
Connected to 197.0.0.78.
220 Bienvenido al servicio FTP del servidor backup.
530 Please login with USER and PASS.
530 Please login with USER and PASS.
331 Please specify the password.
230 Login successful.
250 Directory successfully changed.
200 Switching to Binary mode.
local: EXPO_APOT10G_20100531.LOG remote: EXPO_APOT10G_20100531.LOG 227 Entering Passive Mode (197,0,0,78,200,162) 150 Ok to send data. 226 File receive OK. 127498 bytes sent in 0.0022 seconds (5.7e+04 Kbytes/s)
local: EXPO_APOT10G_20100531.DMP remote: EXPO_APOT10G_20100531.DMP
227 Entering Passive Mode (197,0,0,78,175,141) 150 Ok to send data. 226 File receive OK. 458190848 bytes sent in 6.1 seconds (7.3e+04 Kbytes/s)
221 Goodbye.
Executing the shell from cron, the output is:
Connected to 197.0.0.78 (197.0.0.7.
220 Bienvenido al servicio FTP del servidor backup.
331 Please specify the password.
230 Login successful.
250 Directory successfully changed.
200 Switching to Binary mode.
local: EXPO_APOT10G_20100531.LOG remote: EXPO_APOT10G_20100531.LOG
local: EXPO_APOT10G_20100531.DMP remote: EXPO_APOT10G_20100531.DMP
221 Goodbye.
Why from cron the output no show the statistics in red ...?
View 2 Replies
View Related
Jan 24, 2011
I try to write script and echo two command at the same line .
echo "A"
echo "B"
How can I pipe above two command at the same line in text file . So, in the output text file , you can see below?
Code:
A B
not
Code:
A
B
View 9 Replies
View Related
Jul 14, 2010
I'm troubleshooting a batch of scripts I'm modifying, including an IDL script called by a .csh script. the IDL scripts were provided to me by a coworker and my .csh script is intended to automate a lengthy set of extremely tedious and time consuming processing tasks.
I am currently in the process of debugging, and can't get the IDL to print any messages other than critical failures to the screen. Is there any easy way to redirect the stdout to either a logfile or the screen?
View 2 Replies
View Related
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
Jul 22, 2011
I have copied over my .gnupg files from a computer to a new workstation that is running Mandriva 2010.2. I am running Thunderbird as a mail client just as before and got Enigmail installed and running fine. The problem I get is when I send a message off with a digital sig it returns this error:
Send operation aborted
Error - bad passphrase
gpg command line and output:
/usr/bin/gpg
gpg: cancelled by user
It does not give me a chance to enter in the passphrase. I copied over the .gnupg files to my Ubuntu laptop running Thunderbird with Enigmail and I have no problems. Could there be an issue going from 32 bit to 64 bit? I checked out the forums and found no answers.
View 1 Replies
View Related
Mar 2, 2010
command line, I have a server for work that I ssh into and I need to be able to find multiple files (they have the leading text just the date identifier changes) and then zip the files (with bzip) them and then finally scp(Secure copy) them to another server.
These files are always in the same directory and this is a daily task and just want to make into a script that I run once I am logged into the remote server.
View 4 Replies
View Related
Sep 15, 2010
I liked the idea of the "cosmos" screensaver/desktop, but wanted to add my own pictures to the application. I navigated to /usr/share/backgrounds/cosmos and tried to drag and drop. I quickly found that I did not have permission to do this.
I googled my problem and found some command line tutorials telling me to sudo cp. My problem is that I have about 30 pics that I want to move in there, and I don't think I can just move the directory, they have to be in that folder as the pictures themselves.
I don't really feel like typing the cp line multiple times with multiple randomly named image files.
Is there a way to have the command line cp all of my files from one directory to another?
View 4 Replies
View Related
Feb 13, 2010
I have a command which generates the following output:
Code:
$ sudo vnconfig -l
vnd0: not in use
[code]...
View 6 Replies
View Related
Feb 22, 2011
I've seen a few tutorials that have commands and parameters on multiple line, like the one below:
Code:
chkconfig --levels 235 mysqld on
/etc/init.d/mysqld start
I can copy and paste this in Putty, but what if I want to manually type it? If I press return, the first line gets processed, so how do I insert a new line?
View 4 Replies
View Related
Jun 4, 2011
I have a problem with YaST Partitioner. When I launch it, a window opens, a dialog (to confirm that I know what I am doing) pop-ups, I choose "Yes", the application starts to initialize, and after 0.5-1s the window is closed without any error message. Does anybody know how to at least find out what is wrong? .. or how to launch it from command line to get some output?
View 8 Replies
View Related
May 21, 2011
I am trying to get 2 things to operate on the same line, for example echo Current Version: [cat /file/ver.txt] is there a way to do this?
View 1 Replies
View Related
Mar 26, 2010
I have an older computer with Arch installed that I want to use to accomplish most of my daily tasks using the command-line (Mailgrab, IRSSI, mpg123, Elinks, Vi, etc). I realize that there are many lightweight WMs out there that support multiple monitors, but it'd be nice if I could just use Screen or something to that effect to distribute my windows across two or three displays.
View 1 Replies
View Related
Aug 28, 2010
I'm pretty sure this is doable from the command line, but my CLI skills have degraded a lot since my pre-Y2K admin days. The goal is to search all the files in the directory for a very long string of text and replace it with another string of text. The text being searched for is my Google Adsense code (which will be stripped from my website) and it will be replaced with a placeholder so I can easily tack something else in there in the future.
Seeing how I have that long snip of code on about 100 pages, automating the process would make life easier.
If I was searching for a single word, I can see ways to do this.
If I paste the code I'm searching for into a text file, is there a way to:
find (contents of oldstring.txt) and replace with (contents of newstring.txt)?
View 9 Replies
View Related
Feb 15, 2011
Is there any way to quickly remove multiple related packages from the command line instead of having to enter the name of every single one? I am trying to remove OpenOffice from my server running 10.04. It would work nicely if I could get a list of packages without line breaks, such as the list displayed by aptitude when upgrading. That way I could just paste the package list into the terminal. However, "aptitude search 'openoffice'" dumps a long list on many lines that cannot be used that way.
View 3 Replies
View Related
Jan 27, 2011
Can anyone tell me what the pros and cons are between heirloom-mailx vs mailutils? This is for ubuntu 10.04 LTS. AT this point my only purpose is to use the mail command line program to occasionally send log output to email aliases.
View 2 Replies
View Related
Mar 5, 2011
I am using ubuntu and mysql.I have a list of many .sql files, like 1.sql, 2.sql, 3.sql ... 100000.sqlI need to insert them into the database mysql mydb < *.sqlGives me: -bash: *.sql: ambiguous redirect
View 2 Replies
View Related
Apr 27, 2010
I want to (from the command line) be able to counte lines in a bunch of files of a specific type in a folder and all its sub-folders. How would I do this?
View 1 Replies
View Related