Import the sql file into mysql via the command line

I have a little weird problem. I would like to import sql file via command line. Command looks like mysql -u root -p root pdweb-sandbox < C:\Apache24\htdocs\pdweb-sandbox\migrations/init.sql But if there is password explicitly typed in command it doe

Truncated names in the DB2 tables list

In the Windows command line when I ask for the table names in a certain schema the names are truncated: db2 => list tables for schema SCH Tabela/Exibição Esquema Tipo Hora da cria ------------------------------- --------------- ----- ----------------

Could not make Grunt work, tried everything

I have been running grunt on my computer for the last year and now it and other commands all randomly stopped working. When trying to run grunt --version, says "The term 'grunt' is not recognized. I tried loading npm install -g grunt npm install --sa

Scan, group and count file extensions in Linux

Is there a way to scan a path and group and count the file extensions?If I understand your question, you can use this command - ls -ls | awk '{print $10}' | grep "\." | awk -F. '{print $2}' | sort | uniq -c which count the extensions in the curr

take the parameters of the command line in C?

So I'm pretty new to C and am trying to learn how to make it take command line inputs, I typed it in what I'm hoping is the correct syntax and I'm trying to get it so you type in 2 numbers and it returns those two numbers added together. The program

How to list all results find -perm?

I want to give a long list (with ls -l) of all the files in home directory that is writable by user, how can I combine find and ls -l? find ~/ -maxdepth 1 -exec ls -l '{}' \; If you are strictly interested only in files, i.e., no folders then you can

How to insert ($ x- $ y) inside a bash print string

I have this simple problem but I am very unfamiliar with bash syntax; I need to print this line that should output something like Starting 3 more instances: echo 'Starting '($2 - $total_running_instances)' more instances' But I don't know how bash ex

List files without corresponding specification

I've gotten a list of files using: $ find ./app ./spec -name "*.rb" -print | sed 's!^.*/!!' | sort And I receive a list like so: thing.rb thing_controller.rb thing_search.rb thing_search_spec.rb thing_serializer.rb thing_serializer_spec.rb thing

delete the words between the specified characters with sed

i have a file this format : Word1 : "Word2" Word3 I want to remove "Word2" Then file must be like this : Word1 : Word3 How can i do this with sed? Note : Word2 is changeableIf file.txt is your file, you can try this from command line:

Apache Grep big log file

I need to parse Apache log file to look for specific suspicious patterns (like SQL injections). For example I'm looking for id='%20or%201=1; I am using grep to check the log file for this pattern (and others) and because these logs are huge it takes

Close a running application from the DOS command line

The start command can launch an application like notepad in a batch file like this: start notepad start "my love.mp3" But how do I close the running application from the command line? I found taskkill in my searches but I don't think that is the

Audio streaming via SSH on an Android device

I'm able to securely stream audio from one PC to another via SSH using: ssh <username>@<host> 'dd bs=1k if=/dev/audio' > /dev/audio Is there any similar way to do this from a terminal running on an Android phone? I tried testing this from a

SVN locks a directory

Sorry if this is a duplicate, I didn't find the right answer still.. How do you lock a svn directory from command line? I need to lock a branch from checkins Edit: All of these answers I've found require the person to access the svn server. Thats not

How to display a log file generated by screen (screenlog.0)

So I just found out I can create log files of everything I do in screen (C-a H). Sounds like a nice way to keep track of potential goofs in a particular screen session. However, when I went to try it out the logfile is reported as being a binary file

Python: How to make an option to be needed in optparse?

I've read this But I'm not so clear how to make an option to be required in optparse? I've tried to set "required=1" but I got an error: invalid keyword arguments: required I want to mak

Make sure the Apache user is allowed to use shell

how can I make sure that Apache/web server user is allowed to execute shell commands? I would like to execute a shell command in PHP script but it doesn't work for some reason (it works when written manually in shell by hand, of course, so the comman

Error with propel-generate-crud in Symfony 1.0

When I try to generate a CRUD test for a new project I am getting a PHP Warning and a Fatal Error. The errors relate to files that it cannot find, however, I have checked and the files are definitely there. The error text is 'require_once(lib/model/m

command line argument array

I am having a command line arguments as like this I need to get the two as like this how is it possible ApplicationId =1; Name =2 I like to get the two values 1,2 in single array how to do this.Try string values = "ApplicationId =1; Name =2"; st

How do I reuse a command in bash with different parameters?

I have two scripts that often need to be run with the same parameter: $ populate.ksh 9241 && check.ksh 9241 When I need to change the parameter (9241 in this example), I can go back and edit the line in history. But since I need to change the numb