10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
Greetings,
For housekeeping, I use the following command:
find /some/path -type f -name "*log*" ! -exec fuser -s "{}" 2>/dev/null \; -exec ls -lh {} \;
It finds all log files not currently in use by a process and manipulates them.
This command always works on linux and redhat machines,... (2 Replies)
Discussion started by: dampio
2 Replies
2. Shell Programming and Scripting
Following one line of awk code removes first 3 characters from each line but when I run the same code on another linux platform it doesn't work and only prints blank lines for each record. Can anyone please explain why this doesn't work? (31 Replies)
Discussion started by: later_troy
31 Replies
3. Shell Programming and Scripting
Hi, I'm having trouble with a simple copy command in a script on HPUX.
I am trying to copy a file and append date & time.
The echo command prints out what I am expecting..
echo "Backing up $file to $file.$DATE.$FIXNUM" | tee -a $LOGFILE
+ echo 'Backing up... (4 Replies)
Discussion started by: Glennyp
4 Replies
4. Shell Programming and Scripting
Hi ,
In /home/etc/files path ran the following command
find . -name 'ABC*' | wc -l
The output of the above command is 25 as expected
In path /home path ran the following command
find . -name '/home/etc/files/ABC*' | wc -l
The output of the abvoe command is 0 .
Why the above... (3 Replies)
Discussion started by: smile689
3 Replies
5. Shell Programming and Scripting
I have the following files in a directory
> ls -1 /tmp/test/dir/
file with spaces 1.ogg
file with spaces 2.oggI am running the following to echo the filenames but alter the file extension on the files to .mp3 instead of .ogg ( I am going to run ffmpeg against the files ultimately, but keeping... (2 Replies)
Discussion started by: jelloir
2 Replies
6. Shell Programming and Scripting
I was trying to write a simple script which will read a text file and count the number of vowels in the file. My code is given below -
#!/bin/bash
file=$1
v=0
if
then
echo "$0 filename"
exit 1
fi
if
then
echo "$file not a file"
exit 2
fi
while read -n... (14 Replies)
Discussion started by: linux_learner
14 Replies
7. OS X (Apple)
I've been trying to figure this out since last night, and I'm just stumped. The last time I did any shell scripting was 8 years ago on a Unix box, and it was never my strong suit. I'm on a Mac running Leopard now. Here's my dilemma - hopefully someone can point me in the right direction.
I'm... (10 Replies)
Discussion started by: Daniel M. Clark
10 Replies
8. Shell Programming and Scripting
Hi all,
find command not working for me in a perticular directory.The same command is working fine in any other directory.
Following is the command i issued:
find . -type f -print
my question is , is it possbile to disable a command only for a perticular directory ??...of course... (4 Replies)
Discussion started by: panyam
4 Replies
9. Shell Programming and Scripting
Hi,
i wan to search the file starting with Admin into the directory Output. I am running below command:
find /appl/Output -name "Admin*" -prune
but this command is going into the sub directories present under output. I do not want to search under sub directories. Any help will be highly... (6 Replies)
Discussion started by: Vishal123
6 Replies
10. UNIX for Advanced & Expert Users
Hi,
Having issues with the . parameter in the find command.
Issuing "find . -name \*.pl" gives me
find: cannot open .: No such device
I got it working by substituting . with *, so "find * -name \*.pl" gives the correct listing.
bin/test.pl
"which find" lists /bin/find.
Anybody... (7 Replies)
Discussion started by: jabrady
7 Replies