![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Pseudo-terminal will not be allocated because stdin is not a terminal. | Shivdatta | UNIX for Advanced & Expert Users | 1 | 08-04-2008 07:29 AM |
| code that reads commands from the standard i/p and executes the commands | Phrozen Smoke | High Level Programming | 4 | 01-21-2007 11:06 PM |
| HP UX Terminal Help | gpta_varun | HP-UX | 0 | 05-11-2005 11:16 AM |
| like to have fun in terminal | collins | UNIX for Advanced & Expert Users | 4 | 10-14-2004 02:28 PM |
| connecting to unix through hyper terminal - as a dumb terminal | michelle | UNIX for Advanced & Expert Users | 2 | 11-05-2001 12:32 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Terminal Commands
Hi there. Linux newbie and I'm trying to find commands to:
Display number of executable files in a directory that i supply and list them in alphabetical order Back up all the files in the current irectory to a directory i supply, creating that directory if it's not allready there Cound number of occurances of a file name that i provide in the file system. Any help would be really appreciated! Cheers |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
Well to find out whether a file is executable under a directory, I cannot think of any command as such present in unix, I doubt whether there is any. You can use this script to find out the executable file
Code:
#!/bin/sh
for i in `ls -1`
do
if [ -x $i ]
then
echo $i
fi
done
Cheers JK added code tags for readability --oombera Last edited by oombera; 02-19-2004 at 09:27 AM. |
|
#3
|
|||
|
|||
|
For second query
cp -R JUNK JUNK1 JUNK is the existing directory JUNK1 is the non-existing directory, if the directory exists then JUNK will be its sub-directory For third query find ./ filename It will search the whole of the file system and will take lot of time Cheers |
|
#4
|
|||
|
|||
|
That's great thanks very much, but do you know how I would get it to *count* the number of occurances of a filename within the file system, rather than just list the filenames?
Thanks for your help so far, much appreciated. |
|
#5
|
|||
|
|||
|
find ./ filename | grep -x "filename" | wc -l
It would have been better if you had come with this solution rather than me, just try around and play with unix you can find lot more stuffs and you can also learn more |
|
#6
|
|||
|
|||
|
You can use also this, this is much simpler
find / -name filename | wc -l Regards JK |
|||
| Google The UNIX and Linux Forums |
| Tags |
| linux |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|