[x] Welcome to LinuxSolved.com Linux help forums, here we are a community of Linux users helping each other. It is helpful to both ie. new linux users as well experienced one. We always have our experts to help you and ofcourse members help each other, so you can ask for help any time by Registering.: Click to Register

Welcome, Guest. Please login or register.
Did you miss your activation email?


Login with username, password and session length

Linux Forums - Linux Help,Advice & support community:LinuxSolved.com  |  Forum  |  Others  |  Miscellaneous  |  Topic: Difference In Command
Welcome to LinuxCommunity

You have just arrived to a friendly linux community which is helping Linux Users from Years.. You can be its part if you have not already joined it. Registration is FREE and is gateway to unlimited help and support to all your linux related needs. If you are an GNU/Linux supporter then you have come to the right place.
Pages: [1]
  Print  
Author Topic: Difference In Command  (Read 864 times)
0 Members and 1 Guest are viewing this topic.
rajesh.bahl
Linux Learner
***
Offline Offline

Posts: 77


View Profile
« on: November 13, 2007, 01:35:58 PM »


Hi Guys!

Need your views on this :-

If I run the command:

find / -name  foo* -print

on my system, I get a big listing of 121 files.

Again if I run :

find / -name foo\* -print

I get the same listing of 121 files.


What exactly is the difference between these two commands ? Under what scnerio each one is used ?
If possible quote some examples in your explanations !

regards
rajesh.bahl
Logged
Ricky
LST CareTaker
Specially Skilled
*****
Offline Offline

Gender: Male
Posts: 2377


View Profile
« Reply #1 on: November 14, 2007, 04:22:25 PM »

Both commands are same ie. will give same output, both will list files whose name starts with "foo"

The difference is that in foo\* is acting as escape character as we do in programming, some shell need this to specifically specify and some do not hence both are working.
Logged
dragoncity99
LST CareTaker
Experienced
*****
Offline Offline

Gender: Male
Posts: 529


View Profile
« Reply #2 on: December 14, 2007, 09:59:35 PM »

FYI

[root@rhel4 /]# find /root -name foo*
/root/foo2
/root/foo1
/root/foo*
[root@rhel4 /]#
[root@rhel4 /]#
[root@rhel4 /]# find /root -name foo\*
/root/foo2
/root/foo1
/root/foo*
[root@rhel4 /]#
[root@rhel4 /]#
[root@rhel4 /]# find /root -name "foo\*"
/root/foo*
[root@rhel4 /]#
Logged
Ricky
LST CareTaker
Specially Skilled
*****
Offline Offline

Gender: Male
Posts: 2377


View Profile
« Reply #3 on: December 18, 2007, 01:53:10 AM »

That is clear Smiley
Logged
Pages: [1]
  Print  
 
Jump to:  

Related Topics
Subject Started by Replies Views Last post
Difference Between RHL and RHEL Os Talk mysaeed 5 3063 Last post August 23, 2008, 04:18:27 AM
by Sahil
difference between ext2 and ext3 Miscellaneous Arora 1 1568 Last post January 14, 2005, 05:27:22 AM
by Ricky
difference between active & passive ftp i Linux Servers Support gauravbajaj 2 892 Last post January 27, 2005, 11:05:30 PM
by gauravbajaj
Difference between pcqlinux and RHEL Linux Kernel sreeni19 1 771 Last post March 15, 2007, 01:43:11 PM
by Ricky
Difference betwwen RHEL 3.0. , $.0 and 5.0 Os Talk Sahil 2 660 Last post January 06, 2009, 11:27:33 AM
by unixmen
Search LS
Welcome, Guest. Please login or register.
Did you miss your activation email?
July 29, 2010, 10:17:17 AM

Login with username, password and session length
Navigation
Recent Discussions
[July 24, 2010, 11:46:22 PM]

[July 24, 2010, 04:10:46 PM]

[July 23, 2010, 07:22:27 AM]

[July 23, 2010, 07:20:53 AM]

[July 23, 2010, 07:19:15 AM]

[July 23, 2010, 07:15:30 AM]

[July 23, 2010, 07:08:21 AM]

[July 19, 2010, 11:01:10 PM]

[July 19, 2010, 10:01:58 AM]

[July 19, 2010, 01:21:00 AM]
Members
Total Members: 7690
Latest: BOZZYPRINCESS
Stats
Total Posts: 9524
Total Topics: 2729
Online Today: 7
Online Ever: 128
(April 10, 2010, 10:24:17 PM)
Users Online
Users: 0
Guests: 11
Total: 11
Privacy Policy| Powered by SMF 1.1.7 | SMF © 2006-2008, Simple Machines LLC Theme & TinyPortal v0.9.8 © Bloc