LinuxQuestions.org
Help answer threads with 0 replies.
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 08-10-2017, 09:06 AM   #1
sigint-ninja
Member
 
Registered: Feb 2011
Location: Republic Of Ireland
Distribution: Debian,Centos,Slackware
Posts: 508

Rep: Reputation: 29
globbing question


am i right in saying thay

ls host* - shows all results with host and after it such as
hostname hostfile1 hostmaster1 etc

ls *host* - shows files with host and directories in the name?
filehosting1 thehost1 iamhostat1

thanks
 
Old 08-10-2017, 09:29 AM   #2
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,536
Blog Entries: 4

Rep: Reputation: 3832Reputation: 3832Reputation: 3832Reputation: 3832Reputation: 3832Reputation: 3832Reputation: 3832Reputation: 3832Reputation: 3832Reputation: 3832Reputation: 3832
Yes. You can read more in the manual page for glob(7)

Code:
man 7 glob
Or try some experiments in the shell.

Keep in mind that globbing is different than regular expressions (regex)

update your computer before it's too late.
 
Old 08-12-2017, 01:59 AM   #3
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
the '*' represents 'zero or more occurences of any character'.
so e.g. the string 'host' would fit both examples.
 
  


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
[SOLVED] Globbing in ls... mangya Linux - Newbie 13 01-08-2016 04:18 PM
Bash Extended Globbing question mescu Linux - General 10 07-21-2015 09:58 AM
Globbing Lindner79 Linux - Newbie 2 09-17-2013 09:49 PM
[SOLVED] globbing in a script frrobert Programming 3 01-14-2011 03:27 PM
File Globbing BlaqkStarSunday Linux - Newbie 5 09-13-2010 06:35 PM

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

All times are GMT -5. The time now is 12:01 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