Solved

a sed script

Posted on 2011-03-23
4
344 Views
Last Modified: 2012-05-11
Need a script.
Make a list of files in /usr/bin that have the letter "a" as the second character. Put the result in a temporary file.
0
Comment
Question by:zhshqzyc
  • 2
4 Comments
 
LVL 40

Accepted Solution

by:
omarfarid earned 25 total points
ID: 35201033
try

ls /usr/bin/?a* > /tmp/myfile
0
 

Author Comment

by:zhshqzyc
ID: 35201083
Can we use sed?
0
 
LVL 8

Expert Comment

by:point_pleasant
ID: 35201415
ls | sed -n '/^.[a|A].*$/p'
0
 
LVL 8

Assisted Solution

by:point_pleasant
point_pleasant earned 25 total points
ID: 35201428
sorry forgot redirect

 ls /usr/bin | sed -n '/^.[a|A].*$/p' >/tmp/filetmp
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Background Still having to process all these year-end "csv" files received from all these sources (including Government entities), sometimes we have the need to examine the contents due to data error, etc... As a "Unix" shop, our only readily …
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now