12-08-2012
Just a note (and my personal opinion) while this is a good exercise, YOU SHOULD NOT ALIAS RM. The last thing you want to do is forget how powerful it is, and more importantly how permanent it is. Seems like no big deal, but then that one day you carelessly delete something...
One thing you could do though if you still want to proceed is make it so that before it rm's whatever, it performs an ls, prints the output and asks you to confirm that you want to delete.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
The script below is supposed to list file and folder names and list the type besides each - It has no practical value - I am just trying to learn KSH (so far sounds like a bad idea!)
Expected output should look like this:
folder 1 *** dir ***
file1 * file *
The code runs but produces... (9 Replies)
Discussion started by: GMMike
9 Replies
2. Shell Programming and Scripting
I know that this is a ridiculously simple statement, but I am getting an error when I execute it, and I can't figure out what it is. Can anyone point me in the right direction?
#!/bin/ksh
integer dateMonth=0
integer intZero=0
if
then
dateMonth = 1
fi
echo $dateMonth (7 Replies)
Discussion started by: mharley
7 Replies
3. UNIX for Dummies Questions & Answers
Hi all,
I have a problem not really dramatic but realyl annoying:
i've got a groups of users who logon a sunos 2.3 box via a windows telnet client (KEAI, but this is not the problem).
they login as perso1 and password.
It takes a very very very long time to get in.
If i log on the same box... (2 Replies)
Discussion started by: penguin-friend
2 Replies
4. Shell Programming and Scripting
Keeping in mind that I'm relatively comfortable with programming in general but very new to unix and korn/bourne shell scripts..
I'm using awk on a CSV file, and then performing calculations and operations on specific fields within specific records. The CSV file I'm working with has about 600... (2 Replies)
Discussion started by: yongho
2 Replies
5. Shell Programming and Scripting
Hi there, I'm pretty new to scripting and wondering if anyone had any idea's, scripts or snippets on how I can do the following.
I basically want a shell script that will look at all the files in a directory and find all the names and addresses in them then output them to the screen nicely... (12 Replies)
Discussion started by: mrpugster
12 Replies
6. UNIX for Dummies Questions & Answers
I start wetting my toes in Linux programming.
I tried the first program myls.c in Advanced Programming in the Unix Environment.
#include <sys/types.h>
#include <dirent.h>
#include "apue.h"
int main(int argc, char *argv)
{
DIR *dp;
struct... (1 Reply)
Discussion started by: cqlouis
1 Replies
7. Shell Programming and Scripting
Hello friends,
I need an idea or a ready solution for a problem
i have the following lines in text file:
1 20100920140122 object4 MOVE IN
2 20100920150012 object4 MOVE OUT
-- cut --
the second column is the date and time:
20100920140122 = 2010 09 20 14:01.22
what I need to do is to add 40... (8 Replies)
Discussion started by: peetteerr
8 Replies
8. Shell Programming and Scripting
I had this working a few days ago but I since changed it. Heres the code
x=1
while 1 2 3 4 5 6
1=$(ps -ef | grep process | awk '{ print $2}')
if
then
echo "The database is accepting connections..."
echo "Now I will check the next process"
2=$(ps -ef | grep process1 |... (10 Replies)
Discussion started by: jeffs42885
10 Replies
9. Shell Programming and Scripting
Hi all, I now have project in UNIX Solaris and I want to have some new ideas to execute it, so I hope you help me finding new ideas in scripting or some infrastructure .bye (1 Reply)
Discussion started by: hard_revenge
1 Replies
10. Shell Programming and Scripting
Hello everyone,
I have written simple script below to check if ip is added to interface
#!/usr/local/bin/bash
IFCONFIG="/sbin/ifconfig"
SERVICE="/usr/sbin/service"
IP="79.137.X.X"
GREP=$(${IFCONFIG} | grep ${IP})
ip_quantity_check () {
echo ${GREP} | wc -l
}
if ];... (2 Replies)
Discussion started by: bryn1u
2 Replies
LEARN ABOUT CENTOS
vfs_recycle
VFS_RECYCLE(8) System Administration tools VFS_RECYCLE(8)
NAME
vfs_recycle - Samba VFS recycle bin
SYNOPSIS
vfs objects = recycle
DESCRIPTION
This VFS module is part of the samba(7) suite.
The vfs_recycle intercepts file deletion requests and moves the affected files to a temporary repository rather than deleting them
immediately. This gives the same effect as the Recycle Bin on Windows computers.
The Recycle Bin will not appear in Windows Explorer views of the network file system (share) nor on any mapped drive. Instead, a directory
called .recycle will be automatically created when the first file is deleted and recycle:repository is not configured. If
recycle:repository is configured, the name of the created directory depends on recycle:repository. Users can recover files from the recycle
bin. If the recycle:keeptree option has been specified, deleted files will be found in a path identical with that from which the file was
deleted.
This module is stackable.
OPTIONS
recycle:repository = PATH
Path of the directory where deleted files should be moved.
If this option is not set, the default path .recycle is used.
recycle:directory_mode = MODE
Set MODE to the octal mode the recycle repository should be created with. The recycle repository will be created when first file is
deleted. If recycle:subdir_mode is not set, MODE also applies to subdirectories.
If this option is not set, the default mode 0700 is used.
recycle:subdir_mode = MODE
Set MODE to the octal mode with which sub directories of the recycle repository should be created.
If this option is not set, subdirectories will be created with the mode from recycle:directory_mode.
recycle:keeptree = BOOL
Specifies whether the directory structure should be preserved or whether the files in a directory that is being deleted should be kept
separately in the repository.
recycle:versions = BOOL
If this option is True, two files with the same name that are deleted will both be kept in the repository. Newer deleted versions of a
file will be called "Copy #x of filename".
recycle:touch = BOOL
Specifies whether a file's access date should be updated when the file is moved to the repository.
recycle:touch_mtime = BOOL
Specifies whether a file's last modified date should be updated when the file is moved to the repository.
recycle:minsize = BYTES
Files that are smaller than the number of bytes specified by this parameter will not be put into the repository.
recycle:maxsize = BYTES
Files that are larger than the number of bytes specified by this parameter will not be put into the repository.
recycle:exclude = LIST
List of files that should not be put into the repository when deleted, but deleted in the normal way. Wildcards such as * and ? are
supported.
recycle:exclude_dir = LIST
List of directories whose files should not be put into the repository when deleted, but deleted in the normal way. Wildcards such as *
and ? are supported.
recycle:noversions = LIST
Specifies a list of paths (wildcards such as * and ? are supported) for which no versioning should be used. Only useful when
recycle:versions is enabled.
EXAMPLES
Move files "deleted" on share to /data/share/.recycle instead of deleting them:
[share]
path = /data/share
vfs objects = recycle
recycle:repository = .recycle
recycle:keeptree = yes
recycle:versions = yes
VERSION
This man page is correct for version 3.0.25 of the Samba suite.
AUTHOR
The original Samba software and related utilities were created by Andrew Tridgell. Samba is now developed by the Samba Team as an Open
Source project similar to the way the Linux kernel is developed.
Samba 4.0 06/17/2014 VFS_RECYCLE(8)