remove sections from each line of files
add an example, a script, a trick and tips
Bash command substitution not working as expected
The reason that it doesn't work is because
executed within a pipe. Therefore it doesn't "see" the underlying
terminal. In your script you could store the terminal width in a
size=`stty size | cut -d" " -f2`
and then use that next:
tail $FILE | cut -c -$size
In bash, how do I pass the while loops input to the cut command?
login=$(echo "$line" | cut -d : -f 1)
parts of lines from each FILE to standard output.
arguments to long options are mandatory for short options
select only these bytes
select only these
use DELIM instead of TAB for
select only these fields; also
print any line that contains no delimiter character, unless
the -s option is specified
complement the set of selected
bytes, characters or fields
do not print lines not
use STRING as the output
delimiter the default is to use the input delimiter
display this help and exit
output version information and
Use one, and
only one of -b, -c or
-f. Each LIST is made up of one range, or many
ranges separated by commas. Selected input is written in the
same order that it is read, and is written exactly once.
Each range is one of:
N’th byte, character or field, counted from 1
from N’th byte, character or field, to end of
from N’th to M’th (included) byte, character
from first to M’th (included) byte, character or
With no FILE,
or when FILE is -, read standard input.
Copyright © 2012 Free Software Foundation, Inc. License
GPLv3+: GNU GPL version 3 or later
This is free software: you are free to change and redistribute
it. There is NO WARRANTY, to the extent permitted by law.
Report cut bugs to bug-coreutils[:at:]gnu[:dot:]org
GNU coreutils home page:
General help using GNU software:
Report cut translation bugs to
documentation for cut is maintained as a Texinfo
manual. If the info and cut programs are
properly installed at your site, the command
coreutils 'cut invocation'
should give you
access to the complete manual.
David M. Ihnat, David MacKenzie, and Jim Meyering.