**Some More Useful Linux Commands**- Use the man page command
`man`*<command>*to find out more about the following commands- man
- alias
- cd
- cat
- chmod
- cp
- mv
- grep
- head
- ls
- diff
- sort
- tail
- top
- wc
- env
- mkdir
- rmdir
- which
- whoami

- You could also combine various commands together using the following
operators. Find out from your lab instructor
what these stand for and how to use them.
- |
- <
- >
- >>
- ;
- tee

## Questions

Now see if you can answer the following questions using the commands you have learnt.- Give a "long" listing of the largest 5 files in the /etc directory whose name contains the string ".conf", sorted by decreasing file size.
- All the commands listed above are actually programs of the UNIX system. Where on the unix system are these programs located? How will you find out the full path names of these programs?
- Find the number of lines in which the string "is" occurs in your file FirstWeek.txt.
- Find the number of lines in which the string " is " occurs in your file FirstWeek.txt.
- Can you account for the differences in these two numbers?
- Find the number of lines in which the string "is" does not occur in your file FirstWeek.txt.
- Create a signature file called
`.signature`giving details of your name, address, hostel and phone numbers and email addresses. - Find out how this
`.signature`file is used to save you the trouble of separately signing every mail that you send. Set it up in your favourite mailer.

- Use the man page command
**Beginning SML**- You may use SML as a command-line calculator to compute various
complex expressions (with parentheses too!) including the following:
- (2+3)*100-8
- (2.0+3.0)*100.0-8.0

__Question:__**Do you see any difference between these expressions?**__Question:__**What about the following?**- (2+3)*100-8 div 6
- (2+3)*100-8 mod 6
- (2.0+3.0)*100.0 - 8.0/6.0

__Question:__**Do you understand why you get different answers in each case?** - Find out all the primitive functions on integers by typing
`open Int;`. Since most of them are self-explanatory you probably understand what they do.__Question:__**But can you figure out what the following functions are?**- compare
- toString
- fromString
- ~

__Question:__**Can you figure out when the two functions**`div`and`quot`**will give different answers?**__Question:__**Simlarly what is the difference between**`rem`**and**`mod`?__Question:__**Try to give one or more**__identities__that connect the functions`div`,`quot`,`rem`and`mod`? - Now open the structure
`Real`and see what functions you can recognize? Experiment with the functions you don't understand and try to figure out what they do.__Question:__**How will you convert integers into reals when you have to?**__Question:__**How will you convert reals into integers when you have to?**

- You may use SML as a command-line calculator to compute various
complex expressions (with parentheses too!) including the following:

S. Arun-Kumar Last modified: Sat Aug 3 11:21:54 IST 2013