View the Most Wanted LQ Wiki articles.
Go Back > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Red Hat This forum is for the discussion of Red Hat Linux.


  Search this Thread
Old 02-18-2007, 12:31 PM   #1
LQ Newbie
Registered: Dec 2006
Location: chennai, India
Distribution: redhat & mandriva
Posts: 17

Rep: Reputation: 0
listing subdirectories files

I want to list the files in currect directory and subdirectories. What option used in ls command ?

What option is used to copy a files with prompt option ( copy or reject ) ?
Old 02-18-2007, 12:43 PM   #2
LQ Guru
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 74
If you need to find out how to use commands and what their switches do, read their manual pages e.g "man ls". To recursively list directories and their subdirectories, do
$ls -lR /some/dir
As for copying without prompting, you may have to tinker with the alias for cp thats probably set in your ~/.bashrc or /etc/bashrc.
Old 02-18-2007, 02:46 PM   #3
Registered: Oct 2003
Location: Ohio
Distribution: Fedora 20, 21, RHL 5.2
Posts: 546

Rep: Reputation: 43
cp -i will prompt you only if there is another file with the same name present in the location you are copying to. AFAIK if you want to prompt for each file being copied you would need to write a short script. A for loop with printf, read, an if statement and cp should do the trick.



Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
extract files from subdirectories to another dir hamboy Linux - Newbie 1 09-15-2006 10:00 AM
ls question: how to avoid listing contents of subdirectories learnfast Linux - Newbie 2 03-09-2005 09:59 AM
Unzipping all .gz files in all subdirectories darin3200 Linux - General 10 04-24-2004 10:58 PM
delete files / keep subdirectories? lhorstman Linux - Newbie 2 01-10-2003 04:01 PM
Script For Moving Files In Subdirectories darkmage Linux - General 3 12-17-2002 07:34 PM

All times are GMT -5. The time now is 05:35 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration