04-23-2013
<--start
grep -il Bufman *.* | while read file
do
echo "Moving $file"
mv $file ../MARK/
done
end-->
I am searching file in current directory only
10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
Hi, I wonder if anyone can help me. I have a file with about 200 lines in it. I am wanting to set up a Count so that it picks out each line at turn and edits the line. However i am having trouble pulling out the specific line. I have a feeling it will be done somehow by a grep -n but what ever i... (2 Replies)
Discussion started by: mariner
2 Replies
2. Shell Programming and Scripting
Hi All,
I am having a script in which I am greping some values and storing them from files with .err and .log extensions.
I feel I can do it better.But How?
Below is my piece of code.
oneerrors=`egrep -i -n "one" *.err *.log`
twoerrors=`egrep -i -n "two" *.err *.log` ... (2 Replies)
Discussion started by: Sreejith_VK
2 Replies
3. Shell Programming and Scripting
OKAY----
Here's what I must do.
I have two files. I need to compare the two files such as with the diff command. I am adding FILENEW to FILEOLD
If fields $1, $2, $5, and 6 are the same, then I don't want to add FILENEW records to FILEOLD.
If they are not, then append the lines.
Is... (11 Replies)
Discussion started by: jeffpas
11 Replies
4. UNIX for Dummies Questions & Answers
Hi
I have two files
File 1
alias HOME =..
alias DATA = ${DATA}/runtime1/test
alias SQL = ${DATA}/find1dir/test
alias SQL1 = ${HOME}/sql/orcl
alias SQL2 =... (2 Replies)
Discussion started by: ssuresh1999
2 Replies
5. Shell Programming and Scripting
Hi All
I want to send a file thru a mail with an attachment.
i tried using uuencode , but it says
"bash: uuencode: command not found"
and the same i am getting for mutt as well:
"bash: mutt: command not found"
Tried searching in all the forums but could not find anything... (2 Replies)
Discussion started by: Prateek007
2 Replies
6. UNIX for Dummies Questions & Answers
I have a log file and I have two unique strings which represent the start and end of the text I want to obtain.
How can I get all the text inbetween this start string and the end string?
Thanks (2 Replies)
Discussion started by: chrisjones
2 Replies
7. Shell Programming and Scripting
Hi,
What is the easiest way to list a directory with 1000s of filenames, grep it for a certain sequence of numbers, and if found to rename the file by the value you are grepping.
eg
The file I am examining will looks like this:
1234
1224343
2324
244
35665
If I am examining a list... (1 Reply)
Discussion started by: mantis
1 Replies
8. Shell Programming and Scripting
Hi All,
I need help to know the exact command when I grep large list of files. Either using ls or find command. However I do not want to find in the subdirectories as the number of subdirectories are not fixed. How do I achieve that.
I want something like this:
find ./ -name "MYFILE*.txt"... (2 Replies)
Discussion started by: angshuman
2 Replies
9. Shell Programming and Scripting
I have around 300 files(*.rdf,*.fmb,*.pll,*.ctl,*.sh,*.sql,*.prog) which are of large size.
Around 8000 keywords(which will be in the file $keywordfile) needed to be searched inside those files.
If a keyword is found in a file..I have to insert the filename,extension,catagoery,keyword,occurrence... (8 Replies)
Discussion started by: millan
8 Replies
10. Shell Programming and Scripting
Hey guys,
I have wrote the following script to apply a module named "trinity" on my files. (it takes two input files and spit a trinity.fasta as output)
#!/bin/bash -l
#SBATCH -p node
#SBATCH -A <projectID>
#SBATCH -n 16
#SBATCH -t 7-00:00:00
#SBATCH --mem=128GB
#SBATCH --mail-type=ALL... (1 Reply)
Discussion started by: @man
1 Replies
LS(1) General Commands Manual LS(1)
NAME
ls - list the contents of a directory
SYNOPSIS
ls [-acdfgilqrstu1ACFLMRTX] [name...]
DESCRIPTION
For each file argument, list it. For each directory argument, list its contents. The current working directory is listed when no files
are named. Information is printed multicolumn on terminals, single column if the output is redirected. The options control what informa-
tion is shown and how.
Ls has two sources other then the commands line to draw options from, one is the environment variable LSOPTS and is used only when the out-
put of ls is displayed on a terminal. The other is the name of ls itself. If ls is linked to another name, then all the characters after
the l are used as flags too, except that f, r, t and x are translated to F, R, T and X. Useful links are ll, lf, lm and lx.
Files whose names start with a dot are by default not listed.
Note that standard Minix doesn't have symbolic links or sockets and -u and -c are no-ops on a V1 file system, since only modified times are
stored in V1 inodes.
OPTIONS
-a All entries are listed, even . and ..
-c Use inode changed time for sorting, listing or searching.
-d Do not list contents of directories, but list the directory itself.
-f Do not sort (should also be: treat a file as a directory, but that can't be implemented portably).
-g Suppress the owner name on a long listing (implies -l).
-i I-node number printed in first column.
-l Long listing: mode, links, owner, group, size and time. (ls -lC uses columns in a wide enough window!)
-n Print numerical user and group id's.
-q Print nongraphic characters as '?' (default on terminals).
-r Reverse the sort order.
-s Give size in kilobytes.
-t Sort by time (modified time default), latest first.
-u Use last accessed time for sorting, listing or searching.
-1 Print in one column.
-A List all entries, but not . and .. (This is the default for privileged users.)
-C Print multicolumn (default on terminals).
-F Mark directories with a '/', executables with a '*', UNIX domain sockets with a '=' and symbolic links with a '@' behind the name.
-L Print the file referenced by a symbolic link instead of the link.
-M List mode before name (implies -C).
-R List directory trees recursively.
-T Group files by type, i.e. regular files together, directories together, etc.
-X Print crunched mode and size before name (implies -C). Only the rwx permissions that its caller has on the file, but they are in
upper case if the caller owns the file and has given the permission to the callers group or other users. The size is listed in
bytes (<= 5K), or rounded up kilo, mega or gigabytes.
SEE ALSO
du(1), stat(1), stat(2).
BUGS
Having to type ls -C when viewing files through more(1).
Is only portable to systems with the same st_mode (see stat(2)).
The LSOPTS variable and the -M, -T and -X flags are not found on other ls implementations. (They have there own nonstandard flags.)
AUTHOR
Kees J. Bot (kjb@cs.vu.nl)
LS(1)