One could try something like:
If you change the values assigned to destination and source to pathnames to the destination and source directories you want to use and run the code as it is above, it will tell you which files it would select from the directory named by source to be moved to the directory named by destination, show you the sizes of the files being moved, and show you the mv commands that would be issued to move those files (without actually moving anything). If you try that and it looks like it is doing what you want, you can remove all of the code shown in red and the script will just silently move the oldest files it can find as long as the total size of the moved files is less than 3000000000 bytes.
This User Gave Thanks to Don Cragun For This Post:
Hi,
I have one file stat.
Stat file contents are as follows: for example.
H50768020040913,00260100,507680,13,0000000643,0000000643,00000,0000
H50769520040808,00260100,507695,13,0000000000,0000000000,00000,0000 H50770620040611,00260100,507706,13,0000000000,0000000000,00000,0000
Now i... (1 Reply)
hello Experts,can any one tell me that i have a folder data in linux.
and there are three files A,B,C in the directory.
cany any one tell me the command that which can tell me how much space is occupied by each file and its free space also
for example
FILES USED SPACE FREE SPACE
A ... (1 Reply)
Basic:
find . -type f -name “*.txt” -print | awk '{gsub("Ontem", "AntesdeOntem", $0); print > FILENAME}' *.txt
The idea is in folder /home/myapontamentos
I have some files and i need to change in all them the word "ontem" to "antesdeontem".
But bigger files are cut (size i mean)... (4 Replies)
hi,
i am facing a problem in merging two files using awk,
the problem is as stated below,
file1:
A|B|C|D|E|F|G|H|I|1
M|N|O|P|Q|R|S|T|U|2
AA|BB|CC|DD|EE|FF|GG|HH|II|1
....
....
....
file2 :
1|Mn|op|qr (2 Replies)
hello
i would like to copy files from 1 location to a nother, but it has only to copy files which are newer or have a different filesize.
all has to be logged to a copy.log file (als skipped files should be in the log)
is this possible with the cp command (1 Reply)
Hi guys,
I need to do 100 files comparison after I sorted the files. There are no specific key for sorting so i plan to arrange the files based on the file size. The command that i used to sort the files by size is as per below:-
ls -l | sort +4rn | awk '{print $5, $9}'
The problem that i... (3 Replies)
To find the whole size of a particular directory i use "du -sk /dirname".. but after finding the direcory's size how do i make conditions like if the size of the dir is more than 1 GB i hav to delete some of the files inside the dir (0 Replies)
Hello,
I want remove files have same size in a directory.
this command only find this files.
ls -l | awk '$1!~/^d/{if(size!=""){ print}size=$8}'
I want to remove the files of the same size.
samples: 5 files are same size. I want to keep only first file.
Thank you very much for your help. (3 Replies)
I am new to Unix and need help. I have several files of different sizes Example: 1 GB , 2GB , 500 mb ,200mb and even small sizes. What I want is I want to pick files and sum of the combined file size should be less than 3 Gb and move them to a different directory. when I do ls -ltr I want to pcik... (1 Reply)
Discussion started by: pyarigreat
1 Replies
LEARN ABOUT SUSE
pagesize
pagesize(1) User Commands pagesize(1)NAME
pagesize - display the size or sizes of a page of memory
SYNOPSIS
/usr/bin/pagesize [-a]
DESCRIPTION
The pagesize utility prints the default size of a page of memory in bytes, as returned by getpagesize(3C). This program is useful in con-
structing portable shell scripts.
OPTIONS
The following option is supported:
-a Prints out all possible hardware address translation sizes supported by the system.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWcsu |
+-----------------------------+-----------------------------+
SEE ALSO ppgsz(1), getpagesize(3C), getpagesizes(3C), attributes(5)SunOS 5.10 4 May 2001 pagesize(1)