Sponsored Content
Top Forums Shell Programming and Scripting Use of awk/sed to filter out fdisk output Post 302899255 by omkar.jadhav on Monday 28th of April 2014 07:43:00 AM
Old 04-28-2014
Hi Ravinder,

Please find the below 2 forms in which outputs are required

Disk /dev/sda:255 heads

and

Disk /dev/sda:63 sectors/track

That is one command which can give count of heads and another for providing sectors/track.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

filter parts of a big file using awk or sed script

I need an assistance in file generation using awk, sed or anything... I have a big file that i need to filter desired parts only. The objective is to select (and print) the report # having the string "apple" on 2 consecutive lines in every report. Please note that the "apple" line has a HEX... (1 Reply)
Discussion started by: apalex
1 Replies

2. Shell Programming and Scripting

Urgent! Sed/Awk Filter Find Pattern Delete Till End Of Line

Hi, I need help with using an awk or sed filter on the below line ALTER TABLE "ACCOUNT" ADD CONSTRAINT "ACCOUNT_PK" PRIMARY KEY ("ACCT_ID") USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE(INITIAL 65536 FREELISTS 1 FREELIST GROUPS 1) TABLESPACE "WMC_DATA" LOGGING ENABLE Look for... (2 Replies)
Discussion started by: rajan_san
2 Replies

3. Shell Programming and Scripting

Need to build a grep/sed/awk filter

Hi I need to to direct only the path and the name of the trace file to a new file. How do I use grep/awk/sed filter? eg. ABC.root>cat alert_omc_dg.log | grep trc ORA-00060: Deadlock detected. More info in file /u01/oradata/omc/udump/omc_dg_ora_3555.trc. ORA-00060: Deadlock detected. More... (8 Replies)
Discussion started by: geetap
8 Replies

4. UNIX for Dummies Questions & Answers

How can we identify SAN devices in fdisk -l output.?

We can Know the storage devices in fdisk -l. But Please tell me how can i identify the SAN devices :wall: How SAN devices are represented in the fdisk -l output :wall::wall: Thanks in Advance........:D (3 Replies)
Discussion started by: vamshigvk475
3 Replies

5. Shell Programming and Scripting

Use of awk to filter out the command output

Hi All, I am trying to find out number of cores present for hp-ux server from the output of print_manifest (as shown below). i suppose awk will be best tool to use for filtering. output of print_manifest is : System Hardware Model: ia64 hp Integrity Virtual Partition ... (6 Replies)
Discussion started by: omkar.jadhav
6 Replies

6. Shell Programming and Scripting

Use of awk or sed to filter out the ouput

Hi, i am trying to get the system model with the help of awk : $ prtconf | awk '/^System Model/' System Model: IBM,8408-E8D but i want just the below outout that is command should chk for pattern <IBM,> and remove it from the final output : System Model:8408-E8D Can... (2 Replies)
Discussion started by: omkar.jadhav
2 Replies

7. Red Hat

Make a disk disappear from fdisk output

Hello, 1 ) Fdisk -l # Displays all the disk with partition table information My Query ) A ) How can i make one disk ex: /dev/sdd not visible in fdisk -l output ? B) From where fdisk -l collect and display the information ? (8 Replies)
Discussion started by: saurabh84g
8 Replies

8. Shell Programming and Scripting

Complex Filter using grep, awk or sed

Hi, I'm not very familiar witrh sed or awk and hope the somebody can help me to solve my problem. I need to filter a text report using grep, sed or awk. I would like to cut out text lines with the pattern INFO and if exists the following lines of the pattern DETAILS. I need te keep the lines with... (4 Replies)
Discussion started by: Frankg
4 Replies

9. Shell Programming and Scripting

Awk/sed/cut to filter out records from a file based on criteria

I have two files and would need to filter out records based on certain criteria, these column are of variable lengths, but the lengths are uniform throughout all the records of the file. I have shown a sample of three records below. Line 1-9 is the item number "0227546_1" in the case of the first... (15 Replies)
Discussion started by: MIA651
15 Replies

10. Shell Programming and Scripting

awk or sed or grep filter a line and/or between strings

Hi, I have multiple files on a directory with the following content: blahblah blahblah hostname server1 blahblah blahblah ---BEGIN--- aaa bbb ccc ddd ---END--- blahblah blahblah blahblah I would like to filter all the files with awk or sed or something else so I can get below... (6 Replies)
Discussion started by: bayupw
6 Replies
NEWFS_MSDOS(8)						    BSD System Manager's Manual 					    NEWFS_MSDOS(8)

NAME
newfs_msdos -- construct a new MS-DOS (FAT) file system SYNOPSIS
newfs_msdos [-N] [-B boot] [-F FAT-type] [-I volid] [-O OEM] [-S sector-size] [-a FAT-size] [-b block-size] [-c cluster-size] [-e dirents] [-f format] [-h heads] [-i info] [-k backup] [-m media] [-n FATs] [-o hidden] [-r reserved] [-s total] [-u track-size] [-v volume-name] special [disktype] DESCRIPTION
The newfs_msdos utility creates a FAT12, FAT16, or FAT32 file system on device special, using disktab(5) entry disktype to determine geome- try, if required. The options are as follows: -N Don't create a file system: just print out parameters. -B boot Get bootstrap from file. -F FAT-type FAT type (one of 12, 16, or 32). -I volid Volume ID. -O OEM OEM string (up to 8 characters). The default is "BSD 4.4" (with two spaces). -S sector-size Number of bytes per sector. Acceptable values are powers of 2 in the range 128 through 32768. -a FAT-size Number of sectors per FAT. -b block-size File system block size (bytes per cluster). This should resolve to an acceptable number of sectors per cluster (see below). -c cluster-size Sectors per cluster. Acceptable values are powers of 2 in the range 1 through 128. -e dirents Number of root directory entries (FAT12 and FAT16 only). -f format Specify a standard (floppy disk) format. The eight standard formats are (capacities in kilobytes): 160, 180, 320, 360, 640, 720, 1200, 1232, 1440, 2880. -h heads Number of drive heads. -i info Location of the file system info sector (FAT32 only). A value of 0xffff signifies no info sector. -k backup Location of the backup boot sector (FAT32 only). A value of 0xffff signifies no backup sector. -m media Media descriptor (acceptable range 0xf0 to 0xff). -n FATs Number of FATs. Acceptable values are 1 to 16 inclusive. The default is 2. -o hidden Number of hidden sectors. -r reserved Number of reserved sectors. -s total File system size, in sectors. -u track-size Number of sectors per track. -v volume-name Volume name (filesystem name), up to 11 characters. The name should consist of only those characters permitted in regular DOS (8+3) filenames. NOTES
FAT file system parameters occupy a "Boot Sector BPB (BIOS Parameter Block)" in the first of the "reserved" sectors which precede the actual file system. For reference purposes, this structure is presented below. struct bsbpb { u_int16_t bps; /* [-S] bytes per sector */ u_int8_t spc; /* [-c] sectors per cluster */ u_int16_t res; /* [-r] reserved sectors */ u_int8_t nft; /* [-n] number of FATs */ u_int16_t rde; /* [-e] root directory entries */ u_int16_t sec; /* [-s] total sectors */ u_int8_t mid; /* [-m] media descriptor */ u_int16_t spf; /* [-a] sectors per FAT */ u_int16_t spt; /* [-u] sectors per track */ u_int16_t hds; /* [-h] drive heads */ u_int32_t hid; /* [-o] hidden sectors */ u_int32_t bsec; /* [-s] big total sectors */ }; /* FAT32 extensions */ struct bsxbpb { u_int32_t bspf; /* [-a] big sectors per FAT */ u_int16_t xflg; /* control flags */ u_int16_t vers; /* file system version */ u_int32_t rdcl; /* root directory start cluster */ u_int16_t infs; /* [-i] file system info sector */ u_int16_t bkbs; /* [-k] backup boot sector */ }; EXAMPLES
newfs_msdos /dev/disk0s1 Create a file system, using default parameters, on /dev/disk0s1. newfs_msdos -f 1440 -v foo fd0 Create a standard 1.44M file system, with volume name "foo", on /dev/fd0. SEE ALSO
fdisk(8), mount(8) DIAGNOSTICS
Exit status is 0 on success and 1 on error. HISTORY
The newfs_msdos command appeared in FreeBSD 3.0. AUTHORS
Robert Nordier <rnordier@FreeBSD.org>. BSD
July 6, 1998 BSD
All times are GMT -4. The time now is 06:22 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy