Sponsored Content
Top Forums Shell Programming and Scripting Remove contents of directory, but not directory Post 302305698 by McThick on Thursday 9th of April 2009 02:02:12 PM
Old 04-09-2009
It seems your rm may be aliased to rm -i, which overrides your -f option. Try
Code:
/usr/bin/rm -rf *

from the appropriate directory.

More safely, you can test with

Code:
prompt%> mkdir /foo
prompt%> cd /foo
prompt%> touch a.txt
prompt%> touch b.txt
prompt%> touch c.txt
prompt%> /usr/bin/rm -rf *

I realize this does not follow your constraint of not using shell wildcards, but I'm guessing that issue is caused by having to verify every delete 'interactively'
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Unable to view contents of a directory

Hi, first post here be gentle. Very new to Unix. Using HP-UX 10.20 I CD into a remote directory on one machine $ cd /net/remote hostname yet when I do an ll in this directory none of the contents appear. It just is empty. when I do the same command from another machine, $ cd... (13 Replies)
Discussion started by: maddave
13 Replies

2. UNIX for Dummies Questions & Answers

Message trying to list contents of directory

I'm getting this return whenever I try to do anything on a directory root# ls -al /directory ls: .: Value too large to be stored in data type. total 0 I can change directory down two levels but can not list contents of the root of this directory. ANy one seen this? (1 Reply)
Discussion started by: sallender
1 Replies

3. UNIX for Dummies Questions & Answers

list contents of directory

I want to list the contents of a directory, but I do not want to use the ls, is there another way?? (3 Replies)
Discussion started by: carl_vieyra
3 Replies

4. UNIX for Dummies Questions & Answers

Best way to list a directory's contents?

Hey guys! I'm so glad I found this site, I've had so many questions and have been left alone for roughly a year scanning man pages but It's just not quite cutting it for some things. So, I often like to list directories when browsing around my local machine, a friend's machine, or my web... (6 Replies)
Discussion started by: bbilheimer
6 Replies

5. Solaris

Directory should not be deleted, But the contents can be

Hi Guys, I have an user's home directory set to /home/A And A contains the following directories B & C Is there some way in solaris by which i can prevent the directories B and C from getting deleted by the user but the contents of the directories B & C can be deleted ? Also i have... (2 Replies)
Discussion started by: localhost
2 Replies

6. Shell Programming and Scripting

Create a list of directory contents

Well I did a search and didn't anything for my specific case. I got a directory with a bunch of text file. All of them have the following pattern on the filename "ABCD_<As of Date>.txt" Example: ABCD_20110301.txt ABCD_20110302.txt ABCD_20110303.txt All I want to accomplish is a Korn... (3 Replies)
Discussion started by: Shark Tek
3 Replies

7. Shell Programming and Scripting

Script that displays contents of a directory

Hello all! I am writing a script that takes in a directory name as input and if the directory exists, it shows the files inside the directory here is what I have so far (incomplete) (mostly like pseudocode) #/bin/sh echo Please enter the name of a directory read dir grep $dir... (2 Replies)
Discussion started by: subway69
2 Replies

8. UNIX for Dummies Questions & Answers

What option will use for deleting directory with all its contents?

Hi How to completely delete directory with all it contents I try to use rmdir -r but it give error Thanks ---------- Post updated at 03:10 AM ---------- Previous update was at 02:52 AM ---------- Hi all I got the solution for my thread i use mkdir with the option -p Thanks (1 Reply)
Discussion started by: Tauatioti
1 Replies

9. AIX

Restore directory and contents from tape

Hi, I have taken a backup of a directory on my tape in using below command cd /backup find * -print|backup -ivf '/dev/rmt0' '-U' |tee -a /syslogs/backup.log and output appear in below format. a 0 rman-before-08032014 a 58403323904... (2 Replies)
Discussion started by: m_raheelahmed
2 Replies

10. Shell Programming and Scripting

Zipping contents without the actual directory

Hi , I want to zip files present in the directories listed under a parent directory without zipping the directory itself my parent directory path is /informatica/DGDMN/PowerCenter1011/server/infa_shared/SrcFiles/OTE/Final_Directory I have the below directories named as 1,2,3,4,5 listed... (9 Replies)
Discussion started by: paul1234
9 Replies
ckint(1)							   User Commands							  ckint(1)

NAME
ckint, errint, helpint, valint - display a prompt; verify and return an integer value SYNOPSIS
ckint [-Q] [-W width] [-b base] [-d default] [-h help] [-e error] [-p prompt] [ -k pid [-s signal]] /usr/sadm/bin/errint [-W width] [-b base] [-e error] /usr/sadm/bin/helpint [-W width] [-b base] [-h help] /usr/sadm/bin/valint [-b base] input DESCRIPTION
The ckint utility prompts a user, then validates the response. It defines, among other things, a prompt message whose response should be an integer, text for help and error messages, and a default value (which will be returned if the user responds with a carriage return). All messages are limited in length to 70 characters and are formatted automatically. Any white space used in the definition (including new- line) is stripped. The -W option cancels the automatic formatting. When a tilde is placed at the beginning or end of a message definition, the default text will be inserted at that point, allowing both custom text and the default text to be displayed. If the prompt, help or error message is not defined, the default message (as defined under NOTES) will be displayed. Three visual tool modules are linked to the ckint command. They are errint (which formats and displays an error message), helpint (which formats and displays a help message), and valint (which validates a response). These modules should be used in conjunction with FML objects. In this instance, the FML object defines the prompt. When base is defined in the errint and helpint modules, the messages will include the expected base of the input. OPTIONS
The following options are supported: -b base Defines the base for input. Must be 2 to 36, default is 10. -d default Defines the default value as default. The default is not validated and so does not have to meet any criteria. -e error Defines the error message as error. -h help Defines the help messages as help. -k pid Specifies that process ID pid is to be sent a signal if the user chooses to abort. -p prompt Defines the prompt message as prompt. -Q Specifies that quit will not be allowed as a valid response. -s signal Specifies that the process ID pid defined with the -k option is to be sent signal signal when quit is chosen. If no signal is specified, SIGTERM is used. -W width Specifies that prompt, help and error messages will be formatted to a line length of width. OPERANDS
The following operand is supported: input Input to be verified against base criterion. EXIT STATUS
The following exit values are returned: 0 Successful execution. 1 EOF on input, or negative width on -W option, or usage error. 3 User termination (quit). ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ SEE ALSO
attributes(5) NOTES
The default base 10 prompt for ckint is: Enter an integer [?,q]: The default base 10 error message is: ERROR - Please enter an integer. The default base 10 help message is: Please enter an integer. The messages are changed from "integer" to "base base integer" if the base is set to a number other than 10. When the quit option is chosen (and allowed), q is returned along with the return code 3. The valint module will not produce any output. It returns 0 for success and non-zero for failure. SunOS 5.10 14 Sep 1992 ckint(1)
All times are GMT -4. The time now is 06:59 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy