The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



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 !!

More UNIX and Linux Forum Topics You Might Find Helpful
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 10:29 AM
code that reads commands from the standard i/p and executes the commands Phrozen Smoke High Level Programming 4 01-22-2007 02:06 AM
HP UX Terminal Help gpta_varun HP-UX 0 05-11-2005 02:16 PM
like to have fun in terminal collins UNIX for Advanced & Expert Users 4 10-14-2004 05:28 PM
connecting to unix through hyper terminal - as a dumb terminal michelle UNIX for Advanced & Expert Users 2 11-05-2001 03:32 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 12-15-2003
indigoecho indigoecho is offline
Registered User
  
 

Join Date: Dec 2003
Posts: 4
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
  #2 (permalink)  
Old 12-15-2003
jayakhanna jayakhanna is offline
Registered User
  
 

Join Date: Dec 2003
Location: India
Posts: 50
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
Others I need to try

Cheers
JK

added code tags for readability --oombera

Last edited by oombera; 02-19-2004 at 12:27 PM..
  #3 (permalink)  
Old 12-15-2003
jayakhanna jayakhanna is offline
Registered User
  
 

Join Date: Dec 2003
Location: India
Posts: 50
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 (permalink)  
Old 12-15-2003
indigoecho indigoecho is offline
Registered User
  
 

Join Date: Dec 2003
Posts: 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 (permalink)  
Old 12-15-2003
jayakhanna jayakhanna is offline
Registered User
  
 

Join Date: Dec 2003
Location: India
Posts: 50
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

Cheers
  #6 (permalink)  
Old 12-16-2003
jayakhanna jayakhanna is offline
Registered User
  
 

Join Date: Dec 2003
Location: India
Posts: 50
You can use also this, this is much simpler

find / -name filename | wc -l

Regards
JK
Closed Thread

Bookmarks

Tags
linux, linux commands

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 03:54 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0