Usage cut command


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Usage cut command
# 1  
Old 02-01-2011
Usage cut command

cut command usages ??
i have a file named test
contents :
Code:
srikanth hyd 123
vinoth chn 234
vijay chn 345
hemanth hyd 456

Code:
$cut -f2 test

should display:
Code:
hyd
chn
chn 
hyd

but am gettg full file??

Last edited by Franklin52; 02-01-2011 at 08:41 AM.. Reason: Please use code tags
# 2  
Old 02-01-2011
Code:
cut -f2 -d' ' test

You have to set the delimiter to blank explicitly.
# 3  
Old 02-01-2011
yeah tried it got it..thanks
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Usage of '.' in MV command

Hi, Could you please let me know, why we should not use '.' in move command, if we use it, is it something wrong.. Please share the details on it. /home/rahualux/emp.csv /home/rahualux/details/employee_files/. Or other example for mutlipile files /home/rahualux/*.csv... (3 Replies)
Discussion started by: rahualux
3 Replies

2. UNIX for Beginners Questions & Answers

Cut command: can't make it cut fields

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... (9 Replies)
Discussion started by: scrutinizerix
9 Replies

3. UNIX for Dummies Questions & Answers

Cut pid from ps using cut command

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)
Discussion started by: ran ber
8 Replies

4. Shell Programming and Scripting

cp -v command usage?

I am trying to output a log file from cp usage. I think this can be achieved. In my code I have this. cp -i -v ~/files/* ~/backups/oldfiles/;; > ~/logs/logfile.logThe error I get is "syntax error near unexpected token '>' What am I missing? (7 Replies)
Discussion started by: gameinn
7 Replies

5. Shell Programming and Scripting

Cut Command error cut: Bad range

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)
Discussion started by: dgmm
2 Replies

6. UNIX for Dummies Questions & Answers

Command to display the space usage (memory usage) of a specific directory.

Hi all, Can you please tell me the command, with which one can know the amount of space a specific directory has used. df -k . ---> Displays, the amount of space allocated, and used for a directory. du -k <dir name> - gives me the memory used of all the files inside <dir> But i... (2 Replies)
Discussion started by: abhisheksunkari
2 Replies

7. AIX

How to monitor the IBM AIX server for I/O usage,memory usage,CPU usage,network..?

How to monitor the IBM AIX server for I/O usage, memory usage, CPU usage, network usage, storage usage? (3 Replies)
Discussion started by: laknar
3 Replies

8. HP-UX

how can I find cpu usage memory usage swap usage and logical volume usage

how can I find cpu usage memory usage swap usage and I want to know CPU usage above X% and contiue Y times and memory usage above X % and contiue Y times my final destination is monitor process logical volume usage above X % and number of Logical voluage above can I not to... (3 Replies)
Discussion started by: alert0919
3 Replies

9. UNIX for Dummies Questions & Answers

cut usage in bash

Hello, Could you put some light on this: > echo "ref_categorie=test" | cut -c1-15- test > echo "ref_categorie=test" | cut -c1-14- =test echo "ref_categorie=test" | cut -c15- test echo "ref_categorie=test" | cut -c15 t > It's executed on AIX if that matters. The man page is not very... (2 Replies)
Discussion started by: tsurko
2 Replies
Login or Register to Ask a Question