Issues I'm having with the Find Command


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Issues I'm having with the Find Command
# 8  
Old 05-06-2009
Quote:
Originally Posted by curtner
This is what I'm still having problems with
========================================================================
I wanna display a list of all files in the /tmp directory. Make /tmp making /tmp my current directory
=================================================================
From My home directory, display a list of all of the files in the /tmp directory as well
=====================================================================
What have you tried so far?
Quote:
Originally Posted by curtner
I need to display a list of all of the files under the /etc directory that begin with the letters “ls”
find /etc -name "*ls" alright I'm geting the find command more *NOTE* This works

I need to display a list of all of the files in the /etc directory that begin with the letters “ls” this time giving their long listings
find /etc -name "*ls" -exec ls -l {} \; I Think I know how to do that one now joey Thanks buddy *NOTE* This works
Only that you're searching for files ending in ls, not starting with as you said.
Quote:
Originally Posted by curtner
Below this I need help on just
=========================================================================================
redo 5 but I need it to be this time requiring interactive confirmation to long list each file which has been killing me

there is a switch like the exec switch from the one above that asks for confirmation before it does whatever it does. which I don't know Smilie
==================================================================================================== =======
needing to make a file containing the names of all the files in the /lib/ directory that have names that begin with “u” there should be a simple command
===========================================================
Find all files under the /usr directory that are owned by the userid “uucp”

find / -type f -user uucp this isn't working I need help on this command
Again, what have you tried? What's the error message, if any? What do you get instead of the desired output?

Mind though, I'm not trying to be mean. But from your postings up to now it seems like you're expecting us to do your work. So I'd suggest you reading the man page of find (on the command-line, enter "man find"), and then lets take a look at any questions that still remain.
# 9  
Old 05-06-2009
Update down below

Last edited by curtner; 05-06-2009 at 09:33 PM..
# 10  
Old 05-06-2009
=====================================================================
I need to display a list of all of the files under the /etc directory that begin with the letters “ls”
find /etc -name "*ls" alright I'm geting the find command more *NOTE* This works

I need to display a list of all of the files in the /etc directory that begin with the letters “ls” this time giving their long listings
find /etc -name "*ls" -exec ls -l {} \; I Think I know how to do that one now joey Thanks buddy *NOTE* This works

Below this I need help on just
=========================================================================================
redo it and I need it to be this time requiring interactive confirmation to long list each file


==================================================================================================== =======
needing to make a file containing the names of all the files in the /lib/ directory that have names that begin with “u” there should be a simple command


===========================================================

Note this is all I have left to learn!


I'm out of ideas on these's too I'm Burned out.

Last edited by curtner; 05-06-2009 at 10:03 PM..
# 11  
Old 05-07-2009
Quote:
Originally Posted by curtner
redo it and I need it to be this time requiring interactive confirmation to long list each file
From the man page of find:
Quote:
-ok command ;
Like -exec but ask the user first (on the standard input); if the response does not start with `y' or `Y', do not run the
command, and return false. If the command is run, its standard input is redirected from /dev/null.
Quote:
Originally Posted by curtner
needing to make a file containing the names of all the files in the /lib/ directory that have names that begin with "u" there should be a simple command
Just like your search for files in /etc starting with ls, you only have to add a redirection '>' at the end.
# 12  
Old 05-07-2009
Can you post the version of unix "uname -a". It it very old?

Quote:
Find all files under the /usr directory that are owned by the userid “uucp”
find / -type f -user uucp this isn't working I need help on this command
Assuming the files exist, this command should work in most versions of unix. The trailing "/" in "/usr/" is deliberate in case you have an old SCO unix.

Code:
find /usr/ -follow -type f -user uucp -print

Afterthought: If you are not a root user, you will get error messages searching "/usr".

Last edited by methyl; 05-07-2009 at 09:28 AM.. Reason: Afterthought
# 13  
Old 05-07-2009
Well Thanks I I figured it out late last night!Smilie
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Find command with Ignore Access issues

Hi, I am using following command to find a specific file. find . -name "find*.txt" -type f -print I am issuing that command at root directory since I don't know in which sub folder that file is getting created from some other process. As I am not having access to all directories, my... (3 Replies)
Discussion started by: RameshCh
3 Replies

2. UNIX for Dummies Questions & Answers

Db2 command issues with cron

Hi, I have a very simple script that queries from a DB2 table. The script has 3 parts - (i) Sets the db2profile (ii) connects to db2 using credentials (iii) executes the query.This script works fine if i run it manually from the command prompt. However when scheduled in crontab, it proceeds... (2 Replies)
Discussion started by: VeePee
2 Replies

3. Shell Programming and Scripting

Issues in sed command

I use SMP Tue Aug 18 15:51:48 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux We have a user-defined command called "submit" which will open a vi terminal in which we need to enter the description at 24th line and save it. In order to simplify this, i decided to create another command in which the... (3 Replies)
Discussion started by: pandeesh
3 Replies

4. Shell Programming and Scripting

Issues in grep command in Linux

Hi All I have a file containing following records: $HEW_TGT_DB2_USER=hbme_bi2 $prmAttunityUser=ais $DS_USER=hbme_bi2 $prmStgUser=hbme_bi2 $prmuser=hbme_bi2 $prmStgPass=hbme_bi2 $prmpwd=hbme_bi2 $prmAttunityUser=ais Say suppose the name of the file is test4.txt When i fire this... (5 Replies)
Discussion started by: vee_789
5 Replies

5. Shell Programming and Scripting

Issues with automating SFTP command

Hi All, I am currently looking at automating the steps that I follow to download log files from putty to desktop. I connect to a client's machine through citrix desktop. I am required to download quite a number of application logs to identfiy the issues in production. Steps that is being... (3 Replies)
Discussion started by: krackjack84
3 Replies

6. UNIX for Dummies Questions & Answers

Issues with Makefile (cannot find )

Hello guys ! Need a bit of help is compiling a code, the makefile for which was originally designed to work on a 32-bit Linux platform, for a 64-bit Linux platform. My platform is Ubuntu 10.04 LTS 64-bit. I am trying to compile a code called csim, file name csim-1.1.tar.gz. To compile this... (0 Replies)
Discussion started by: pbhat
0 Replies

7. UNIX for Dummies Questions & Answers

mget command issues

Hi I am trying to get 3 files sitting on a FTP server to an application server. All 3 files are .csv files. I am using mget *.csv and it transfers only 2 files. the 3 files contain a common word in their file names "Report". I tried mget *Report*.csv and that gets me 2 files as well. ... (3 Replies)
Discussion started by: bobsn
3 Replies

8. UNIX for Dummies Questions & Answers

having issues in using Cut Command

Hi, I would like to ask for your help with my problem, im writing a unix script to remove characters before the symbol "/", but the one being removed are characters after the symbol. Ive searched over the internet and found no answer.. hope you can help me with this. sample: text... (2 Replies)
Discussion started by: paoie
2 Replies

9. Shell Programming and Scripting

kill command issues

xxxxxx (8 Replies)
Discussion started by: kitty123
8 Replies

10. UNIX for Dummies Questions & Answers

cal command display issues

I am using AIX version 5.3 I like the cal function because I can print a nice concise view of the calendar for the whole year. I want the calendar to display with 3 months across instead of 2, which is what is happening. My terminal display is set with 67 rows and 140 columns so that should... (0 Replies)
Discussion started by: ruddydaggerwing
0 Replies
Login or Register to Ask a Question