UNIX Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOperating SystemsUNIX Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
A high performance database engine using optimized data access for all development environments including Delphi, Visual Studio .NET, Visual Basic, Visual FoxPro. and more. Learn More
  #1  
Old February 5th, 2003, 12:20 PM
hallian9 hallian9 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Posts: 4 hallian9 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question Help needed in the following commands running in Bourne shell

Hi,
As you can figure out I am pretty new to UNIX and am trying to learn so please help me out. I need some help on the following commands and what they do in Bourne shell only, I tried to figure it myself but no success. So please help what the following commands does.

1. rm ???
2. who | wc -l
3. who | sort
4. cd ; pwd
5. ls -l | sort +4n
6. ps –ef > /dev/null
7. ./prog1 > output 2> /dev/null
8. cat test1 test2 > accounts
9. ls [a-z]*
10. ls f??*s
11. ls *[^0-9]

12. A file named test has ascii data that can be viewed by the cat command.
a) What command would you use to list all the lines in the file that contain the word ‘science’?
b) What command would you use to list all those lines that do not contain word ‘science’?


I'll really appreciate for the help. Thanks
1. Help needed in the following commands running in Bourne shell

Reply With Quote
  #2  
Old February 5th, 2003, 02:42 PM
M.Hirsch M.Hirsch is offline
Contributing User
Dev Shed God 1st Plane (5500 - 5999 posts)
 
Join Date: Oct 2000
Location: Back in the real world.
Posts: 5,969 M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Month 1 Day 22 h 39 m 55 sec
Reputation Power: 184
you better get a good book on this!

1. rm ???
[ delete all files whose name consists of three characters / numbers ]
2. who | wc -l
[ count how many users are logged in ]
3. who | sort
[ show logged in users, sorted alphanumerically ]
4. cd ; pwd
[ change directory to home directory, show directory´s path ]
5. ls -l | sort +4n
[ list all files, sort by 4th column (not 100% on the "column") ]
6. ps –ef > /dev/null
[ list all processes, but don´t show the output ?????? ]
7. ./prog1 > output 2> /dev/null
[ start program "prog1" in the current folder, redirect all screen output to a file "output", discard all error messages AFAIK ONLY THIS ONE IS BOURNE-SYNTAX!]
8. cat test1 test2 > accounts
[ join the content of the files "test1" and "test2" into file "accounts" ]
9. ls [a-z]*
[ list all files that start with a...z ]
10. ls f??*s
[ list all files that start with "f" and end with "s" and have at least two characters in betwen ]
11. ls *[^0-9]
[ list all files that don´t end with a number ]
12. A file named test has ascii data that can be viewed by the cat command.
a) What command would you use to list all the lines in the file that contain the word ‘science’?
[ cat file | grep science ]
b) What command would you use to list all those lines that do not contain word ‘science’?
[ cat file | grep -v science ]

Is this some kind of test or quiz? Did i win the $1,000,000 now?

if you pass a job test or whatever with cheating, you are not worth having this job and will probably be kicked off within a few days... maybe they even won´t pay you at all ... with reason!
if you are a student, quit this course... you´ll break on the next lesson.
if it is for curiosity, "get a beginner´s unix book!" or read your (redhat|SuSE|mandrake|...) manual.

if you make money off this, i hereby request 20%. The (mf-)DCMA grants me this right for my intellectual property. contact me for payment details...
__________________
--
Manuel Hirsch - Linux, FreeBSD, programming, administration articles, tutorials and more.

Reply With Quote
  #3  
Old February 10th, 2003, 08:17 PM
hallian9 hallian9 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Posts: 4 hallian9 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
ls & HELP NEEDED!

hi,
Can anyone please tell me where the output goes when we execute the following command in Bourne shell.

ls &

I tried and shows me the output on the screen or terminal but the prompt doesn't come. Any ideas thanks for the help

Reply With Quote
  #4  
Old February 11th, 2003, 01:31 PM
M.Hirsch M.Hirsch is offline
Contributing User
Dev Shed God 1st Plane (5500 - 5999 posts)
 
Join Date: Oct 2000
Location: Back in the real world.
Posts: 5,969 M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Month 1 Day 22 h 39 m 55 sec
Reputation Power: 184
the output goes where you said - to the screen (or where ever it did before).
Quote:
but the prompt doesn't come

lol.
the prompt will come back when you press enter again...

Reply With Quote
Reply

Viewing: Dev Shed ForumsOperating SystemsUNIX Help > Help needed in the following commands running in Bourne shell


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway