Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
-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,
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?
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.
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.
Distribution: Fedora (typically latest release or development release)
Posts: 372
Rep:
Quote:
Originally Posted by tommcd
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!
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.
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.