LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 04-19-2004, 01:47 AM   #1
Greg_courageous
LQ Newbie
 
Registered: Apr 2004
Posts: 13

Rep: Reputation: 0
a few questions about files


Hello all,

I’m a uni student and I’ve just got into linux, I have come across a few things that I need to know how to do, for assignments and such, just wondering if anyone can help me!

I need to know…

The combination of commands to list out (long format) all the files in the directory /usr/bin which contained the word bin, I need to sort the final output according to key field filesize, i.e. column no 5. Save the results into "binsize". All commands should be constructed using pipes ( | ) and should not be more than one execution statement.

Write down the combination of commands you use to list out (long format)
all the files in directory /usr/bin and cut out columns size, date, time and
filename. Sort them according to filesize (in numeric) then redirect the output to
a file with the name “binsizefile”. All commands should be constructed using
pipes ( | ) and should not be more than one execution statement.

Write down the combination of commands you will use to display, page by
page, all the lines within directory /usr/bin that contain the word Dec.

Write down the combination of commands you will use to display, page by
page, all the lines within directory /usr/bin that starts with the character l
(lower-case l).

Write down the combination of commands you will use to redirect the long
format output of (ls) of the directory /usr into a file with the name usr-file.

Use the grep command to search and display all lines containing Jan in
"stufile".

Use the sort command to sort the "stufile" according to the numeric value of
key field filesize, i.e., column no. 5.

Use the long format of the ls command and the grep command to list out all the
files and directories in "/student" (a directory) which contained the word stud.

Use the ls command, sort command and grep command to list out all the files
and directories in "/usr/bin" (a directory) which contained the word root. The
final output should be ordered according to filesize, i.e., column no. 5. Save the
results into "rootsize". Who is root in a Unix environment?

Use the grep command to search for all the lines containing the word post from
"totalfile" and sort the output into alphabetical order. Save the result into
"postsorted".


If anyone can help me out with these it would be much appreciated, even if it is only for one or 2 questions, anything is better than nothing!

Thanks in adavance!
 
Old 04-19-2004, 02:26 AM   #2
hw-tph
Senior Member
 
Registered: Sep 2003
Location: Sweden
Distribution: Debian
Posts: 3,032

Rep: Reputation: 58
According to the rules, we don't do people's homework. Get started and when you hit a real problem that you can't bypass no matter how much you Google for the solution, we're here to (try to) help.


Håkan
 
Old 04-19-2004, 02:54 AM   #3
Greg_courageous
LQ Newbie
 
Registered: Apr 2004
Posts: 13

Original Poster
Rep: Reputation: 0
Fair enough, do you have any ideas about where i should look?

Thanks in advance!
 
Old 04-19-2004, 08:51 AM   #4
gutman007
LQ Newbie
 
Registered: Apr 2004
Posts: 4

Rep: Reputation: 0
Here is a place to start.

http://www.scorpioncity.com/linux.html#ch2

This explains some basic commands and piping.

...also try using the man pages of various commands. They tell you what to do, and explain what all of the different flags mean.

man <command name>

Also if you are going to spend a lot of time learning this stuff a good linux syntax reference book is always a help. Whenever I need one I just borrow one from my friends.
 
Old 04-20-2004, 02:49 AM   #5
Greg_courageous
LQ Newbie
 
Registered: Apr 2004
Posts: 13

Original Poster
Rep: Reputation: 0
thankyou!
when i come across trouble i'll be back! one quick question though, do you know of any good syntax guides i could get?
 
Old 04-20-2004, 09:57 AM   #6
gutman007
LQ Newbie
 
Registered: Apr 2004
Posts: 4

Rep: Reputation: 0
I use google a lot, and I have an O'reilly Linux in a nutshell which is a great reference for a lot of the linux command line commands.
 
  


Reply


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
A couple of questions about files and usergroups NonSumPisces Linux - Newbie 3 07-31-2004 08:31 AM
Genral Questions on Types of Linux Files roiboy Linux - Newbie 4 04-27-2004 09:22 PM
Questions about device files jironimo Linux - Newbie 1 03-24-2004 05:59 PM
CUPS webserver questions - where are the html files? veritas Linux - Software 0 03-13-2004 04:54 PM
Questions about some files relating to X in my home directory. JoeLinux Linux - Software 1 05-08-2002 08:57 AM


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