LinuxQuestions.org
Visit Jeremy's Blog.
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 05-20-2013, 04:05 AM   #1
textillis
Member
 
Registered: May 2013
Location: Northern Rivers, NSW, Australia
Distribution: Slackware64-current, Mint Nadya
Posts: 299

Rep: Reputation: 2
man files are a stonewall


What is the uninitiated supposed to make of this:

Code:
 -r, -R, --recursive
              remove directories and their contents recursively
All I want to do is delete the contents of a directory.
When I consult the appropriate man page, I am confronted with 3 options which appear to do the same thing: ie: "remove directories and their contents recursively" although, if this is so, "recursive" here has an idiosyncratic use which is doubly off-putting for the noob...

Can some kind person tell me the code which will infallibly, without further argument from the command line, delete a directory and its contents?
Thanks,

sigh, big sigh
T
 
Old 05-20-2013, 04:15 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
The below command will remove the directory called some_directory and all its files and subdirectories:
Code:
rm -rf some_directory
You could also use -Rf or -f --recursive (as stated in the rm manual page).

Be careful! Once you remove files and/or directories it is rather hard to get them back. Do make sure you have a backup of what is important.
 
1 members found this post helpful.
Old 05-20-2013, 04:31 AM   #3
textillis
Member
 
Registered: May 2013
Location: Northern Rivers, NSW, Australia
Distribution: Slackware64-current, Mint Nadya
Posts: 299

Original Poster
Rep: Reputation: 2
Quote:
Originally Posted by druuna View Post
The below command will remove the directory called some_directory and all its files and subdirectories:
Code:
rm -rf some_directory
You could also use -Rf or -f --recursive (as stated in the rm manual page).

Be careful! Once you remove files and/or directories it is rather hard to get them back. Do make sure you have a backup of what is important.
Thanks kindly Druuna;
while on this subject (of failing to understand the man pages) could you please direct me to where i can read up on the syntax of man pages (i've tried man man and am none the wiser) in language perhaps a bit better adapted to the neophyte, comme moi?

thx again,
Tex
 
Old 05-20-2013, 04:45 AM   #4
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Manual pages are rather straightforward (said by someone that's been using man pages for ages...).

Maybe these will help:
Man Page (WIKI)
Linux man command - Linux help tutorial
Using man command to get Linux online help manual and documentation.
 
2 members found this post helpful.
Old 05-21-2013, 01:02 AM   #5
textillis
Member
 
Registered: May 2013
Location: Northern Rivers, NSW, Australia
Distribution: Slackware64-current, Mint Nadya
Posts: 299

Original Poster
Rep: Reputation: 2
Quote:
Originally Posted by druuna View Post
Manual pages are rather straightforward (said by someone that's been using man pages for ages...).

Maybe these will help:
Man Page (WIKI)
Linux man command - Linux help tutorial
Using man command to get Linux online help manual and documentation.
Thanks kindly Druuna,
I'm reading to slow but good effect the suggested reading material.

Cheers,
Tex
 
Old 05-21-2013, 09:23 PM   #6
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,321
Blog Entries: 28

Rep: Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141
My primary discontent with the man page format is that it is notably lacking in examples.

Reading them effectively can take some practice, and, even so, I often find myself doing a web search to find some examples.

An example can be worth a thousand words.
 
1 members found this post helpful.
Old 05-21-2013, 09:53 PM   #7
tommcd
Senior Member
 
Registered: Jun 2006
Location: Philadelphia PA USA
Distribution: Lubuntu, Slackware
Posts: 2,230

Rep: Reputation: 293Reputation: 293Reputation: 293
Quote:
Originally Posted by frankbell View Post
My primary discontent with the man page format is that it is notably lacking in examples. ...
An example can be worth a thousand words.
I second that!
For an excellent example of a well written man page, just check out the man page for rsync. It has examples at every step in the man page that clearly illustrate how the command can be used.
If only all man pages were as well thought out as the rsync man page, there would be no reason to ask for help on reading a man page. After all, the man pages are supposed to be the help, and not require help on how to read them.

Last edited by tommcd; 05-21-2013 at 09:56 PM.
 
1 members found this post helpful.
Old 05-21-2013, 10:24 PM   #8
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
Hi,

primarily they are supposed to be a reference, but there is nothing stopping them from having and "EXAMPLES" section. Some man pages have great examples, the burn and pdftk man pages are good examples of this :-).

I think the biggest hurdle is learning how to read/parse man pages. This exactly the problem the OP is having. Once you get past that, they are a great reference, and in some (admittedly rare) cases even a great source of examples.

Cheers,

Evo2.
 
1 members found this post helpful.
Old 05-21-2013, 10:27 PM   #9
Janus_Hyperion
Member
 
Registered: Mar 2011
Location: /
Distribution: Fedora (typically latest release or development release)
Posts: 372

Rep: Reputation: Disabled
Quote:
Originally Posted by tommcd View Post
I second that!
For an excellent example of a well written man page, just check out the man page for rsync. It has examples at every step in the man page that clearly illustrate how the command can be used.
If only all man pages were as well thought out as the rsync man page, there would be no reason to ask for help on reading a man page. After all, the man pages are supposed to be the help, and not require help on how to read them.
Very very true! rsync man page is simply fantastic!

With the multitude of options available in pretty much every linux commands, it is often very hard to effectively use a particular utility unless one reads the entire man page!

I usually look up online examples and use these examples as basis to study the man pages. Works for me!
 
1 members found this post helpful.
Old 05-22-2013, 02:26 AM   #10
textillis
Member
 
Registered: May 2013
Location: Northern Rivers, NSW, Australia
Distribution: Slackware64-current, Mint Nadya
Posts: 299

Original Poster
Rep: Reputation: 2
Quote:
Originally Posted by frankbell View Post
My primary discontent with the man page format is that it is notably lacking in examples.

Reading them effectively can take some practice, and, even so, I often find myself doing a web search to find some examples.

An example can be worth a thousand words.
This hits the nail on the head for me: the parsing would come naturally enough with practice, but the initial understanding and learning would take place much faster, more effectively -launching the noob more securely into the lino-shere- with a structured use of:
straight exposition, followed by exemplification and concrete instancing of same.

The natural rythm for all man pages should be:
1. new idea, usage, command; followed and fleshed out and instanciated by,
2. concrete examples of that command, making use of some core options and arguments.

The ideal functional message should be: "Here is a tool; now, here is one way you might use such a tool to do one kind of job; here is a another -very different use- by way of contrast, illustrating the wide range of application of said tool"

In this way, the noob would get to learn the (necessary) jargon of manpage-ese very directly and quickly, instead of being ground down by constant failure to penetrate the obscurities of a highly artifical, overly(?)-technicalized language and thereby failing to connect with the beauty and power of Linux, a connection which should be the real hook laid in every manpage.

Finally, to emphasise, I return to my original post: for me (someone not lacking in intelligence nor completely without skill in manipulating different registers of language and different kinds of language ie: formal logic and mathematics) for me, I repeat, man pages represent an unnecessary -structural- layer between the noob and the linux experience at depth, a very real problem, but one which would be obviated by a liberal use of examples at every turn.

Tex-asperated
 
Old 05-22-2013, 02:45 AM   #11
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
Hi,
Quote:
Originally Posted by textillis View Post
The natural rythm for all man pages should be:
1. new idea, usage, command; followed and fleshed out and instanciated by,
2. concrete examples of that command, making use of some core options and arguments.
Not so sure about this. I'm not saying that such documentation should not exist, I just don't think the man pages are the place for it. The man pages are first and foremost supposed to be a *reference*. From the man man page.
Code:
MAN(1)                               Manual pager utils                               MAN(1)

NAME
       man - an interface to the on-line reference manuals
So, while documentation like you describe in 1. would be extremely valuable, I'm not sure that the way man pages are structured should be changed. Perhaps there could be "doc" pages, or "howto" pages (we already have GNU Info), that automatically pull the relevant formal information from the man pages (and or Info documents), while adding a "softer" introduction and a beefier examples section.

Cheers,

Evo2.
 
2 members found this post helpful.
Old 05-22-2013, 03:00 AM   #12
brianL
LQ 5k Club
 
Registered: Jan 2006
Location: Oldham, Lancs, England
Distribution: Slackware64 15; SlackwareARM-current (aarch64); Debian 12
Posts: 8,298
Blog Entries: 61

Rep: Reputation: Disabled
This is a good book, either downloadable as a .pdf or buyable in real paper: The Linux Command Line.
Plenty of examples.
 
2 members found this post helpful.
Old 05-22-2013, 03:12 AM   #13
textillis
Member
 
Registered: May 2013
Location: Northern Rivers, NSW, Australia
Distribution: Slackware64-current, Mint Nadya
Posts: 299

Original Poster
Rep: Reputation: 2
Quote:
Originally Posted by brianL View Post
This is a good book, either downloadable as a .pdf or buyable in real paper: The Linux Command Line.
Plenty of examples.
Thanks!
I'll buy it and make it my friend.

Cheers,
tex
 
Old 05-22-2013, 06:51 PM   #14
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Actually, that's one thing I do miss from VAX/VMS; the help pages (man pages equiv) did have all the syntax well explained, but also had loads of examples.
iirc, just about every cmd had at least one example.

You could just create a new user, give them their login details & just tell them to type 'help' and they could pretty much teach themselves, especially if they've used another cli before.
 
Old 05-22-2013, 08:49 PM   #15
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,321
Blog Entries: 28

Rep: Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141
I would expand on my previous comment about lack of examples to this end: man pages are intended as references, not as a teaching tools.

Teaching tools should have lots of examples. I wouldn't want to see "lots" of examples in man pages, but a few examples of most common basic uses of a command would be helpful.

The other gratuitous observation is this, and it's intended only as an observation: man pages (and other references) tend to be written by experts. It's sometimes difficult for experts to anticipate the questions that non-experts will have.

But the man format is well established and unlikely to change easily.

Given that, I will continue to work on my google-fu and seek examples.

Last edited by frankbell; 05-23-2013 at 07:59 PM.
 
  


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
LILO documentation other than man files ? Vilius Linux - Software 4 02-26-2009 05:31 PM
problem navigating man files with in bash rich paul fox Linux - Newbie 6 07-02-2007 08:58 PM
gnome desktop dialup stonewall dfowensby *BSD 2 08-12-2004 04:35 AM
Can't run programs/see files in man - MDK9.2 pjdepasq Linux - Security 6 03-01-2004 07:23 PM
Compiling packages on RH 7.1 causes man files to be named man.gz mmboam Linux - General 0 05-09-2001 06:47 PM

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

All times are GMT -5. The time now is 09:29 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
Open Source Consulting | Domain Registration