10-03-2008
Need help in writing script for finding files in the unix machine?
I would like to find whether a file exists in the UNIX machine. That i can check using
if [-f $file];then
echo "exists"
echo " `cat $file` "
else
echo "invalid file"
fi.
and i can find out using :
find / -name "filename" . But it i have wanted to search in all directories. How to get this???
Please suggest.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I need to write a Unix shell script which will list top 10 files in a directory tree on basis of size. i.e. first file should be the biggest in the whole directory and all its sub directories.
Please suggest any ideas (10 Replies)
Discussion started by: abhilashnair
10 Replies
2. Filesystems, Disks and Memory
I am trying to learn what command I would need to enter to tell my very old tape writer to write a large > 210 MB file from a UNIX box to 3480 tapes. I can get a single tape to write < 210 MB but if the file is large I am not aware of what command to enter to tell it to split the input file across... (0 Replies)
Discussion started by: james.hodge@eds
0 Replies
3. Shell Programming and Scripting
Hi all
i need some help in writing a small script that searches a string and then replaces it by a new string
for searching the best result i get is from find comand combined with xargs
e.g.
find . -name "*.*" |xargs grep -l "search string"
this command I use in root directory and this... (4 Replies)
Discussion started by: Aditya_IT
4 Replies
4. Shell Programming and Scripting
can anyone help me in writing script in UNIX for copying files in two server from the third server after checking the files in the third server and if there is anything new in the third server automatically it should be added to the rest of the two servers and if same file is existing in the two... (4 Replies)
Discussion started by: REKHA09
4 Replies
5. Shell Programming and Scripting
I am working on writing scripts. Here is a script I need help with. I have also wrote what I think it is. I would really appreciate any help that I can get.
Create an executable script file called "newname" that will perform the followings:
1. Rename a file upon the user's request. If the... (2 Replies)
Discussion started by: wiggles
2 Replies
6. Shell Programming and Scripting
Create an executable script file called "newname" that will perform the followings:
1. Rename a file upon the user's request. If the file exists, prompt the user for confirmation before renaming the file. The screen should prompt the user for
a. "Name of file you want to rename." Use the "\c"... (7 Replies)
Discussion started by: wiggles
7 Replies
7. Shell Programming and Scripting
i need to ftp a file from windows to a unix machine by executing a sript(perl/shell/php) from that unix machine.i can also use HTML and javascript to build forms. (3 Replies)
Discussion started by: raksha.s
3 Replies
8. Shell Programming and Scripting
I need a shell script to copy files frm a linux machine to a windows machine using SCP. The files keeps changing day-to-day. I have to copy the latest file to the windows machine frm the linux machine.
for example :In Linux, On July 20, the file name will be 20.txt and it should be copied to... (3 Replies)
Discussion started by: nithin6034
3 Replies
9. Shell Programming and Scripting
Hi All..
Am new to Unix!!
Am creating a shell script in which a scenario is like i have transfer the output file from unix machine (Server) to local directory (Windows xp).
And also i have to transfer the input file from the local directory to Unix machine (Server)
Any help from you... (1 Reply)
Discussion started by: vidhyaS
1 Replies
10. Shell Programming and Scripting
Hi All ,
I have multiple pipe delimited csv files are present in a directory.I need to find out distinct count on a column on those files and need the total distinct
count on all files.
We can't merge all the files here as file size are huge in millions.I have tried in below way for each... (9 Replies)
Discussion started by: STCET22
9 Replies