UNIX man command to find list of man sections - linux

I'm working on a lab that is supposed to help us better navigate the command line on a Linux system, but I'm getting stuck on man pages.
We are supposed to use the man command to find a list of the man page sections, adn I can't seem to figure out how to do this. I've tried entering
man man
but that doesn't give me any information on the individual sections. I've also tried looking on Google to find what command I should use, but no luck there either.
Can anybody point me in the right direction?

apropos -r '.*'
This will list all manual pages. A script to chop this up into lists by section is a follow-up homework assignment.

Related

Locating files starting with a string for my hw

I have a conundrum and I am not necessarily trying to cheat or anything I am just simply stuck. I am trying to complete an assignment for my intro to Linux class and I was hoping someone would be able to help me find the right solution. I have to:
In the same directory (where the last file was found) list all files
starting with "host" --
Use the long listing format Use a command to
find the file that shows the name of your computer
now the directory in question is /etc and I have tried several commands to no avail for both of these but especially the first one. I have tried find and locate and even attempted a grep and it just is not working as intended. I can't get files that start with "host" at most I keep getting a list of permission denied or files that end in .host and so I am not sure what I am doing wrong but I really need help so I can turn in my assignment. You don't have to tell me what the exact command should be I am just looking for some guidance again I am not trying to cheat just need help to figure it out.
and welcome to Stack Overflow! Here are some pointers.
See globbing in Linux and the * symbol.
"long listing" is an option for ls command, see ls --help. The name of your computer (or, more accurately, the name of your host) is a file in /etc/. You should see it when doing #1.

how to create a general manual for linux?

I am working in a company where they use lots of tools and commands for linux (internal and external)
I would like to create a custom manual, with examples per tool.
Thought of using info tool for this:
info CompanyName tool1
info CompanyName tool2
info CompanyName tool3
..
and the output of each should be a simple text of examples and comments added by me.
But as far as I know, the info in Linux is created for a specific tool and not for a your customized needs.
Any idea what would be the best way to achieve the above?
Currently I am using sublime with tab per tool and every once and then I update the sublime tab with the new examples.
Any advice will be most appreciated.
For what it's worth, I am not a fan of info pages. I prefer the good old Unix man pages and it is very simple to write them. You can simply open any man page in an editor, look at it's source and just copy it to suit your needs.
On most systems the man pages are found in a directory like /usr/share/man/{man1,man2,man3,man4,man5,man6,man7,man8}/, or you can use the -w option of the man command to see the location of any man page and then open it. For example
$ man -w ls
/usr/share/man/man1/ls.1.gz
$ vim /usr/share/man/man1/ls.1.gz
You can see how it is written, and mimic it to write your own man page. In order for anyone to be able to read the man page written by you, the man page has to be installed in one of the directories where the man utility searches for man pages. On Linux, you can usually see this list of directories by running the manpath command (on other systems it might be different and you will have to see the man page of the man command itself). If you store your man pages in one of these directories then any one can read it by using the man utility.
As per POSIX the man utility also respects the environment variable MANPATH, so if you store your man page in a non-standard location, you can set the MANPATH variable, so that man can look it up. Or you can also modify the /etc/man.conf file to add your man page directory to the search path of man.
Now, man pages use a macro language to do the mark up. Linux systems tend to use man(7) macro syntax, for which you can see the manual here
There is another modern macro set for writing man pages, called mdoc(7), which is used extensively in the BSD family of operating systems. You can see its manual here

Linux numbers/figures before the user's and group's names

After thorough research online, I've struggled to figure out what the NUMBERS BEFORE USER's NAME on linux mean and how we can change it ? This is for classroom homework purpose.
I'll explain myself clearer with the following example. After a ls-l, I got this:
" drwxr-xr-x 2 John Family 2048 June 14 "
Here's my question Does anybody know what does the "2" before John mean ? Can we change that number with a specific command line ? Maybe chmod ?
Please note, I'm very new to developing as a general (just have a few basics in C language) and stackoverflow so I may be very clumsy in my approach.
Thanks guys in advance for those who would be willing to shed some light on the darkness of my novice-ness ahah
You can find more information about ls from the man page that you can read at man ls. In particular, look for the section that will be labelled The Long Format, which goes into much detail. On my system (OS X 10.10) it reads as follows:
If the -l option is given, the following information is displayed for
each file: file mode, number of links, owner name, group name, number
of bytes in the file, abbreviated month, day-of-month file was last
modified, hour file last modified, minute file last modified, and the
pathname.
In general, you find details about Unix commands with the man command.
I found the answer thanks to you ! the number correponds to the number of links (hardlinks or symbolic links) and this number can be influenced by the command "ln" or (for a symbolic link) "ln -s". Thanks again vielmetti – Zel just now edit

Description to my file using man command

I created a small project using C to make some commands in Linux terminal.
I want to add a description to my project to call it when I use man command. Such as if my project name is hello.c, I want when I write command man hello.c to print the description I wrote for my project. Where do I write this description?
I saw this but don't know where or how I write the description.
There are several great tutorials for doing so:
How to write a man
page
Creating your own manpage
How to write a UNIX man page.
Pick one, and hack away.
If you feel that you are stuck somewhere, take a look at man pages from FreeBSD utilities like cat, echo, etc

what are good resources to get the most out of csh or tsch?

I would like to get the most out of working in cch or tcsh shell.
I am looking for general tips (post them away), online tips, or book.
Thanks
The csh or tcsh man page has pretty much everything you need to get started. I'd read through that first.
This O'Reilly book is also a good resource: http://oreilly.com/catalog/9781565921320/

Resources