I'm a complete beginner in UNIX (and not a computer science student either), just undergoing a tutoring course. Trying to replicate the instructions on my own I directed output of the ls listing command (lists all files of my home directory ) to My_dir.tsv file (see the screenshot) to make use of cut command so to have columns 1,3,4,9 cut (e.g. "left").
However when I'm trying to execute the command
nothing happens. I guess it's because the file isn't formatted properly with regard to implementing tabbed spaces. I imagined that automatic formatting, with the deployment of columns I see in output, emerging along with the result of ls is a .tsv file by default but I was wrong.
What should I do to make it work as intended? How do I make a real .tsv file of ls output?
I want to cut two coloums simulatiously and paste in some other file
for ex:
cut d ' ' -f3 -f4 xxx | paste yyy - > zzz;
from the above i want to cut two fileds 3 and 4 and paste as last coloums of single file (zzz).
how to solve this
regards
rajan (1 Reply)
I have a text:
dsj khfksjdh <time> EST 2006
ab cgnr jkkjt <time> EST 2006
gfhdgjghg <time> EST 2006
fkdjh kjhsekjrh kdjhfkh jhdfkhfdkjh kjdf <time> EST 2006
In the above file i need to extract time from every line... which is always the third from the last... Pls help!
Cheers,
Bouren (4 Replies)
Hello,
I would like to extract one or two fields of a line.
At the moment, I am extracting the first field of a line:
command | cut -f 1 -d '.' > file
The line can have two or three fields delimited with a dot.
if three fields, I want to be able to get the first two
ie if line =... (3 Replies)
I'm working on formatting some attendance data to meet a vendors requirements to upload to their system. With some help on the forums here, I have the data close. But they've since changed what they want.
The vendor wants me to submit three fields to them. Field 1 is the studentid field,... (4 Replies)
Hi
Can anyone what I am doing wrong while using cut command.
for f in *.log
do
logfilename=$f
Log "Log file Name: $logfilename"
logfile1=`basename $logfilename .log`
flength=${#logfile1}
Log "file length $flength"
from_length=$(($flength - 15))
Log "from... (2 Replies)
Hi,
I want to write a code that will cut everything that is under a couple of columns in a text file but so far I am not even close to achieve something like that.
Basically, I want to cut all the information from the columns and transfer the column information to a spread sheet.
I have... (1 Reply)
hay
i am trying to get JUST the PID from the ps command.
my command line is:
ps -ef | grep "mintty" | cut -d' ' -f2
but i get an empty line. i assume that the delimiter is not just one space character, but can't figure out what should i do in order to do that.
i know i can use awk or cut... (8 Replies)
Hi All,
I'm trying to view data using cut command for a fixed length file using the below command:
cut -c 1-3,4-5 FALCON_PIS_00000000.dat
I want to mention a separator say | (pipe) in between 1-3 and 4-5.
Please let me know how to achieve this.
Thanks in Advance, (3 Replies)
I am new to cut and I want to use the field option with a space delimiter on an Apache log file.
For example, if I wanted to find the 200 HTTP code using cut in this manner on the file below
cat access_abc.log | cut -d' ' -f7 | grep "200"
157.55.39.183 - - "GET /content/696-news041305... (4 Replies)
Discussion started by: sharingsunshine
4 Replies
LEARN ABOUT NETBSD
tabs
TABS(1) BSD General Commands Manual TABS(1)NAME
tabs -- set terminal tabs
SYNOPSIS
tabs [-n|-a|-a2|-c|-c2|-c3|-f|-p|-s|-u] [+m[n]] [-T type]
tabs [-T type] [+[n]] n1[,n2,...]
DESCRIPTION
The tabs utility displays a series of characters that first clears the hardware terminal tab settings and then initializes the tab stops at
the specified positions and optionally adjusts the margin.
The phrase "tab-stop position N" means that, from the start of a line of output, tabbing to position N shall cause the next character output
to be in the (N+1)th column on that line.
The following options are supported:
-n Specifies repetitive tab stops separated by a uniform number of columns, n, where n is a single digit decimal number. The
default usage of tabs with no arguments is equivalent to tabs -8. When -0 is used, the tab stops are cleared and no new ones
set.
-a Assembler, applicable to some mainframes. Equivalent to tabs 1,10,16,36,72 .
-a2 Assembler, applicable to some mainframes. Equivalent to tabs 1,10,16,40,72
-c COBOL, normal format. Equivalent to tabs 1,8,12,16,20,55
-c2 COBOL, compact format (columns 1 to 6 omitted). Equivalent to tabs 1,6,10,14,49
-c3 COBOL, compact format (columns 1 to 6 omitted), with more tabs than -c2. Equivalent to tabs
1,6,10,14,18,22,26,30,34,38,42,46,50,54,58,62,67
-f FORTRAN. Equivalent to tabs 1,7,11,15,19,23
-p PL/1. Equivalent to tabs 1,5,9,13,17,21,25,29,33,37,41,45,49,53,57,61
-s SNOBOL. Equivalent to tabs 1,10,55
-T type Indicates the type of terminal.
-u Assembler, applicable to some mainframes. Equivalent to tabs 1,12,20,44
EXIT STATUS
The tabs utility exits 0 on success, and >0 if an error occurs.
ENVIRONMENT
The COLUMNS and TERM environment variables affect the execution of tabs as described in environ(7).
The -T option overrides TERM. If neither TERM nor the -T option are present, tabs will fail.
SEE ALSO expand(1), stty(1), tput(1), unexpand(1), termcap(5)STANDARDS
The tabs utility conforms to IEEE Std 1003.1 (``POSIX.1'').
HISTORY
A tabs utility first appeared in PWB UNIX. This implementation was introduced in NetBSD 6.0.
AUTHORS
Roy Marples <roy@NetBSD.org>
BUGS
The current termcap(5) database does not define the set left soft margin 'ML' capability for any terminals.
BSD December 9, 2008 BSD