Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 04-20-2004, 07:40 PM   #1
Registered: Jul 2003
Distribution: redhat 8.0, 9.0, FC3
Posts: 32

Rep: Reputation: 15
complex command lines in bash?

Can you do complex commands in bash from the command line without scripting in a file. What Iím think of is : say a for loop that takes all the files in a directory and changes the mode on them.
Enter at the command line prompt
For <all the files>
Chmod 644 file
<tell bash to excute the above.
I saw some hint of this on a site; but was unable to enough details to find out what to call the process or how to do it. The howto's tell you how to do it in a script file but not at the command prompt. Thank you.
Old 04-20-2004, 07:43 PM   #2
Registered: Jan 2002
Location: Missoula. Montana, USA
Distribution: Slackware (various)
Posts: 457

Rep: Reputation: 41
As follows:

$ for x in *;do chmod 644 $x; done

Note that chmod is not Chmod, but chmod.


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
How to grep similar lines in bash? bruno buys Linux - Software 2 12-03-2005 12:56 AM
bash: read lines from a configuration script ldp Programming 2 09-23-2005 12:58 PM
bash does not wrap long lines correctly monkeyman2000 Linux - General 8 09-08-2004 10:30 PM
Can't get lines of a file with a Bash script.. barisdemiray Programming 2 08-11-2004 01:42 PM
[bash] remove lines from a file Drimo Programming 3 03-20-2004 12:16 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:17 AM.

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