I am new to unix and trying to make a script for writing all my command into another file and use that file to run all commands
I am trying to use for loop with echo command to generate a command based script for writing the file with all the command sequentially w.r.t for loop.
I want something like this
Code:
for i in (1..100000)
do
for k in (1..3)
echo "copy
I am trying to write a very very simple script in Linux.
Let me show you the code first:
#!/bin/bash
# The shell program uses glob constructs and ls
# to list all entries in testfiles, that have 2
# or more dots "." in their name.
ls -l /path/to/file/*.*.*
When I run this code with bash myscript command, I get something like: /path/to/file/file.with.three.dots
But I don't want this.
I have a rather large file (~50GB) and it takes some time to run
tar xvf file.tar.bz2
on it. I'm aware of programs that can do parallel compression for bzip2 files but unaware of programs that can do parallel decompression for bzip2 files.
Are there any programs that can achieve this? What is the exact syntax of the command to use to extract from the file?
I'm using ubuntu 12.04
Could some one tell me a single line command to feed my cmd input from a file and delete the same file while the command is still running?
EDIT: By single line command I meant, performing this entire action in one command. This behavior has got to do with executing processes and commands simultaneously.
I have a small script that loops through all files of a folder and executes a (usually long lasting) command. Basically it's
for file in ./folder/*;
do
./bin/myProgram $file > ./done/$file
done
(Please Ignore syntax errors, it's just pseudo code).
I now wanted to run this script twice at the same time. Obviously, the execution is unnecessary if ./done/$file exists.
i tried following command (nano ~/.bashrc) in order to include some path in .bashrc file in home directory but m not able to run any command and always getting following error
rag@rag-Satellite-C640:~$ nano ~/.bashrc
Command 'nano' is available in the following places
* /bin/nano
* /usr/bin/nano
The command could not be located because '/usr/bin:/bin' is not included in the PATH environment var
I have directory path in which there are several sub directories. In all these sub dir there will be one env.cnf file.
How do I write a command that searches the /var/www directory for all files with the name ".htaccess" and outputs the full location/path to each of the .htaccess files into a file?
This would save me a lot of time if this is possible with a unix command. I am running debian, lenny if that helps.
Hi,
I have a ftp script there I want to store the o/p of the below command:
Code:
sftp -b <batch file> user@password
cat <batch file>
get /remote/file/path/remote_file_name.csv*.gz /local/path
Now the problem is that when I fire this command.