Sponsored Content
Full Discussion: largest file
Top Forums UNIX for Dummies Questions & Answers largest file Post 302364431 by pludi on Friday 23rd of October 2009 03:47:05 AM
Old 10-23-2009
Code:
du -ks * | sort -nr | head -1

 

10 More Discussions You Might Find Interesting

1. Programming

Finding largest file in current directory?

I was hoping to get some assistance with this C program I am working on. The goal is to find the largest file in the current directory and then display this filename along with the filesize. What I have so far will display all the files in the current directory. But, how do I deal with "grabbing"... (1 Reply)
Discussion started by: AusTex
1 Replies

2. Shell Programming and Scripting

file of largest size in pwd

How to find file of the largest size in pwd? (4 Replies)
Discussion started by: rameshparsa
4 Replies

3. Shell Programming and Scripting

find largest file

Hi, 1)I have XX directory and have lot of files ,I want to find largest file in that directory 2)how calculate the size of file in MB. Thanks, Mohan (15 Replies)
Discussion started by: mohan705
15 Replies

4. Shell Programming and Scripting

largest value from within a file

hi, i am having a file that looks like this : myhome111 oper 11 myhome333 oper 19 ... how can i get the largest value from this file ..in this example i am consiering 19 as the largest value.. how can i do that.. as this file is having other numbers also within it like 111, 333... (4 Replies)
Discussion started by: kripssmart
4 Replies

5. HP-UX

find the largest file in whole system

find the largest file in whole system (7 Replies)
Discussion started by: megh
7 Replies

6. Shell Programming and Scripting

Find and display largest file on system

What is the correct command for finding and displaying the largest file on the system? I don't know how to specify "largest" with "find", and pipe that to something that will display the file contents. Or should I be using cat, more, less, ls, or something else? (4 Replies)
Discussion started by: raidkridley
4 Replies

7. Shell Programming and Scripting

Command to find largest file.

Hi All, Is there a direct Linux command to find the largest file by checking recursively in all the directories. (3 Replies)
Discussion started by: paragkalra
3 Replies

8. Shell Programming and Scripting

To Find the largest file in the given directory.

Hi Experts, 1. In unix how to list the largest file in given directory. The answer will in single line statement. 2. I have Sun solaris live CD .I try to compile sample c program using "CC compiler".But its shows "cc command not found". Please help on this. Thanks in advance.... (4 Replies)
Discussion started by: kkl
4 Replies

9. Shell Programming and Scripting

Help with keep the largest record in file

Input file US Score 10 UK Ball 20 AS Score 50 AK Ball 10 PZ Ballon 50 PA Score 70 WT Data 10 . . Desired output file UK Ball 20 PZ Ballon 50 PA Score 70 WT Data 10 . . (1 Reply)
Discussion started by: perl_beginner
1 Replies

10. Shell Programming and Scripting

awk second largest, third largest value

I have two text files like this: file1.txt: 133 10 133 22 133 13 133 56 133 78 133 98 file2.txt: 158 38 158 67 158 94 158 17 158 23 I'm basically trying to have awk check the second largest value of the second column of each text file, and cat it to its own text file. There... (13 Replies)
Discussion started by: theawknewbie
13 Replies
PG_RESETXLOG(1) 					  PostgreSQL 9.2.7 Documentation					   PG_RESETXLOG(1)

NAME
pg_resetxlog - reset the write-ahead log and other control information of a PostgreSQL database cluster SYNOPSIS
pg_resetxlog [-f] [-n] [-o oid] [-x xid] [-e xid_epoch] [-m mxid] [-O mxoff] [-l timelineid,fileid,seg] datadir DESCRIPTION
pg_resetxlog clears the write-ahead log (WAL) and optionally resets some other control information stored in the pg_control file. This function is sometimes needed if these files have become corrupted. It should be used only as a last resort, when the server will not start due to such corruption. After running this command, it should be possible to start the server, but bear in mind that the database might contain inconsistent data due to partially-committed transactions. You should immediately dump your data, run initdb, and reload. After reload, check for inconsistencies and repair as needed. This utility can only be run by the user who installed the server, because it requires read/write access to the data directory. For safety reasons, you must specify the data directory on the command line. pg_resetxlog does not use the environment variable PGDATA. If pg_resetxlog complains that it cannot determine valid data for pg_control, you can force it to proceed anyway by specifying the -f (force) option. In this case plausible values will be substituted for the missing data. Most of the fields can be expected to match, but manual assistance might be needed for the next OID, next transaction ID and epoch, next multitransaction ID and offset, and WAL starting address fields. These fields can be set using the options discussed below. If you are not able to determine correct values for all these fields, -f can still be used, but the recovered database must be treated with even more suspicion than usual: an immediate dump and reload is imperative. Do not execute any data-modifying operations in the database before you dump, as any such action is likely to make the corruption worse. The -o, -x, -e, -m, -O, and -l options allow the next OID, next transaction ID, next transaction ID's epoch, next multitransaction ID, next multitransaction offset, and WAL starting address values to be set manually. These are only needed when pg_resetxlog is unable to determine appropriate values by reading pg_control. Safe values can be determined as follows: o A safe value for the next transaction ID (-x) can be determined by looking for the numerically largest file name in the directory pg_clog under the data directory, adding one, and then multiplying by 1048576. Note that the file names are in hexadecimal. It is usually easiest to specify the option value in hexadecimal too. For example, if 0011 is the largest entry in pg_clog, -x 0x1200000 will work (five trailing zeroes provide the proper multiplier). o A safe value for the next multitransaction ID (-m) can be determined by looking for the numerically largest file name in the directory pg_multixact/offsets under the data directory, adding one, and then multiplying by 65536. As above, the file names are in hexadecimal, so the easiest way to do this is to specify the option value in hexadecimal and add four zeroes. o A safe value for the next multitransaction offset (-O) can be determined by looking for the numerically largest file name in the directory pg_multixact/members under the data directory, adding one, and then multiplying by 65536. As above, the file names are in hexadecimal, so the easiest way to do this is to specify the option value in hexadecimal and add four zeroes. o The WAL starting address (-l) should be larger than any WAL segment file name currently existing in the directory pg_xlog under the data directory. These names are also in hexadecimal and have three parts. The first part is the "timeline ID" and should usually be kept the same. Do not choose a value larger than 255 (0xFF) for the third part; instead increment the second part and reset the third part to 0. For example, if 00000001000000320000004A is the largest entry in pg_xlog, -l 0x1,0x32,0x4B will work; but if the largest entry is 000000010000003A000000FF, choose -l 0x1,0x3B,0x0 or more. Note pg_resetxlog itself looks at the files in pg_xlog and chooses a default -l setting beyond the last existing file name. Therefore, manual adjustment of -l should only be needed if you are aware of WAL segment files that are not currently present in pg_xlog, such as entries in an offline archive; or if the contents of pg_xlog have been lost entirely. o There is no comparably easy way to determine a next OID that's beyond the largest one in the database, but fortunately it is not critical to get the next-OID setting right. o The transaction ID epoch is not actually stored anywhere in the database except in the field that is set by pg_resetxlog, so any value will work so far as the database itself is concerned. You might need to adjust this value to ensure that replication systems such as Slony-I work correctly -- if so, an appropriate value should be obtainable from the state of the downstream replicated database. The -n (no operation) option instructs pg_resetxlog to print the values reconstructed from pg_control and then exit without modifying anything. This is mainly a debugging tool, but can be useful as a sanity check before allowing pg_resetxlog to proceed for real. The -V and --version options print the pg_resetxlog version and exit. The options -? and --help show supported arguments, and exit. NOTES
This command must not be used when the server is running. pg_resetxlog will refuse to start up if it finds a server lock file in the data directory. If the server crashed then a lock file might have been left behind; in that case you can remove the lock file to allow pg_resetxlog to run. But before you do so, make doubly certain that there is no server process still alive. PostgreSQL 9.2.7 2014-02-17 PG_RESETXLOG(1)
All times are GMT -4. The time now is 08:04 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy