Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Script to delete files line by line in .txt document Post 302909272 by fop4658 on Tuesday 15th of July 2014 10:53:51 PM
Old 07-15-2014
Script to delete files line by line in .txt document

Friends,

I am in need to delete files from a directory on a regular basis. I want to place all the files to be deleted in delete .txt file and require a script to delete files, line by line from this delete.txt file. Please help me with this script as am new to unix scripting.
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Command to delete numbers at beginning of txt file line

Hello. I have the following issue: my txt file has the following format: train/dr4/fklc0/sx175.txt 0 80282 Severe myopia contributed to Ron's inferiority complex. train/dr4/fklc0/sx355.txt 0 42906 Dolphins are intelligent marine mammals. train/dr4/fklc0/sa2.txt awk 'NR%2==0' test1.txt >... (4 Replies)
Discussion started by: li_bi
4 Replies

2. Shell Programming and Scripting

linux shell script to take variables from two different files line by line

Friends I need to have a shell script which will feed variables from two different files line-by-line. For example, I have two files - permission and file_name. Contents of permission is - 644 755 .... contents of file_name /file1 /file2 ..... Now I want 644 permission will be... (4 Replies)
Discussion started by: atanubanerji
4 Replies

3. Shell Programming and Scripting

Create different txt files per line

Hi All, I have a text file1.txt which looks like a9 a3 a4 ... and i want to create a seperate .txt files per each line. For example, output1.txt will have only one element "a9" output2.txt will have only one element "a3" ... Thanks, (1 Reply)
Discussion started by: senayasma
1 Replies

4. UNIX for Dummies Questions & Answers

shell script : log to txt and insert new line everytime

Hi, I have this script, while do ps ax|grep 5060 > log.txt echo " " sleep 1 done } I want to actually put a new line everytime the loop is executed in log.txt , but I do not know how to "embed" the echo " " inside the log.txt. (so to say... (1 Reply)
Discussion started by: peuceul
1 Replies

5. Shell Programming and Scripting

how to read the contents of two files line by line and compare the line by line?

Hi All, I'm trying to figure out which are the trusted-ips and which are not using a script file.. I have a file named 'ip-list.txt' which contains some ip addresses and another file named 'trusted-ip-list.txt' which also contains some ip addresses. I want to read a line from... (4 Replies)
Discussion started by: mjavalkar
4 Replies

6. Shell Programming and Scripting

Need to append the date | abcddate.txt to the first line of my txt file

I want to add/append the info in the following format to my.txt file. 20130702|abcd20130702.txt FN|SN|DOB I tried the below script but it throws me some exceptions. <#!/bin/sh dt = date '+%y%m%d'members; echo $dt+|+members+$dt; /usr/bin/awk -f BEGIN { FS="|"; OFS="|"; } { print... (6 Replies)
Discussion started by: harik1982
6 Replies

7. Shell Programming and Scripting

How to read a two files, line by line in UNIX script and how to assign shell variable to awk ..?

Input are file and file1 file contains store.bal product.bal category.bal admin.bal file1 contains flip.store.bal ::FFFF:BADC:CD28,::FFFF:558E:11C5,6,8,2,1,::FFFF:81C8:CA8B,::FFFF:BADC:CD28,1,0,0,0,::FFFF:81C8:11C5,2,1,0,0,::FFFF:81DC:3111,1,0,1,0 store.bal.... (2 Replies)
Discussion started by: veeruasu
2 Replies

8. UNIX for Dummies Questions & Answers

Split Every Line In Txt Into Separate Txt File, Named Same As The Line

Hi All Is there a way to export every line into new txt file where by the title of each txt output are same as the line ? I have this txt files containing names: Kandra Vanhooser Rhona Menefee Reynaldo Hutt Houston Rafferty Charmaine Lord Albertine Poucher Juana Maes Mitch Lobel... (2 Replies)
Discussion started by: Nexeu
2 Replies

9. UNIX for Beginners Questions & Answers

How can i add each line from a txt file to different files in the same directory?

Hello, this is my first thread here :) So i have a text file that contains words in each line like abcd efgh ijkl mnop and i have 4 txt files, i want to add each line to each file, like file 1 gets abcd at the end; file 2 gets efgh at the end .... I tried with: cat test | while read -r... (6 Replies)
Discussion started by: azaiiez
6 Replies
deluser.conf(5) 						File Formats Manual						   deluser.conf(5)

NAME
/etc/deluser.conf - configuration file for deluser(8) and delgroup(8). DESCRIPTION
The file /etc/deluser.conf contains defaults for the programs deluser(8) and delgroup(8). Each option takes the form option = value. Dou- ble or single quotes are allowed around the value. Comment lines must have a hash sign (#) at the beginning of the line. deluser(8) and delgroup(8) also read /etc/adduser.conf, see adduser.conf(8); settings in deluser.conf may overwrite settings made in adduser.conf. The valid configuration options are: REMOVE_HOME Removes the home directory and mail spool of the user to be removed. Value may be 0 (don't delete) or 1 (do delete). REMOVE_ALL_FILES Removes all files on the system owned by the user to be removed. If this option is activated REMOVE_HOME has no effect. Values may be 0 or 1. BACKUP If REMOVE_HOME or REMOVE_ALL_FILES is activated all files are backuped before they are removed. The backup file that is created defaults to username.tar(.gz|.bz2) in the directory specified by the BACKUP_TO option. The compression method is chosen to the best that is available. Values may be 0 or 1. BACKUP_TO If BACKUP is activated, BACKUP_TO specifies the directory the backup is written to. Default is the current directory. NO_DEL_PATHS A list of regular expressions, space separated. All files to be deleted in course of deleting home directories or deleting files owned by the user to be deleted are checked against each of these regular expressions. If a match is detected, the file is not deleted. Defaults to a list of system directories, leaving only /home. In other words: By default only files below /home belonging to that specific user are going to be deleted. ONLY_IF_EMPTY Only delete a group if there are no user who belong to this group. Defaults to 0. EXCLUDE_FSTYPES A regular expression which describes all file systems which should be excluded when looking for files of a user to be deleted. Defaults to "(proc|sysfs|usbfs|devpts|tmpfs|afs)". FILES
/etc/deluser.conf SEE ALSO
deluser(8), delgroup(8), adduser.conf(5) Debian GNU/Linux Version 3.113+nmu3 deluser.conf(5)
All times are GMT -4. The time now is 08:14 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy