How to identify the oldest files - by modification time stamp? By UniqueID (if in increasing order)?
EDIT: OK, let's postpone the file identification question for now. I'd prefer a different approach. Your file names seem not to contain any white spaces, so deploying xargs seems safe.
After having determined the file count in /tmp/test having dropped below 30 just like Aia proposed, how about
? Should your system's config parameter LINE_MAX be exceeded with the resulting command line, add the -n option to xargs like e.g. -n50. Remove echo when happy with the proposed result.
Hi,
I would like to write a shell script that moves files from one folder to another without retrieving the error 'can not find file or folder' when the folder is empty.
Any ideas,
Thx in advance,
Steven. (8 Replies)
Hello folk,
I want to move some *.jpg and *.JPG to some folder but i want move from current path not from subdirectories, wants to move 200 days old file.
it will go in /dir/aa/target/*.jpg|*.JPG but not go inside /dir/aa/target/other-directories,
Plese help (2 Replies)
Hey, this might be a really basic question, but I'm new to Unix scripting.
I'm trying to find a command to replicate a file structure from one location to another & move the actual files contained in the base directories, i.e. I have this structure -
home/temp/test/dir1/ ... (3 Replies)
Hi,
I have a sub directory with a number of files and folders. What i want is a subdirectory with just folders and not files for cleanliness sake. So I want to move the files into the new folder but keep the folders in the same place. Move all files (but not folders) to new folder.
I am... (4 Replies)
There are around 13 files in folder1.I need to move these files to another folder folder2,one file at a time, after checking whether a file exists in another folder folder3.
If a file exists in folder3, we should not move files from folder1 to folder2.
If there are no files in folder3, we need... (1 Reply)
I want to move all the files inside a directory to another directory which is inside that directory. Please help.
Note: I want to move only the files. Note the folders. Thanks in advance. (4 Replies)
Hi,
I want to move files like *.txt to another filesystem on the same server only when the disk usage reaches 80% or more. But need to keep the latest 5 files. After that delete from the original. How to proceed?
Please help
Gav... (5 Replies)
I want to move a folder with spaces from one folder to another.
I have two folders like this,
1).RT_032-222 -4444-01/ 2). RT_032-555 -7777-01/
I want to move files from 2 to 1 through shell script.Here I want to assign this like a user defined variable like as Source branch... (2 Replies)
Hi Team,
I am new to shell script and there is a requirement where files should be moved from Subfolder to parent folder.
Eg:
parent folder --> /Interface/data/test/IN
Sub folder -->/Interface/data/test/IN/Invoice20180607233338
Subfolder will be always with timestamp... (6 Replies)
Discussion started by: srivarun15
6 Replies
LEARN ABOUT SUNOS
rmf
RMF(1) [nmh-1.5] RMF(1)NAME
rmf - remove an nmh folder
SYNOPSIS
rmf [+folder] [-interactive | -nointeractive] [-version] [-help]
DESCRIPTION
Rmf removes all of the messages (files) within the specified (or default) folder, and then removes the folder (directory) itself.
If there are any files within the folder which are not a part of nmh, they will not be removed, and an error will be produced. If the
folder is given explicitly or the -nointeractive option is given, then the folder will be removed without confirmation. Otherwise, the
user will be asked for confirmation. If rmf can't find the current folder, for some reason, the folder to be removed defaults to `+inbox'
(unless overridden by user's profile entry "Inbox") with confirmation.
If the folder being removed is a subfolder, the parent folder will become the new current folder, and rmf will produce a message telling
the user this has happened. This provides an easy mechanism for selecting a set of messages, operating on the list, then removing the list
and returning to the current folder from which the list was extracted.
If rmf s used on a read-only folder, it will delete all the (private) sequences (i.e., "atr-seq-folder" entries) for this folder from your
context without affecting the folder itself.
Rmf irreversibly deletes messages that don't have other links, so use it with caution.
FILES
$HOME/.mh_profile The user profile
PROFILE COMPONENTS
Path: To determine the user's nmh directory
Current-Folder: To find the default current folder
Inbox: To find the default inbox
SEE ALSO rmm(1)DEFAULTS
`+folder' defaults to the current folder, usually with confirmation
`-interactive' if +folder' not given, `-nointeractive' otherwise
CONTEXT
Rmf will set the current folder to the parent folder if a subfolder is removed; or if the current folder is removed, it will make "inbox"
current. Otherwise, it doesn't change the current folder or message.
BUGS
Although intuitively one would suspect that rmf works recursively, it does not. Hence if you have a sub-folder within a folder, in order
to rmf the parent, you must first rmf each of the children.
MH.6.8 11 June 2012 RMF(1)