03-19-2015
Compare size of one file with other file in Linux
Hi,
I have 32 files for which I want to check size of each file withe other file and if size is same then some action.
Any suggestion to write such script.
Logic:
- have list of 32 files
- using loop first compare size of one file with remaining 31 ,
- do same iteration for each file with other .
- if a==b match found then compare content of files
- if both condition satisfies then rename first file as back and create touch file
- end.
Thanks
Last edited by rbatte1; 03-19-2015 at 02:23 PM..
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Is possible if I want to campare file size on source and destination after ftp transfer?
If anybody know, please explain to me. (1 Reply)
Discussion started by: icemania
1 Replies
2. Shell Programming and Scripting
Hi guys,
firstly I'm working on SunOS 5.10 Generic_125100-10 sun4u sparc SUNW,Sun-Fire-V240
I've made a script to compress two directory and then send them to an other server via ftp. This is working very well.
Inside theis script I decide to log usefull data for troubleshooting in case of... (7 Replies)
Discussion started by: moustik
7 Replies
3. Shell Programming and Scripting
I have two file in a Directory.I want a script which will compare the Size of Two file.
Can Anyone Help me on this:
linasplg11:/opt/dataout/kk/linasplg11 # cat size
-rwxrwxrwx 1 root root 16658 Jan 8 13:58 lina_IP_SIP_1231325621210.xml
-rwxr-xr-x 1 root root 16672 Jan 8 14:30... (1 Reply)
Discussion started by: Aditya.Gurgaon
1 Replies
4. Shell Programming and Scripting
hi,
i am new to this site.
i want to write a script to compare the file size of the files in the current dir with the files in the previous directory.
the files name will be same, but the filename format will be as xyzddddyymm.txt. the files will arrive with the month end date(i want to... (5 Replies)
Discussion started by: tweety
5 Replies
5. What is on Your Mind?
Dear fellows,
I have Centos 5.4 linux with DNS server, all logs are normal, in my /var/log/ btmp files is getting larger day by day.
What is this btmp file for?
How can i reduce the file siez or control file size.
Waiting.
MAZ (1 Reply)
Discussion started by: maz
1 Replies
6. Shell Programming and Scripting
i need to backup a directory from one partition to another and and compress that directory after backing up, so i need to predict the compressed size of the directory with out actually compressing it, to check whether the space is available in the destination partition to accommodate the zipped... (2 Replies)
Discussion started by: Kesavan
2 Replies
7. UNIX for Dummies Questions & Answers
Hi,
I'm using PSFTP to transfer files from one machine to a virtual machine with UBUNTU OS installed on it.
I'm trying to find a way to make sure the files that I'm uploading / downloading are being uploaded/ downloaded properly.
I want to compare the size of the local file and the remote... (0 Replies)
Discussion started by: sessie
0 Replies
8. Shell Programming and Scripting
I am pretty new to scripting, so I appreciate your advice in advance.
The problem:
100 directories each containing 2 files that have the same extension with random names. The only attribute that discriminates the files is size. I would like to write a script that compares the files for size... (6 Replies)
Discussion started by: JC_1
6 Replies
9. Linux
Hi friends,
I tried to take a backup of my PC using tar command. But it ended with an error
tar: /home/backup/back.tar.gz: Cannot write: No space left on device
tar: Error is not recoverable: exiting now
But i checked the disk space and there is enough space is available.
]# df
Filesystem... (11 Replies)
Discussion started by: siva3492
11 Replies
10. Shell Programming and Scripting
// Redhat
I have this code working, but need to add one more qualification so that I don't overwrite the files.
#!/bin/sh
cd /P2/log/cerner_prod/millennium/archive/
for f in *
do || continue #If this isn't a regular file, skip it.
&& continue #If a backup already... (2 Replies)
Discussion started by: Daniel Gate
2 Replies
TUNA(8) System Administration Utilities TUNA(8)
NAME
tuna - program for tuning running processes
SYNOPSIS
tuna [OPTIONS]
DESCRIPTION
This manual page explains the tuna program. The program can be used to change the attributes of application and kernel threads. The tuna
can operate on IRQs by name or number, and tasks or threads by process ID or command-line. CPUs and sets of CPUs can be specified by CPU or
socket number. IRQ names and process command-lines can include wildcards.
tuna can change scheduling policy, scheduler priority and processor affinity for processes and process threads. tuna can also change the
processor affinity for interrupts. When tuna is invoked without any options it starts up in its graphical interface mode. This manual page
explains only the command-line options for tuna
OPTIONS
tuna has both action options and modifier options. Modifier options must be specified on the command-line before the actions they are
intended to modify. Any modifier option applies to following actions on the same command-line until it is over-ridden.
Actions
-h, --help
Print a list of options. tuna will exit after this action, ignoring the remainder of the command-line.
-g, --gui
Start the GUI. Actions that follow this on the command-line will be processed without waiting for the GUI to complete.
-a, --config_file_apply=profilename
Apply changes described in profile
-l, --config_file_list
List preloaded profiles
-i, --isolate
Move all threads away from CPU-LIST. Requires -c or -S.
-I, --include
Allow all threads to run on CPU-LIST. Requires -c or -S.
-m, --move
Move selected entities to CPU-LIST. Requires -c and either -t or -q.
-p, --priority=[POLICY:]RTPRIO
Set thread scheduler tunables: POLICY and RTPRIO. POLICY is one of OTHER, FIFO, RR, or BATCH. Requires -t.
-P, --show_threads
Show thread list.
-s, --save=FILENAME
Save kthreads sched tunables to FILENAME.
-v, --version
Show version
-W, --what_is
Provides help about selected entities. Requires -t.
-x, --spread
Spread selected entities over CPU-LIST. Requires at least one of -t or -q. The specified threads and IRQs are each assigned to one
cpu in CPU-LIST.
Modifiers
-c, --cpus=CPU-LIST
CPU-LIST affected by commands. Requires a CPU number or a comma-separated list of CPU numbers.
-C, --affect_children
Operation will affect children threads.
-f, --filter
Disable display of selected CPUs in --gui. Requires -c
-G, --cgroup
Display the processes with the type of cgroups they are in. Requires -P
-K, --no_kthreads
Operations will not affect kernel threads.
-q, --irqs=IRQ-LIST
IRQ-LIST affected by commands. Requires an IRQ number or a comma-separated list of IRQ numbers.
-S, --sockets=CPU-SOCKET-LIST
CPU-SOCKET-LIST affected by commands. Requires a socket number or a comma-separated list of socket numbers.
-t, --threads=THREAD-LIST
THREAD-LIST affected by commands. Requires a thread number or thread name, or a comma-separated list of thread numbers and/or names.
Thread names may contain wildcards. Be sure to quote or escape any wildcard specifications.
-U, --no_uthreads
Operations will not affect user threads.
USAGE EXAMPLES
If for instance the Ethernet NICs have multiple queues for both receive and transmit, each with its own IRQ, the Ethernet IRQs can be asso-
ciated with a CPU socket:
tuna -S 2 -i -q 'eth*' -x
Move everything off the CPUs in socket 2, then spread the IRQs for the Ethernet devices acrross those same CPUs.
tuna February 2010 TUNA(8)