LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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, 01: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, 02:05 AM   #2
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,254

Rep: Reputation: 2686Reputation: 2686Reputation: 2686Reputation: 2686Reputation: 2686Reputation: 2686Reputation: 2686Reputation: 2686Reputation: 2686Reputation: 2686Reputation: 2686
Have a look into 'man find', specifically the -type and -{min|max}depth options
 
Old 07-06-2010, 06: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


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


All times are GMT -5. The time now is 02:28 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration