LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-16-2012, 01:35 PM   #1
dynomite1988
LQ Newbie
 
Registered: Dec 2010
Posts: 4

Rep: Reputation: 0
What does this command do?


Hi there,
I am taking a beginners Linux course and we are using Red Hat version 9 (Shrike). During our last test the professor asked us what this command would do and I was a little stumped on it. Could somebody please tell me in detail what this following command would do?

Trap "rm ~/tmp* 2> /dev/null; exit" 0 1 2 3

If anybody knows where I can learn more about these command could you please tell me? That would be greatly appreciated.
Thank you
 
Old 08-16-2012, 01:49 PM   #2
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
Open a terminal and go thru these steps:

man trap
man rm
man exit

Also, look up "redirection"---Google will find it, or you can read about it here:
http://www.tldp.org/LDP/abs/abs-guide.pdf
 
Old 08-16-2012, 02:23 PM   #3
Celyr
Member
 
Registered: Mar 2012
Location: Italy
Distribution: Slackware+Debian
Posts: 321

Rep: Reputation: 81
Quote:
Originally Posted by dynomite1988 View Post
Hi there,
I am taking a beginners Linux course and we are using Red Hat version 9 (Shrike). During our last test the professor asked us what this command would do and I was a little stumped on it. Could somebody please tell me in detail what this following command would do?

Trap "rm ~/tmp* 2> /dev/null; exit" 0 1 2 3

If anybody knows where I can learn more about these command could you please tell me? That would be greatly appreciated.
Thank you
Be case sensitive .
It does:
$ rm ~/tmp* 2> /dev/null
$ exit
When the shell receives either signal 0 1 2 3, tell your teacher that using signal name instead of numbers is a good idea.
 
Old 08-16-2012, 09:51 PM   #4
suttiwit
Member
 
Registered: Aug 2012
Location: Chiang Mai, Thailand
Distribution: Kubuntu 12.10 x86_64
Posts: 192
Blog Entries: 2

Rep: Reputation: 23
Linux command-line is case-sensitive so case matters. (Rm = Invalid, rm = valid.)
You can look in the man page and if you need any other help about it feel free to contact me.
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Command/Script required to send an email alert in case command will not respond rajaniyer123 Linux - General 1 05-19-2012 01:12 PM
Executing shell command from JSP file with command line arg from URL orcusomega Programming 2 01-13-2012 03:38 PM
Bash Command Line Editor, while typing run another command before executing current? gumaheru Linux - General 5 04-13-2010 11:21 AM
how to copy drive using dd and tee command parallely? source code of dd command mdfakkeer Linux - Software 1 02-10-2010 01:31 PM
URGENT! Is there any command to get a history command lines and time in SUSE Linux.? igsoper Linux - Software 5 06-25-2009 02:14 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:27 AM.

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
Open Source Consulting | Domain Registration