LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices



Reply
 
Search this Thread
Old 08-19-2003, 03:19 AM   #1
suriyamohan
Member
 
Registered: Mar 2003
Location: Coimbatore
Posts: 50

Rep: Reputation: 15
Thumbs up Doubt in Pattern matching and vi editor..


Hi,

1)How can we list files with filenames starting with "-" ?
2)what happens when "cat xyz > xyz" is given?
3) which file is used to perform start up instructions for vi editor?

With Regards,
S.Suriya Mohan.
 
Old 08-19-2003, 03:29 AM   #2
sandy
Member
 
Registered: Aug 2002
Location: Mumbai,India
Distribution: Linux Mint 12, Gentoo
Posts: 230

Rep: Reputation: 30
Re: Doubt in Pattern matching and vi editor..

Quote:
Originally posted by suriyamohan
Hi,

1)How can we list files with filenames starting with "-" ?
2)what happens when "cat xyz > xyz" is given?
3) which file is used to perform start up instructions for vi editor?

With Regards,
S.Suriya Mohan.
Ans 1. use the option -- with any command to deal with files starting with" -"

Ans.2. it wont let you do that !!!!! If it worked somehow then the filesize will become zero.

Ans 3. Global: /etc/vimrc or depends on your instalation
User specific: $HOME/.vimrc

 
Old 08-19-2003, 06:03 AM   #3
suriyamohan
Member
 
Registered: Mar 2003
Location: Coimbatore
Posts: 50

Original Poster
Rep: Reputation: 15
Thumbs up Pattern Matching

Hi,

How can we list files with filenames starting with "-" ?

I can't able to understand the answer for this question.
Say for example if a directory contains 3 files

anaconda-ks.cfg
vmlinuz-2.4.20
-xyz.log

All these 3 contains "-" at some instance. when I try to list using "ls | grep -", all the 3 files are listed. What I want is to list out only the file "-xyz.log", which contains "-" at the begining. How to use the "ls"
command ?

With Regards,
S.Suriya Mohan.
 
  


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Perl Pattern Matching Question pete1234 Programming 2 08-27-2005 11:26 AM
list files NOT matching a pattern smart_sagittari Linux - Newbie 9 05-20-2005 06:32 AM
Hydrogen has no pattern editor anymore. digorykirke Linux - Software 3 04-05-2005 12:52 AM
Pattern Matching Help in Bash script cmfarley19 Programming 1 04-07-2004 10:22 AM
pattern matching in perl ludeKing Programming 9 04-02-2004 10:53 AM


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