LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
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 07-31-2005, 01:55 PM   #1
ricki
Newbie
 
Registered: Jul 2005
Posts: 4

Rep: Reputation: 0
Lightbulb Urgent Questions


1(a) Write a shell command to echo the names of all the files/directories that start with a capital letter in the current directory. 2
1(b) Write shell commands to print (i) names of five biggest files and (ii) names of five files that were most recently modified, in the given directory. You should also consider subdirectories. 3
1(c) Modify /etc/profile to get a special greeting message when you connect to your system as root. (Note that this question involves making changes in a file and not a command to be executed). 2
1(d) Write a single command to play all the songs of a particular singer, say "Kishore" in your music collection using totem, xmms, or mplayer. Assume that you have a music collection with each song file having the format - "<song title>-<singer>.mp3". If you do not have a collection of songs create a small collection of your own for testing the command. Note: Music collection can be a nested hierarchy of directories with each of the subdirectory containing some or no song files. 2
1(e) Write a shell command to declare a variable MYVAR that contains the list of all the text files in the given directory and its subdirectories separated by ":". Assume that the input directory name contains only the alphabets or digits and file names inside it may contain all characters except ":". Enclose file names within double quotes and append a "." in the end. For eg.
Consider the following hierarchy:

/home
|---user
|--d1
|-----d2
| |------f1.txt
|------f1.txt
|------f2 34.txt
|------f3.html

The value of variable MYVAR should be -

"/home/user/d1":"/home/user/d1/f1.txt":"/home/user/d1/f2 34.txt":"/home/user/d1/d2":"/home/user/d2/f1.txt":.

Note: these kind of commands are useful in setting classpath kind of variables. 3
1(f) Write a single shell command to display the following output on the konsole.

1 1 1
2 4 8
3 9 27
4 16 64
...
...
...
...
10 100 1000

3


2. Write a shell script to list all files/directories in a given directory as a tree. The output should be an HTML page which displays the contents of the given directory as a hierarchy. For eg. A typical Hierarchy in the text mode can be shown as

inputdir
|
|--dir1
| |--file1.txt
| |--file2.txt
| |--dir11
| |--file3.txt
|--dir2
|--dummy1.pdf
|--file3.txt

Display directories with blue color, and all .txt files with red color. Use any other color for other files. Note: In HTML you can use HTML tags to create the hierarchy or a tree like structure. 5


3. Write a shell script for a menu driven task scheduler. The task scheduler must provide the following tasks on menu.

1. Add new task entries which should be in the form 'date:job:user:email-id'. You are free to use your own format. The four fields date, job, user, and email-id are mandatory. Job is a text description of the task.
2. Display all tasks scheduled for a particular day (date).
3. Display all tasks scheduled for a user.
4. Delete a particular task.

A mail must be sent to remind the user about the tasks for the day at midnight on that day. For.eg. on 29th July a minute after 23:59 a mail must be sent to the user reminding his tasks for 30th July. After sending the mail, its corresponding entry must be deleted. 10


4(a) Implement the following commands

1. pkill
2. du -a (not for credit)
3. zgrep without using any other z command (command starting with character 'z') .

3
4(b) You are given a directory hierarchy. For all the .txt files in the directory and its subdirectories, you need to find how many words are there of n characters where n varies from 1 to 10. Give the output as a frequency table in decreasing order of frequency.

d1
|---d2
| |----file1.txt
|---file2.txt

file1.txt
=========
This is flab assignment_1

file2.txt
=========
Deadline is 5th august


The output should be a file whose contents are

2 2
4 2
3 1
6 1
8 1
1 0
5 0
7 0
9 0
10 0



6
5. We are providing you an access log of a web server. Use this file to generate the following information. Assume that the format is [ipaddress/domain name] [date] [request] [http status] followed by some other details. Get the acces log from here.
5(a) Write a command/script to find the most frequently visited webpage by a given IP Address. If no page is visited by the given IP Address the result must be 0. Ignore parameters of the request and the protocol information. For. eg. a request "GET /news/index.php?id=2 HTTP 1.0" should be treated as a request to the webpage "/activities/news/index.php". 3
5(b) Write a script/command to find all the IP addresses or the domain names from where the web pages on the site have been accessed. Arrange them in decresing order of the number of pages accessed by them.
 
Old 07-31-2005, 05:05 PM   #2
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
1. Don't post threads in more than one forum.
2. Don't use "urgent" in thread titles.
3. Don't expect people to do work for you.
 
Old 07-31-2005, 05:22 PM   #3
trickykid
Guru
 
Registered: Jan 2001
Posts: 24,133

Rep: Reputation: 199Reputation: 199
First, read our rules you agreed to when registering: http://www.linuxquestions.org/rules.php
Secondly, read this thread as it has all your answers: http://www.linuxquestions.org/questi...hreadid=103564

This thread now closed for being a cross post and placing "urgent" in the title.
 
  


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
Urgent Question Regarding Urgent Questions! Need Help Now! Crashed_Again LQ Suggestions & Feedback 11 10-17-2007 09:07 PM
Linux super noob questions(very urgent) lolz Fedora 19 10-23-2005 10:39 PM
help me out to the three questions plz? its urgent lexersrp Linux - General 2 01-22-2005 02:28 AM
mplayer questions--urgent taoweijia Linux - Software 2 10-08-2003 10:23 PM
Many questions that need an urgent answer! squall14716 Linux - General 7 10-03-2003 05:52 PM


All times are GMT -5. The time now is 12:21 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration