hi
I used find command to find some file names as per input from user. I used it for current directory. It was working fine. Now I tried with giving some other directory path. Its giving issues.
Here what I tried. Script will take input from user say 1_abc.txt, find the file and print list. if files are not there it will print No Files with this name message.
Finding files in the current Directory.
Then I tried with some different path, as:
Now what is the problem with above code.
1. Its printing files names with fullpath i.e., /backup/test1/LogFiles/1_abc.txt
This is not required. I need to print only file names.
2. The if statement is always in execution. Its always printing the "No Files with this name" statement.
Simply its not working. I tried to use find with -P -H options but not of use.
Urgent help is needed.
Please help me to make it work.
Thanks,
Hi,
In my current directory, i have the following files:
x1.dat
x2.dat.gz
x3.dat
I want to use the find command and display only files which has *.dat and NOT *.gz extension files.
Please help me out.
Thanks,
Kris Kart. (2 Replies)
find / * -print > /var/tmp/updatedfilelist.txt 2>&1
i need to run the above file in cron. problem is, this process takes a long long long time to finish up. and even worse, it fills up the directory the output file is located in.
i dont want the /var directory to ge filled up because of... (10 Replies)
eg: If I execute an example tail statement to put rows from one file to another, it truncates some of the data.
/carrier>wc -l IntIndA.txt
1918 IntIndA.txt
/carrier>tail -1918 IntIndA.txt > test
/carrier>wc -l test
132 test
The tail command should copy 1918 rows to test file instead of... (4 Replies)
Hi All,
I am using following find command to delete the records older than 7 days but getting missing conjuction error.Kindly suggest:
The command is:
find <complete_dir_path> \(! -name usr -prune \) -type f -name "*.txt" -mtime +6 -print | xargs rm (11 Replies)
Hi,
I am triying to make sure that there exists only one file with the pattern abc* in path /path/. This directory is having many huge files. If there is only one file then I have to take its complete name only to use furter in my script.
I am planning to do like this:
if ; then... (2 Replies)
im a beginner in shell scripting and i need a script which will find a file in a given path without the use of find or grep command.......i need some kind of code.....plzzz plzzzz help me......ive tried n searched every where but i couldn't find the solution for my particular problem..... (4 Replies)
Hi,
I have a script below,which reads dates from No_weekandMonthend_dates.txt performs the copy operation.
for i in `cat /tmp/No_weekandMonthend_dates.txt`
do
cd $Gerenimopath/ZH_LP
find . -type f -name "$i_*.txt" -exec cp {} /home/gaddamja/TempLocal \;
cd... (2 Replies)
I am facing problem in find command. I want to read all file names of a directory and write those names in a text file. My script is
find /home/Pratik/src -type f -exec basename {} \; >> names.txt
The script is working fine and writing all the file names but problem is file names are not... (5 Replies)
I was trying to move a file to a particular directory. In a hurry i forgot to give the dest directory, as below
mv prod.log
The file disappeared. :confused:
Any idea where it might have moved???
And I have tried moving files based on date from one directory to another as below.... (1 Reply)
Hi All,
I want to search only files more than 60 min in particular directory but not in sub directories.
with this command i am getting even sub directires also.Please and let me know how to get the files.
$i=`find /home/n1013141/vijay -type f -mmin -60`;
print $i;
... (6 Replies)
Discussion started by: bhas1285
6 Replies
LEARN ABOUT X11R4
on
on(1) User Commands on(1)NAME
on - execute a command on a remote system with the local environment
SYNOPSIS
on [-i] [-d] [-n] host command [argument] ...
DESCRIPTION
The on program is used to execute commands on another system, in an environment similar to that invoking the program. All environment vari-
ables are passed and the current working directory is preserved. To preserve the working directory, the working file system must be either
already mounted on the host or be exported to it. Relative path names will only work if they are within the current file system. Absolute
path names may cause problems.
The standard input is connected to the standard input of the remote command. The standard output and the standard error from the remote
command are sent to the corresponding files for the on command.
OPTIONS
The following options are supported:
-d Debug mode. Prints out some messages as work is being done.
-i Interactive mode. Uses remote echoing and special character processing. This option is needed for programs that expect to be talk-
ing to a terminal. All terminal modes and window size changes are propagated.
-n No Input. This option causes the remote program to get EOF when it reads from the standard input, instead of passing the standard
input from the standard input of the on program. For example, -n is necessary when running commands in the background with job
control.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWnfscu |
+-----------------------------+-----------------------------+
SEE ALSO chkey(1), rlogin(1), rsh(1), telnet(1), attributes(5)DIAGNOSTICS
unknown host
Host name not found.
cannot connect to server
Host down or not running the server.
can't find
Problem finding the working directory.
can't locate mount point
Problem finding current file system.
RPC: Authentication error
The server requires DES authentication and you do not have a secret key registered with keyserv. Perhaps you logged in without a pass-
word. Try to keylogin. If that fails, try to set your publickey with chkey.
on server: RPC: can't encode arguments
The 10240 byte limit for arguments to be encoded and passed from the sending to the receiving system has been exceeded.
Other diagnostic messages may be passed back from the server.
BUGS
When the working directory is remote mounted over NFS, a Control-Z hangs the window.
Root cannot use on.
SunOS 5.10 8 Oct 2003 on(1)