Help! I sux @ Unix
- Nitrofox125
- DBB Admiral
- Posts: 1848
- Joined: Sun Jul 07, 2002 2:01 am
- Location: Colorado Springs, CO, USA
- Contact:
Help! I sux @ Unix
Well actually I have a few different questions here.
1. How do I use wildcards in a delete? I have lines like this say:
VALUES('-1','2','Whee','OMG');
And I want them to end up like this:
VALUES('2','Whee','OMG');
With the -1 gone. However I can't just do a normal find and replace, because the -1 changes with every line. what program can do this and what is the command/way to do this?
The closest i got was in VI
:s/VALUES('*',/VALUES(/g but that didn't work.
2. How to list only directories in unix ls?
What I'm looking for is the unix equivilent to
dir /s /ad /s *
Thanks
1. How do I use wildcards in a delete? I have lines like this say:
VALUES('-1','2','Whee','OMG');
And I want them to end up like this:
VALUES('2','Whee','OMG');
With the -1 gone. However I can't just do a normal find and replace, because the -1 changes with every line. what program can do this and what is the command/way to do this?
The closest i got was in VI
:s/VALUES('*',/VALUES(/g but that didn't work.
2. How to list only directories in unix ls?
What I'm looking for is the unix equivilent to
dir /s /ad /s *
Thanks
- Instig8
- DBB Ace
- Posts: 347
- Joined: Wed Jun 20, 2001 2:01 am
- Location: Orange County, CA, USA
- Contact:
study up on your regular expressions.
and, for god's sake, read the man or info pages.
i don't know much about vi. maybe try
and, i always use (aliased to l) to list directories.
and, for god's sake, read the man or info pages.
i don't know much about vi. maybe try
Code: Select all
:s/VALUES('[*]',/VALUES(/g
Code: Select all
ls -lap
- Nitrofox125
- DBB Admiral
- Posts: 1848
- Joined: Sun Jul 07, 2002 2:01 am
- Location: Colorado Springs, CO, USA
- Contact:
Re: Help! I sux @ Unix
'ls' does not support listing only directories.Nitrofox125 wrote:2. How to list only directories in unix ls?
To show all directories try the following:
find -type d -maxdepth 1
If you are new to *nix, or anything for that matter, www.google.com is your friend.
- Admiral LSD
- DBB Admiral
- Posts: 1240
- Joined: Sun Nov 18, 2001 3:01 am
- Location: Northam, W.A., Australia
- Contact:
http://unix.about.com/library/glossary/ ... tution.htm
It also has the valid wildcard characters defined for *nix.
It also has the valid wildcard characters defined for *nix.
- Nitrofox125
- DBB Admiral
- Posts: 1848
- Joined: Sun Jul 07, 2002 2:01 am
- Location: Colorado Springs, CO, USA
- Contact: