10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello,
I supposed that it was working fine but now I see that it's not working as expected.
I am running under ubuntu14.04, trusty.
My plan was to search folderA and all subdirectories and move any txt file to destination folder, folderB :
find /home/user/folderA/ -type f -iname "*.txt"... (0 Replies)
Discussion started by: baris35
0 Replies
2. UNIX for Dummies Questions & Answers
Hi,
I have a directory which contains multiple files with .txt extension, i want to rename all these file to .bak extension using find command, this is what i've tried, please help me to correct this :
find /home/application/test -name '*.txt' -exec rename 's/txt/bak/' {} \;
seems to... (8 Replies)
Discussion started by: mukulverma2408
8 Replies
3. Shell Programming and Scripting
Hi all,
I wanted to find and replace an email id from entire directory structure on a Linux server. I found that find . -type f -print0 | xargs -0 sed -i 's/abc@yahoo.com/xyz@gmail.com/g' would do it perfectly.
But my search criteria has extended and now I want to search for a string1 like... (2 Replies)
Discussion started by: pat_pramod
2 Replies
4. Shell Programming and Scripting
Oracle Linux 6.4
In a directory I have more than 300 files with the extension .log
I want the first 5 and last 5 lines of these .log files to be printed on screen with each file's name.
Expected output :
Printing first 5 and last 5 lines of FX_WT_Feb8_2014.log
!! Authentication... (7 Replies)
Discussion started by: kraljic
7 Replies
5. UNIX for Dummies Questions & Answers
I'm searching for particular scripts that contain pattern "BASIS" so I used the following command:
find . -type f -print | xargs grep "BASIS"
or
find . -type f -exec grep "BASIS" {} \;
However, I found out that the find command in the UNIX box that I'm working on doesn't find files... (6 Replies)
Discussion started by: The Gamemaster
6 Replies
6. Shell Programming and Scripting
I want to recursively cat the content of files in a directory e.g.
find /etc -type f -exec cat {} \;
But I want it to print the file name first and then the content. For example let's say /etc/statetab and /etc/colord.conf will be printed first then I want the output to look something like;
... (6 Replies)
Discussion started by: lewk
6 Replies
7. Shell Programming and Scripting
HI,
Getting the syntax error " find: missing conjunction" for the below code
D1_DIR=/x/y/z
D1_NAME=file_name
FILE_DIR=pset
for file in `find ${D1_DIR}/${D1_NAME} -name "*\.${FILE_DIR}" /dev/null {} \;`
do
echo $file
done
#Trying to find all the files with *.pset... (5 Replies)
Discussion started by: cvsanthosh
5 Replies
8. Shell Programming and Scripting
dear experts,
Could you please help me to write a command/script to find follwing:
from the log file i want to grep "resCode89270200100001552311" after that only "<resultCode>40614</resultCode>"
it will be like that:
resCode89270200100001552311
<resultCode>40614</resultCode>
... (7 Replies)
Discussion started by: thepurple
7 Replies
9. Shell Programming and Scripting
Hi i would like to ask on how to accomplish the FF:
I want to execute a find command recursively and only get the filename something like i want only the last field set if is used ever the fieldvset as an redirection from the output of the find command
For example:
dir1/dir2/filename1... (2 Replies)
Discussion started by: jao_madn
2 Replies
10. Shell Programming and Scripting
Hi, here comes another newbie question:
How to find the number of non-duplicate names recursively?
For example, my files are stored in the folders like:
If I do
find . -depth -name "*.txt" | wc -l
This will gives out a result "4". One .txt file named "1.txt" in folder "1",
and... (2 Replies)
Discussion started by: jiapei100
2 Replies