Sponsored Content
Full Discussion: Some CLI questions
Top Forums UNIX for Dummies Questions & Answers Some CLI questions Post 302170717 by cfajohnson on Tuesday 26th of February 2008 02:15:57 PM
Old 02-26-2008
Quote:
Originally Posted by dotancohen
I use Ubuntu Linux, and I'd like to become more familiar with the CLI. I have these questions:

1) How to remove a directory that is not empty? The only option in man rmdir is -p and that does not do what I need. rm -R needs sudo for some reason.

Code:
rm -rf "$DIR"

Quote:
2) What is a CLI command to make all the files in a directory 644, and all the directories 755 (recursive to subdirectories)?

Code:
find "$DIR" -type f -exec chmod 644 {} \;
find "$DIR" -type d -exec chmod 755 {} \;

Quote:
3) Some directories are listed as:
1 byte
8 byte
16 byte
32 byte
40 byte
4 KB
8 KB
This size has nothing to do with what is in them, either. What makes the different directories show as different sizes?

The size of the directory entry, which includes all the file names.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

start dt apps from CLI

I have need of starting the app manager or what ever it is called from the CLI. I can start the text editor and file manger i.e. dtpad, dtfile & dtmail etc... But I have forgotten the command to start the app manager. Help!!!! :D (1 Reply)
Discussion started by: jagannatha
1 Replies

2. Shell Programming and Scripting

Looking for a Python CLI module

When I say "Command Line Interface" I mean the wrapper that allows you to type "commands" and have then correspond to pre-programmed actions... all the while making sure that it looks like you are INSIDE a shell of sorts. I had good hope for "common.cli" but that didnt last long, when I found... (1 Reply)
Discussion started by: jjinno
1 Replies

3. UNIX Desktop Questions & Answers

Get a web page through CLI

Is there a way we can get a web page through CLI on a unix machine? Please help! (3 Replies)
Discussion started by: Pouchie1
3 Replies

4. Programming

terminal IO for CLI devlopment

Hi all, Am trying to develop CLI kind of program which does a telcom switch configuration . I have to provide a terminal and a prompt to user for that I did following: static struct termios old_term; struct termios new_term; tcgetattr(STDIN_FILENO, &old_term); new_term = old_term; ... (3 Replies)
Discussion started by: zing_foru
3 Replies

5. Homework & Coursework Questions

Print questions from a questions folder in a sequential order

1.) I am to write scripts that will be phasetest folder in the home directory. 2.) The folder should have a set-up,phase and display files I have written a small script which i used to check for the existing users and their password. What I need help with: I have a set of questions in a... (19 Replies)
Discussion started by: moraks007
19 Replies

6. Ubuntu

CLI Change drive

Please -- I cannot find how to change in terminal from e.g. sda1 to sda2 or to sdb* Any ideas please? (3 Replies)
Discussion started by: Royalist
3 Replies

7. Solaris

Booting from Grub CLI

Hi, Hoping someone out there has seen this before. My backup/restore operation failed when my system ran out of memory Restore operation failed Setting ZFS Boot Environment to rootpool cannot set property for 'rootpool': out of space Installing GRUB Boot Loader into the first disk stage1... (2 Replies)
Discussion started by: A-Train
2 Replies

8. UNIX for Dummies Questions & Answers

Questions on CLI and xwindow

Hi, I was not sure about the terminology of the thing that I am about to explain, so it was very difficult to find relevant search results. I want to use my computer using the ctrl+alt+f1 CLI without using a graphical system. However, at the same time, I would also like to do basic tasks like... (6 Replies)
Discussion started by: jamie_123
6 Replies

9. Shell Programming and Scripting

Running a command in another cli

I am writing a script to login to to a mongo DB node and get the status of that machine. The usual work flow is : # mongo admin -u root -p root MongoDB shell version: 3.0.11 connecting to: admin rs0:SECONDARY> Then in the new prompt I can run a command to check status : ... (0 Replies)
Discussion started by: Junaid Subhani
0 Replies

10. UNIX for Beginners Questions & Answers

Trying to get my computer to boot to CLI

I prefer for my computers to boot in the CLI. Back in the day, all you had to do to make this happen (on Debian-based) was edit a line in /etc/default/grub and then run: sudo update-grub But for some reason now, more updated (I guess) operating systems won't accept this, you have to manually shut... (2 Replies)
Discussion started by: Huitzilopochtli
2 Replies
CGI::Pretty(3pm)					 Perl Programmers Reference Guide					  CGI::Pretty(3pm)

NAME
CGI::Pretty - module to produce nicely formatted HTML code SYNOPSIS
use CGI::Pretty qw( :html3 ); # Print a table with a single data element print table( TR( td( "foo" ) ) ); DESCRIPTION
CGI::Pretty is a module that derives from CGI. It's sole function is to allow users of CGI to output nicely formatted HTML code. When using the CGI module, the following code: print table( TR( td( "foo" ) ) ); produces the following output: <TABLE><TR><TD>foo</TD></TR></TABLE> If a user were to create a table consisting of many rows and many columns, the resultant HTML code would be quite difficult to read since it has no carriage returns or indentation. CGI::Pretty fixes this problem. What it does is add a carriage return and indentation to the HTML code so that one can easily read it. print table( TR( td( "foo" ) ) ); now produces the following output: <TABLE> <TR> <TD>foo</TD> </TR> </TABLE> Recommendation for when to use CGI::Pretty CGI::Pretty is far slower than using CGI.pm directly. A benchmark showed that it could be about 10 times slower. Adding newslines and spaces may alter the rendered appearance of HTML. Also, the extra newlines and spaces also make the file size larger, making the files take longer to download. With all those considerations, it is recommended that CGI::Pretty be used primarily for debugging. Tags that won't be formatted The following tags are not formatted: <a>, <pre>, <code>, <script>, <textarea>, and <td>. If these tags were formatted, the user would see the extra indentation on the web browser causing the page to look different than what would be expected. If you wish to add more tags to the list of tags that are not to be touched, push them onto the @AS_IS array: push @CGI::Pretty::AS_IS,qw(XMP); Customizing the Indenting If you wish to have your own personal style of indenting, you can change the $INDENT variable: $CGI::Pretty::INDENT = " "; would cause the indents to be two tabs. Similarly, if you wish to have more space between lines, you may change the $LINEBREAK variable: $CGI::Pretty::LINEBREAK = " "; would create two carriage returns between lines. If you decide you want to use the regular CGI indenting, you can easily do the following: $CGI::Pretty::INDENT = $CGI::Pretty::LINEBREAK = ""; AUTHOR
Brian Paulsen <Brian@ThePaulsens.com>, with minor modifications by Lincoln Stein <lstein@cshl.org> for incorporation into the CGI.pm distribution. Copyright 1999, Brian Paulsen. All rights reserved. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. Bug reports and comments to Brian@ThePaulsens.com. You can also write to lstein@cshl.org, but this code looks pretty hairy to me and I'm not sure I understand it! SEE ALSO
CGI perl v5.12.1 2010-04-26 CGI::Pretty(3pm)
All times are GMT -4. The time now is 09:15 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy