LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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

Closed Thread
 
Search this Thread
Old 08-27-2005, 04:33 PM   #1
PDASquare
LQ Newbie
 
Registered: Nov 2003
Distribution: Mandrake 9.2
Posts: 16

Rep: Reputation: 0
Anyone know the answers to these command-line questions?


If anyone can help with any of the following questions, it'll be MUCH appreciated.

1) Write the complete "find" command to display the files from within the directory tree
"/usr/local/bin", which have “write” file permissions for the user and are not owned by user
“root”.

2) Write the chmod command to set the protection bits of the directory /root, so that the owner has read and execute permissions; group users only have read permission; and all other users only have execute permissions.

3) Write the full “tar” command to display the what files are in the compressed tar archive “var.bz2” which contains all the files in the directory tree /var/lib, without extracting the files.

4) Write the complete “find” command to display all file names in the “/usr” directory tree that
start with the sequence “redhat” and have a size larger than 20k bytes.

5) Using the nmap command, write a script (/usr/local/bin/log-nmap) to log which systems are
running a service on port 80. Append the output to /var/log/nmap_log. The script should
append to the log file every minute.

6) For SAMBA software, write the lines required in the configuration file "smb.conf" to create a netbios section name “doc”, which shares directory "/usr/share/doc" to only allow hosts access from subnet 192.168.0.0/16 and only allow users to have read access.

7) Write the sequence of commands to create a SWAP file of 128MBs in size and then use the SWAP file.

8) Which TCP port number does Microsoft’s Windows Internet Name Service use?

9) Write the sequence of commands to add a generic printer and share it on the local network.

10) Write the sed command to add the hash character “#” to the beginning of every line of the configuration file ntp.conf.

11) Write the complete “rpm” command to find what package provides the installed file “/usr/lib/libc.a”.
 
Old 08-27-2005, 05:00 PM   #2
makuyl
Senior Member
 
Registered: Dec 2004
Location: Helsinki
Distribution: Debian Sid
Posts: 1,107

Rep: Reputation: 53
School assignment? Does look like it doesn't it. I take it the purpose is that you actually complete the assignment yourself, but watch out, you might learn something while doing it
 
Old 08-27-2005, 05:14 PM   #3
PDASquare
LQ Newbie
 
Registered: Nov 2003
Distribution: Mandrake 9.2
Posts: 16

Original Poster
Rep: Reputation: 0
Not really a school assignment. It's a sample exam and I'm looking for answers to verify my attempts at answering them.

So far I've got these:

Q1) Find /usr/local/bin –perm +200 –uid 1
Q2) Chmod 541 /root
Q3) Tar –t var.bz2
Q4) Find /usr –regex ‘./redhat*’ +size 20000k -print
Q7) dd if=/dev/zero of=/extra-swap bs=128
Q10) Sed 's/^/#/' ntp.conf
Q11) rpm –q –scripts /usr/lib/libc.a

Last edited by PDASquare; 08-27-2005 at 06:09 PM.
 
Old 08-27-2005, 06:08 PM   #4
jailbait
Guru
 
Registered: Feb 2003
Location: Blue Ridge Mountain
Distribution: Debian Wheezy, Debian Jessie
Posts: 7,509

Rep: Reputation: 176Reputation: 176
"It's a sample exam and I'm looking for answers to verify my attempts at answering them."

You have an infallible way to verify the answers. Run your answers on your Linux box. See what happens.

----------------------------
Steve Stites
 
Old 08-27-2005, 06:42 PM   #5
Charred
Member
 
Registered: Mar 2005
Location: Utah, USA
Distribution: Slackware 11
Posts: 816
Blog Entries: 2

Rep: Reputation: 30
http://www.slackbook.org/
 
Old 08-27-2005, 06:45 PM   #6
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,974
Blog Entries: 11

Rep: Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879
Quote:
Originally posted by PDASquare
Not really a school assignment. It's a sample exam and I'm looking for answers to verify my attempts at answering them.

So far I've got these:

Q1) Find /usr/local/bin –perm +200 –uid 1
Q2) Chmod 541 /root
Q3) Tar –t var.bz2
Q4) Find /usr –regex ‘./redhat*’ +size 20000k -print
Q7) dd if=/dev/zero of=/extra-swap bs=128
Q10) Sed 's/^/#/' ntp.conf
Q11) rpm –q –scripts /usr/lib/libc.a
1,3 and 11 are wrong, 7 is incomplete.
And that's without running any of them ;)


Cheers,
Tink
 
Old 08-27-2005, 06:57 PM   #7
homey
Senior Member
 
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 56
One other thing, commands are case sensative. So Find , Tar , Chmod and Sed aren't going to work. I don't know how fussy your teach is but you might get them wrong just for that.
 
Old 08-27-2005, 08:14 PM   #8
trickykid
Guru
 
Registered: Jan 2001
Posts: 24,133

Rep: Reputation: 197Reputation: 197
Oh man.. I had the answer to all of these in my head ready to post but right when I clicked Reply, I totally forgot them.. guess you'll have to actually look them up yourself and learn something in the process.

If your taking a practice exam, I'm guessing your taking such practice exams for an upcoming real exam. Not like you can ask your neighbor or look up the answers online to help answer the questions..
 
Old 08-28-2005, 02:50 AM   #9
PDASquare
LQ Newbie
 
Registered: Nov 2003
Distribution: Mandrake 9.2
Posts: 16

Original Poster
Rep: Reputation: 0
arrghh ... I'm running out of time.

Can anyone help me with the questions?
 
Old 08-28-2005, 03:00 AM   #10
Charred
Member
 
Registered: Mar 2005
Location: Utah, USA
Distribution: Slackware 11
Posts: 816
Blog Entries: 2

Rep: Reputation: 30
Lack of forethought on your part does not constitute an emergency on mine.

I repeat: http://www.slackbook.org
Google is also your friend.
 
Old 08-28-2005, 05:13 AM   #11
cs-cam
Senior Member
 
Registered: May 2004
Location: Australia
Distribution: Gentoo
Posts: 3,544
Blog Entries: 4

Rep: Reputation: 56
We aren't your tutors. At school, I found the teachers to be more than helpful. If you aren't full of shit and this is an example/practice test, take your attempt to your teacher and ask them if you're on the right track.
 
Old 08-28-2005, 08:37 AM   #12
trickykid
Guru
 
Registered: Jan 2001
Posts: 24,133

Rep: Reputation: 197Reputation: 197
I'm closing this. Apparently the thread starter did not understand the many hints provided that this site will not directly give you answers to homework, quizzes, tests, etc.

And we don't need every member replying stating the obvious of what's already intended.
 
  


Closed Thread


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
Anyone know the answers to these command-line questions? PDASquare Linux - Software 2 08-27-2005 04:52 PM
I have some questions about the command line again. darren200184 Linux - Newbie 3 02-15-2005 08:13 AM
Some questions in the command line. darren200184 Linux - Newbie 2 02-13-2005 08:40 PM
newbie questions about the command line sether *BSD 12 09-04-2004 01:40 PM
Command Line Questions Chryzmo Linux - Newbie 5 02-04-2004 08:36 PM


All times are GMT -5. The time now is 09:39 AM.

Main Menu
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