LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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 01-28-2016, 10:06 AM   #1
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Decent documentation for specific commands


I've decided to learn a bit more about Linux Mint by looking closely at some commands and how they work, choosing the reboot, shutdown, halt, poweroff group to start off with.

Browsing through the web, I've found all sorts of conflicting information about the behaviour of these commands and their options, perhaps related to differing implementations.

I therefore decided to concentrate completely on the versions of these commands as they exist on my Linux Mint 17.3 KDE system. Accordingly I ran

Code:
man reboot
and
Code:
reboot --help
and immediately came across a conflict, the former not including the -n and -q options described by the latter.

So three questions if I may:

(i) Why do 'man reboot' and 'reboot --help' differ and which of these, if any, is authoritative?

(ii) Is there any good source that anyone would recommend where such lower level commands and their options are explained in far more detail than in the man command?

(iii) Where do I find the source code for the various commands for my Mint 17.3 KDE system? (because, if the code isn't too complex, I suspect that this is going to be my only real way of learning what the commands do on my system)
 
Old 01-28-2016, 10:56 AM   #2
FredGSanford
Senior Member
 
Registered: Nov 2005
Location: USA
Distribution: Mageia 7 - Debian 10 - Artix Linux
Posts: 1,142
Blog Entries: 5

Rep: Reputation: 207Reputation: 207Reputation: 207
Since Mint is based on Ubuntu and Ubuntu is based on Debian, this Debian reference guide may be of help!

https://www.debian.org/doc/manuals/user/ch-files.html
 
2 members found this post helpful.
Old 01-28-2016, 12:07 PM   #3
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
Quote:
Originally Posted by hydrurga View Post
I've decided to learn a bit more about Linux Mint by looking closely at some commands and how they work, choosing the reboot, shutdown, halt, poweroff group to start off with.

Browsing through the web, I've found all sorts of conflicting information about the behaviour of these commands and their options, perhaps related to differing implementations.

I therefore decided to concentrate completely on the versions of these commands as they exist on my Linux Mint 17.3 KDE system. Accordingly I ran

Code:
man reboot
and
Code:
reboot --help
and immediately came across a conflict, the former not including the -n and -q options described by the latter.

So three questions if I may:

(i) Why do 'man reboot' and 'reboot --help' differ and which of these, if any, is authoritative?

(ii) Is there any good source that anyone would recommend where such lower level commands and their options are explained in far more detail than in the man command?

(iii) Where do I find the source code for the various commands for my Mint 17.3 KDE system? (because, if the code isn't too complex, I suspect that this is going to be my only real way of learning what the commands do on my system)
man is a command to start a program called man that holds many documents on the programs that write a man page that tells about itself,

the command
Code:
man reboot
calls the program man the second is the argumant telling that man program to pull up the man pages for the program called reboot

reboot --help calls up the help code/file that is written within the reboot program itself giving the user what ever it was thet the person that wrote reboot to read and tell them what they think they need to know in order to operate that program.

Using MAN Pages


HowTo: Linux / UNIX Create a Manpage

why do we put two -- hypens and not one - hypen when we call for help --help?

because programs that are written to take a argument(s) or options (as they are called by some) use just one hypen to tell that program that it is part of it a function within the program and to then look for the argument after it. or the pram iof that is the way it is written to take in one, and that is needed within that argument so that it can use it to preform its task. or it is a empty pram function where just the one hypen is neeeded then the function call.

this is why reboot -help will cause errors.

Code:
ruserd@userx-VirtualBox:~$ sudo reboot -help
reboot: invalid option: -e
Try `reboot --help' for more information.
userd@userx-VirtualBox:~$
to find the source code for a program GOOGLE is the best place to look, "program name" source code [enter]

Actually make Google your friend in all of your what you do with Linux your first best friend then LQ your second.

Last edited by BW-userx; 01-28-2016 at 12:13 PM.
 
Old 01-28-2016, 12:30 PM   #4
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
authoritative would always be what the command -h or command --help shows.
Man pages sometimes get overlooked.
 
Old 01-28-2016, 12:46 PM   #5
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
basic commands of Linux
 
Old 01-28-2016, 03:23 PM   #6
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by hydrurga View Post
I've decided to learn a bit more about Linux Mint by looking closely at some commands and how they work, choosing the reboot, shutdown, halt, poweroff group to start off with.
i think you've chosen an unfortunate starting point:
these commands are usually not genuine commands, but either scripts calling a different command, or, in my case, links to the init program (systemctl).
(reboot -h immediatly reboots my system. didn't think when i was typing)
try
Code:
ls -al $(which reboot)
cat $(which reboot)
to see what sort of file it is (link or script or actual program).
if the cat shows gibberish, nevermind.
if it shows a shell script, it might give you a hint as to what that command really does (and where to find documentation on it).
 
Old 01-28-2016, 10:38 PM   #7
MrTux
Member
 
Registered: Dec 2015
Posts: 131

Rep: Reputation: Disabled
I think what you are looking for is man -k reboot

select the man (LOL) that suit best.

I believe reboot comes from shutdown so most likely

man shutdown
 
Old 01-29-2016, 06:19 AM   #8
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
I kept reading this thing about man, what is it? go look in the mirror?

I don't use man, but all this talk got me courious, so here it is.

Quote:
I believe reboot comes from shutdown so most likely

man shutdown
so I tried it....

Code:
%userx@voided ~>>$man reboot
HALT(8)                     System Manager's Manual                    HALT(8)

NAME
     halt, reboot, poweroff – stop the system

SYNOPSIS
     halt [-n] [-f]
     reboot [-n] [-f]
     poweroff [-n] [-f]

DESCRIPTION
     halt / reboot / poweroff tells init(8) to bring down, reboot, or power
     off the system.  Without -f, it is a shortcut for init 0 / init 6.

     -n      Don't sync before reboot or halt.  Note that the kernel and
             storage drivers may still sync.

     -f      Force halt or reboot, don't call init(8).  This is dangerous!

UNSUPPORTED OPTIONS
     This version of halt is based on runit(8), the following features are not
     supported and silently ignored:

     -w      to just write the wtmp record.

     -d      to not write the wtmp record.

     -h      to put hard drives in standby mode.

     -i      to shut down network interfaces.

SEE ALSO
     shutdown(8), init(8)

AUTHOR
     Christian Neukirchen, chneukirchen@gmail.com.

Linux                            July 29, 2014                           Linux
 
Old 01-29-2016, 12:05 PM   #9
DavidMcCann
LQ Veteran
 
Registered: Jul 2006
Location: London
Distribution: PCLinuxOS, Debian
Posts: 6,142

Rep: Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314
This has a lot of useful material, including man pages in a browsable format
http://linux.die.net/

This is a good general guide
http://tille.garrels.be/training/tldp/

For the ultimate in documentation
https://wiki.archlinux.org/
 
Old 01-29-2016, 02:41 PM   #10
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by MrTux View Post
I think what you are looking for is man -k reboot
a.k.a.
Code:
apropos reboot
 
Old 02-01-2016, 07:42 AM   #11
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048

Original Poster
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Many thanks to all for your kind replies and help. I have obtained the source code for the reboot command (apt-get source upstart) after enabling the source code repositories in the Synaptic Package Manager, and this is proving very fruitful in understanding what it does.
 
  


Reply



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
[SOLVED] Sudo question specific commands on specific directories slufoot80 Linux - Security 6 12-30-2014 08:57 AM
LXer: Documentation standards for commands LXer Syndicated Linux News 0 11-23-2011 08:30 PM
discovering commands from applications without documentation pslacerda Linux - Newbie 5 12-06-2008 05:40 PM
Commands to get some specific configuration gerargon Red Hat 3 07-20-2005 10:45 PM
Can't find Postfix documentation for a specific configuration. DesertWolf0132 Linux - Software 0 11-04-2003 12:56 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:01 PM.

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
Open Source Consulting | Domain Registration