LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
Password
Linux From Scratch This Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.

Notices


Reply
  Search this Thread
Old 06-18-2011, 10:27 AM   #1
randalleg
LQ Newbie
 
Registered: Apr 2011
Posts: 23

Rep: Reputation: 0
Wildcards


From reading I definitely feel like a super-novice to everybody but just as a note to those who may be in my realm (and because I want to try to participate more since everyone has been so helpful her) I wanted to mention that since I started working through blfs I also just learned how to use wilcards in bash and it has changed my life!!!

I'm sure for the sabios here its basic but figuring out that I can type cd lin* instead of the the whole damn line and or rm [bz2] or whatever has been a godsend to somebody like me who spends most of my time buthcering animals not typing!!!!!

Also coming across this one to tar the whole directory.

for i in *.bz2; do tar -jxf $i; done

I'm sure alot of y'all have whole scripts for all this stuff and expecially in blfs they talk you through some which I've modified a little now to help me out in other places but for early new LFS users I wish I would've thought of it then!

Probably a dumd post but its all I got for now and I'm sure many folks can post some other time and keystroke saving hints that become more apparent in blfs but that could really help knowing in starting LFS.

Thanks again!!!!
 
Old 06-18-2011, 01:24 PM   #2
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
When you partially type a filename, pressing Tab will automatically complete it. This is probably a better approach because it can't accidentally expand to two filenames or to an unexpected filename.

Before I found that out I also used wildcards.

Last edited by MTK358; 06-18-2011 at 01:26 PM.
 
Old 06-18-2011, 10:46 PM   #3
randalleg
LQ Newbie
 
Registered: Apr 2011
Posts: 23

Original Poster
Rep: Reputation: 0
Excellent!!! Though i still recomend it if you have multiple files to work with!
 
Old 06-19-2011, 08:09 AM   #4
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
Quote:
Originally Posted by randalleg View Post
Though i still recomend it if you have multiple files to work with!
I didn't say "don't use wildcards", I just meant that they shouldn't be used to avoid typing the full name of a single file, since Tab completion is much better in that case.

Wildcards (actually the proper name for it is "glob") are still very useful to get multiple files matching a pattern. And since I'm talking about globs, I thought I would mention this in case someone doesn't know:

"*" isn't the only glob character. "?" matches and single character, [abc] matches one of "a", "b", or "c", and [^abc] or [!abc] matches any one character that's not "a", "b", or "c".
 
  


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
need help with wildcards yanivmomo Programming 4 05-24-2010 07:37 AM
need help with wildcards liorpana Programming 2 05-12-2010 08:45 AM
wildcards with find tramni1980 Slackware 2 10-03-2009 05:47 AM
using wildcards nadroj Linux - General 5 01-28-2007 08:39 PM
Wildcards dazdaz Linux - Newbie 3 01-23-2005 05:33 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch

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

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