LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-06-2010, 12:21 AM   #1
dukedog
LQ Newbie
 
Registered: Jun 2010
Posts: 6

Rep: Reputation: 0
removing subdirectorys and only working with files (Bash Cookbook 5.8)


The Cookbook gives us

for FN in $*
do
echo changing %FN
chmod 0750
done

but that changes all. how can I change all files but subdirectorys? I was thinking of something like
ls -l | grep -v ^d but can't get it to work. I'm still learning about variables and how to use them. thanks in advance for your Patients.
 
Old 07-06-2010, 01:05 AM   #2
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 10,006

Rep: Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191
Have a look into 'man find', specifically the -type and -{min|max}depth options
 
Old 07-06-2010, 05:57 PM   #3
dukedog
LQ Newbie
 
Registered: Jun 2010
Posts: 6

Original Poster
Rep: Reputation: 0
Still a little confused but I'll mark as solved. I'll try and mash it out.
Thanks
 
  


Reply



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
Removing program diretories and files with a bash script wimnat Linux - Software 1 05-25-2009 08:55 PM
bash script to rename files removing one character Byenary Linux - Newbie 2 04-08-2008 10:12 AM
LXer: Book review: bash Cookbook LXer Syndicated Linux News 0 08-18-2007 10:50 AM
LXer: Review: bash Cookbook LXer Syndicated Linux News 0 08-04-2007 12:16 AM
LXer: Bash cookbook offers example scripts LXer Syndicated Linux News 0 06-03-2007 11:16 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:58 AM.

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