01-28-2010
Do you have only 5 lines in your file and do you want to discard the last line?
Please elaborate your question.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi,
I have a file which has special characters. I can't see them when I "vi" the file. But I am sure there are some special un seen characters. How can I see them?
Please help.
Thx (6 Replies)
Discussion started by: jingi1234
6 Replies
2. UNIX for Dummies Questions & Answers
Hi,
I have a data like this in a file,
402003279034002000100147626030003300010000000000002000029000000 ær^M^\MÍW^H
I need to replace those special char to some other char like # or $
Is there any ways to do it...
I tried commands tr,sed and many but it was not able to replace because... (1 Reply)
Discussion started by: solai
1 Replies
3. UNIX for Dummies Questions & Answers
I don't now exactly how I did it, but I created a file named " -C "
cexdi:/home1 $ls -lt
total 1801336
-rw------- 1 cexdi ced-group 922275840 23 mars 10:03 -C
How do I delete this file ?
cexdi:/home1 $rm -C
rm: invalid option -- C
Syntax : rm filename ...
Doesn't work...... (5 Replies)
Discussion started by: yveslagace
5 Replies
4. Shell Programming and Scripting
Environment: Sun UNIX
Language: Bourne Shell
Problem:
I am writing a script that allows user to key in a directory. Example: /root/tmp.
Since the user can key in anything he/she wants, I need to validate to make sure that he/she does not key in anything funny i.e.... (37 Replies)
Discussion started by: totziens
37 Replies
5. Shell Programming and Scripting
Hey Everyone,
I'm quite new to unix (hence the 0 posts!) and im trying to write a simple program that outputs what the user types in to the screen, as long as it is a letter.
This part works fine, however, when a "\" is entered doesnt not display anything and moves to the next line. Is... (11 Replies)
Discussion started by: ultiron
11 Replies
6. Shell Programming and Scripting
I made menu script for users so they can run other script without going in shell just from menu.
But i must control their input.
These are criteria:
Input must have 4 signs
First two signs are always lower case letters
Input shall not have some special signs just letters and numbers
... (1 Reply)
Discussion started by: waso
1 Replies
7. Shell Programming and Scripting
Hello All,
I am facing challenges in order to transfer a file from windows to unix box,the file contains a special character '×' ,now when I am transferring the file from windows to unix that special character converted to something else like 'Ã' ,another thing I have noticed that the hardware is... (1 Reply)
Discussion started by: prarat
1 Replies
8. Red Hat
Hi Guys,
We receive some huge files on to Linux server. Source system use FTP mechanism to transfer these files on our server. Occasionally one record is getting corrupted while transfer, some control characters are injecting into the file. How to fix this issue ? please advice ?
Sample... (2 Replies)
Discussion started by: srikanth38
2 Replies
9. Shell Programming and Scripting
Hi All, I am a newbie to Shell scripting. I have a requirement to Delimit the file fields of a Input file having special characters and spaces with ";".
Input File
----------------------------------
Server Port
----------------------------------
Local ... (5 Replies)
Discussion started by: Suganbabu
5 Replies
10. UNIX for Beginners Questions & Answers
I am trying to rename files with spaces and other characters and not able to be successful.
FileNames:
UPLOAD REFERENCE.xls
UPLOAD MASS REFERENCE.XLS
find /UPLOAD REFERENCE/ -depth -type f -name "* *" -exec rename " " "_" "{}" ";"
The above one is successful to replace spaces... (1 Reply)
Discussion started by: eskay
1 Replies
LEARN ABOUT DEBIAN
fstrim
FSTRIM(8) System Administration FSTRIM(8)
NAME
fstrim - discard unused blocks on a mounted filesystem
SYNOPSIS
fstrim [-o offset] [-l length] [-m minimum-free-extent] [-v] mountpoint
DESCRIPTION
fstrim is used on a mounted filesystem to discard (or "trim") blocks which are not in use by the filesystem. This is useful for solid-
state drives (SSDs) and thinly-provisioned storage.
By default, fstrim will discard all unused blocks in the filesystem. Options may be used to modify this behavior based on range or size,
as explained below.
The mountpoint argument is the pathname of the directory where the filesystem is mounted.
OPTIONS
The offset, length, and minimum-free-extent arguments may be followed by binary (2^N) suffixes KiB, MiB, GiB, TiB, PiB and EiB (the "iB" is
optional, e.g. "K" has the same meaning as "KiB") or decimal (10^N) suffixes KB, MB, GB, PB and EB.
-h, --help
Print help and exit.
-o, --offset offset
Byte offset in filesystem from which to begin searching for free blocks to discard. Default value is zero, starting at the begin-
ning of the filesystem.
-l, --length length
Number of bytes after starting point to search for free blocks to discard. If the specified value extends past the end of the
filesystem, fstrim will stop at the filesystem size boundary. Default value extends to the end of the filesystem.
-m, --minimum minimum-free-extent
Minimum contiguous free range to discard, in bytes. (This value is internally rounded up to a multiple of the filesystem block
size). Free ranges smaller than this will be ignored. By increasing this value, the fstrim operation will complete more quickly
for filesystems with badly fragmented freespace, although not all blocks will be discarded. Default value is zero, discard every
free block.
-v, --verbose
Verbose execution. When specified fstrim will output the number of bytes passed from the filesystem down the block stack to the
device for potential discard. This number is a maximum discard amount from the storage device's perspective, because FITRIM ioctl
called repeated will keep sending the same sectors for discard repeatedly.
fstrim will report the same potential discard bytes each time, but only sectors which had been written to between the discards would
actually be discarded by the storage device. Further, the kernel block layer reserves the right to adjust the discard ranges to fit
raid stripe geometry, non-trim capable devices in a LVM setup, etc. These reductions would not be reflected in fstrim_range.len
(the --length option).
AUTHOR
Lukas Czerner <lczerner@redhat.com>
Karel Zak <kzak@redhat.com>
SEE ALSO
mount(8)
AVAILABILITY
The fstrim command is part of the util-linux package and is available from ftp://ftp.kernel.org/pub/linux/utils/util-linux/.
util-linux November 2010 FSTRIM(8)