General :: Inserting Multiple Files To Mysql On Command Line?

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


ADVERTISEMENT

Ubuntu :: Find Multiple Files In The Command Line?

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

Ubuntu :: Move Multiple Files Via Command Line?

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

OpenSUSE :: Count Lines In Multiple Text Files From Command Line?

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

Ubuntu :: Command Line - Find And Replace Text Within Multiple Files?

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

Fedora :: Mysql Error When Type Mysql Into The Command Line?

Jan 16, 2011

I have mysql downloaded and when I type mysql into the command line I get this:

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111)

View 6 Replies View Related

General :: Multiple Lines At The Command Line?

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

General :: Command-line On Multiple Monitors, ScreenWM?

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

General :: Inserting Mysql Database Using Shh Putty?

Jul 24, 2010

I've down loaded mysql database file and now I'm looking at adding it into a new dedicated server. Should I upload that sql file to the root folder I created for the domain and insert it with shh like that? If not where should I upload this mysql file to insert it to the new database. It's rather large so I have to use SHH Fir example if this is the code,

Code:

mysql -uUSERNAME -pPASSWORD DATABASENAME < MYDATABASE.sql
where is that actual location of MYDATABASE.sql

View 8 Replies View Related

General :: How To Program The Command Line To Run A Piece Of Code Multiple Time

Dec 4, 2010

So, I usually write/find a test case generator for any code that I write. This type of code generally leads to some file output. To be thorough, I try and generate many different files to test my code on.

Say the command is like this:

Is there a way to automate this for many different values of the parameters and generate many different files?

I tried:

I wasn't able to use the $i in the filename, and without it the command gave me no errors, but did nothing else either. I know the Unix command line is very powerful, and I have a feeling that this should be possible, but I just don't know how to do it.

View 3 Replies View Related

General :: Making Multiple Duplicate File Copies Using Cp On Command Line?

Jul 21, 2011

I want to take a graphics file and make 10 copies of it to the same directory, each with 001, 002, or some such designation at the end of each file name so they have discrete files names. Is this possible using cp?

View 12 Replies View Related

General :: Search And Replace Line In Multiple Files?

Jul 13, 2010

Hello, I need some help searching through multiple files, finding a line and replacing that line. The line I am searching for is:

password key ******* 1222554

ultimately I want to be able to delete the numbers after the asterisks . my thoughts are to create a script that will search for the line password key ******* and delete it then replace it with password key ******* my files are located in /opt and they are all txt files.

View 13 Replies View Related

General :: Inserting Xml Data Into Mysql Taking So Long?

Jun 14, 2011

I have about 200k data entries in xml file. I wrote php script (using php-xml) to read xml file and insert into mysql. At first it went really quickly inserting, then after a while after inserting 100k entries, it slowed right down, just like it would not even doing anything. I have CentOs with 512M on VirtualBox running as server.

View 3 Replies View Related

Programming :: BASH: Each Line Of Multiple Text Files Gets Added To One Line?

Sep 12, 2010

I currently have 3 files with floating point data that I wish to have in a single file with the format:

Code:

F1 F1 F3 Output
a1 b1 c1 a1 b1 c1
a2 b2 c2 a2 b2 c2
a3 b3 c3 a3 b3 c3
a4 b4 c4 a4 b4 c4

View 3 Replies View Related

Programming :: Bash Reading Multiple Files Line By Line?

Mar 8, 2011

I have a set of files containing data that I need to re-arrange into one single property list.

The files that I have look like this:

Code:
# cat uk
<string>10</string>
<string>11</string>
...
<string>29</string>

[Code]....

So the lines in the files match up but I haven't found a way of reading several files line by line.

View 3 Replies View Related

General :: Run Same Command On Multiple Files With Same Extension?

Nov 10, 2010

how to run a command on all files with the same extension in a directory like this:

Code:

tex breqn.dtx; tex empheq.dtx; tex flexisym.dtx; tex mathstyle.dtx; tex mathtools.dtx; tex mhsetup.dtx; tex xfrac.dtx;

but in a simpler manner? I found this: Code: find . -type f -name *.dtx -exec tex {} ; but isn't there something simpler?

View 4 Replies View Related

General :: Viewing Multiple Files With The Less Command?

Apr 14, 2010

When we view multiple files using less, how to go on to the next file? I gave these two commands:

Code:

[root@localhost log]# ls -lt boot.log*
-rw------- 1 root root 0 Apr 11 04:02 boot.log
-rw------- 1 root root 0 Apr 4 04:02 boot.log.1
-rw------- 1 root root 0 Apr 1 19:14 boot.log.2
-rw------- 1 root root 0 Mar 21 04:02 boot.log.3
-rw------- 1 root root 0 Mar 14 04:02 boot.log.4
[root@localhost log]# less boot.log*

This is what I got:

Code:

boot.log (file 1 of 5) (END) - Next: boot.log.1 <RETURN>
(END) - Next: boot.log.1

I could not view boot.log.2.

View 3 Replies View Related

General :: How To Download Files From Command Line

Aug 29, 2010

For example, see this page Advanced Linux Programming.

I want to download all the pdf files linked from this page. Is there a simple commandline way of doing it?

Something on the lines of

download [URL]

View 2 Replies View Related

General :: Joining Two Files From The Command Line?

Oct 21, 2010

I'm looking for a solution for the following simple problem. I have two files, fileA and fileB. Each file contains only one word per line, and they contain exactly the same number of lines. I would like to create a new file called fileAB, where the i-th line contains the i-th line of fileA, a Tab separator character, and then the i-th line of fileB. I know how to do it in Python or other scripting languages, but it would be nice to have a bash one-liner for that. Is it possible to do this in bash or any other Unix shell, using the tools that are usually available on the command line (e.g., sed, awk and such)?

View 1 Replies View Related

General :: Command Syntax To Modify Multiple Files

Sep 26, 2009

I have a program I use, rrdtool. I need to modify a ds value on every file at the same time. However, using a wildcard (*) to try this operation of all files does not work and instead only updates one file.

Here is the command syntax:
rrdtool tune <file> --maximum traffic_in:100000000000 && rrdtool tune <file> --maximum traffic_out:100000000000
So, how can I do this on every file in the directory?

View 5 Replies View Related

General :: SQL Like Group By And Sum For Text Files In Command Line?

May 2, 2010

I have huge text files with two fields, the first is a string the second is an integer. The files are sorted by the first field. What I'd like to get in the output is one line per unique string and the sum of the numbers for the identical strings. Some strings appear only once while other appear multiple times. Given the sample data below, for the string glehnia I'd like to get 10+22=32 in the result. how to do this either with gnuwin32 command line tools or in linux shell?

[Code]...

View 2 Replies View Related

General :: Command Line - Trying To Cleanse Log Files On A Machine - Currently Using Sed

Feb 21, 2011

I have a large amount of log files that I need to remove sensitive data from. The sensitive data is provided to me in a text file and is prone to change. I had hoped to do the equivalent of this:

[Code]....

The commented out egrep works fine, the sed doesn't. Am I right to use sed for this? Or is there a more apt route to take?

View 2 Replies View Related

General :: Command Line - Compressing All .pdf Files Recursively (.tar)?

Jun 20, 2011

At the linux command line, I'd like to compress all .pdf files in a directory, any of it's subdirectories and so on - but only .pdf files. I'm struggling to figure out the syntax

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

Server :: Retrieve MySQL Data From Command Line?

Aug 17, 2011

My computer has broken and I cannot login. I don't know what caused it.

I am using Fedora 14 and so it is easy to retrieve my files with the Fedora 14 installation disk under the 'restore' option. I cannot however, work out how to retrieve my MySQL data.

Would anyone be able to shed some light on this matter?

View 1 Replies View Related

Software :: Create Mysql Database From Command Line?

Feb 13, 2010

I want to create database from script directly by taking inputs USER, PASSWORD and DBNAME.code...

How to resolve this or any alternate method (other than entering into mysql prompt like mysql -u USER -pPASSWORD)?

View 3 Replies View Related

General :: Delete Files On The Command Line With Regular Expressions?

May 6, 2010

Lets say I have 20 files named FOOXX, where XX is the number of the file, eg 01, 02 etc. At the moment, if I want to delete all files lower than the number 10, this is easy and I just use a wildcard, eg rm FOO0* However, if I want to delete specific files ina range, eg 13-15, this becomes more difficult. rm FPP[13-15] does not work, and asks me if I wish to delete all files. Likewse rm FOO1[3-5] wishes to delete all files that begin with FOO1 So, what is the best way to delete ranges of files like this? I have tried with both bash and zsh, and I don't think they differ so much for such a basic task?

View 2 Replies View Related

General :: Grep Command - Show The Files But Not The Line Count

Oct 31, 2010

This has to also show the line count. I can get it to show the files but not the line count. What is the single command used to identify only the matching count of all lines within files under the /etc directory that contain the word „HOST? List only the files with matches and suppress any error messages.

View 4 Replies View Related

General :: System Command Line Utility For Watching Log Files Live?

Jan 5, 2011

What's a good linux command line utility for watching a log file live? It's probably obvious but I totally forgot it.

View 2 Replies View Related

General :: Execute My Scripts (example.sh) Files Like Other Normal Commands From Command-line?

Jun 23, 2010

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 Related







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