help abt cut command


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers help abt cut command
# 1  
Old 05-06-2008
help abt cut command

Hi friends,
I have a small doubt about cut command.

cut -f2 -d_

Can anybody tel me what does the underscore after 'd' stand for? Is it some kind of comment, coz I am not able to make out any difference when I executed the below command...

head -10 file.txt|cut -f2 -d_

It was printing all 10 records without any change no matter what the field was.
# 2  
Old 05-06-2008
it means your delimeter is _.
you are trying to get the second field. and your file is delimed by _
# 3  
Old 05-06-2008
I m sorry guys.. got to know my mistake Smilie
# 4  
Old 05-06-2008
Appreciate your quick response. I got to know my silly mistake. Thank you.
Quote:
Originally Posted by devtakh
it means your delimeter is _.
you are trying to get the second field. and your file is delimed by _
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. 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

2. 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

3. Shell Programming and Scripting

Learning abt Linux OS

hi guys, i got job recently in a company which provide a product for data backup and data recovery... as dis product is wrriten in c++ am workin in c++.. now am under training and i want to learn abt Operating System concepts and OS programming using c and c++. i know basic c and c++ programming... (0 Replies)
Discussion started by: senthil.march
0 Replies

4. 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

5. IP Networking

abt IP_ADD to DNS-- Plz help me:ASAP

Hello to forum memebers, Please help for below querry. I am new n/w programming ,I wan to know abt the how to change IP to Domain name thorugh Shell script. I am looking for ur reply. Plz......... advance thanks to Forum.:) (2 Replies)
Discussion started by: sivaranga001
2 Replies

6. Shell Programming and Scripting

Simple question abt Copy command.

Hi ! All This is very simple question.... How to write a 'cp' command interative. Example : cp /wlsuite/om/cm/Tools/deploy_scripts/*.xml ${INF_ROOT}/tmp | echo "" || echo " Pls investigate ..." My intent was > to copy the files. > CP fails... then let know the user. pls... (2 Replies)
Discussion started by: dashok.83
2 Replies

7. UNIX for Advanced & Expert Users

abt viewing all the columns in the output as it is..

Hi, How is it possible to get all the columns on the screen while v run a script.. Thr r abt 30 columns.. and whn i run the script the columns in the output r all messed up.. Please help.. Thanks.. RRVARMA (1 Reply)
Discussion started by: RRVARMA
1 Replies

8. UNIX for Dummies Questions & Answers

Some simple question abt Unix kernel

Dear all, I got some questions abt how does the Unix kernel work with the work with the other components. (step by step) Can any body tell me some info abt that? if can provide a example for each question that gonna be perfect! Thank you!!! 1. How file management system work together... (2 Replies)
Discussion started by: melbdavid
2 Replies

9. Gentoo

I want to learn & understand all abt LINUX

Salute 2 All. I am totally unknown in LINUX glaxy. There is any one whu can let me know abt LINUX. There is any one whu have a few time to help me for teaching LINUX I want to learn & understand all abt LINUX (5 Replies)
Discussion started by: AhsanPrince
5 Replies

10. Programming

Clarification abt .profile,config,env

Hi, I need to know the purpose of .profile,config and env file . what is the 1)similarties 2)difference between these 3. If env is not a file, when we give command env we are getting some information, from where or which file we are getting this... (0 Replies)
Discussion started by: sarwan
0 Replies
Login or Register to Ask a Question