Sponsored Content
Top Forums UNIX for Advanced & Expert Users Which cut command is more efficient? Post 302507360 by Corona688 on Wednesday 23rd of March 2011 04:07:16 PM
Old 03-23-2011
Quote:
Originally Posted by sumoka
combining cat & Cut will cause spawning and will utilize more CPU threads which is fine for smaller files.
Not so much "fine" as "negligible".
Quote:
In case of bigger files as in my case, it is better to directly operate the Cut command on the file. This will result in optimum CPU utilization.
Correct. It's a bad habit in general -- test data tends to be small so the problem isn't apparent, only when you make it do real work will you run into trouble.
This User Gave Thanks to Corona688 For This Post:
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

cut command

how do you show just the used disk space. using the cut and df command?? or does anyone have any other suggestions on how to do it a better way? (3 Replies)
Discussion started by: rookie22
3 Replies

2. Shell Programming and Scripting

Cut command

Hi, I want to cut from a particular position to a particular position and retain the rest. I tried this cut -c31-51 file1.txt > file2.txt But The characters from the position 31 to 51 were only present in file2.txt. Is there a way to reverse this i.e to retain the rest except from... (1 Reply)
Discussion started by: ragavhere
1 Replies

3. Shell Programming and Scripting

Help with cut command

Gurus, I need help with the cut command : I have a file with garbage charaters at the beginning of each record; but these characters are not of the same length; First record has 3 garbage chars to be removed; rest have 2; If the length was consistent across all the records, I could have... (3 Replies)
Discussion started by: tru_tell
3 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. 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

6. Shell Programming and Scripting

Cut command

hi, i have a file abc,"an,ab",cde,efg abc,anab,cde,efg and need to cut the second field so the output should be abc,cde,efg and i have used cut -d',' -f1-1,3- but its giving me abc,ab",cde,efg abc,cde,efg (4 Replies)
Discussion started by: ATWC
4 Replies

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

8. Shell Programming and Scripting

Combining awk command to make it more efficient

VARIABLE="jhovan 5259 5241 0 20:11 ? 00:00:00 /proc/self/exe --type=gpu-process --channel=5182.0.1597089149 --supports-dual-gpus=false --gpu-driver-bug-workarounds=2,45,57 --disable-accelerated-video-decode --gpu-vendor-id=0x80ee --gpu-device-id=0xbeef --gpu-driver-vendor... (3 Replies)
Discussion started by: SkySmart
3 Replies

9. Shell Programming and Scripting

Efficient way to combine command

im currently running the following command to grab all arguments in front of a script, directly from the process table. # cat /tmp/allmyprocs ubuntu 9933 27793 0 03:29 pts/0 00:00:00 /bin/sh ./prying.sh ubuntu 9941 9933 0 03:29 pts/0 00:00:00 sh ubuntu 9952 9941 0 03:29... (1 Reply)
Discussion started by: SkySmart
1 Replies
unix_master(9r) 														   unix_master(9r)

NAME
unix_master - General: Forces execution onto the master CPU SYNOPSIS
void unix_master( void ); ARGUMENTS
None DESCRIPTION
The unix_master routine forces execution of the kernel thread onto the master CPU (also called the boot CPU). In other words, unix_master binds the kernel thread to the master CPU. To release the kernel thread from the bind to the master CPU, call the unix_release routine. You can make recursive calls to unix_master as long as you make an equal number of calls to unix_release. The unix_master routine provides another way besides the simple and complex lock routines to make a kernel module symmetric multiprocessing (SMP) safe. Although calling unix_master is not optimal for performance on an SMP CPU, it does provide third-party kernel module writers with an easy way to make their modules SMP safe without using the lock routines. NOTES
Device drivers should not directly call the unix_master and unix_release routines. One exception to this recommendation is when you want a device driver's kernel threads to run only on the master CPU. This situation occurs when your driver creates and starts its own kernel threads and you set the d_funnel member of the associated dsent structure to the value DEV_FUNNEL. In this case, each kernel thread must call unix_master once to ensure that the kernel thread runs only on the master CPU. Remember to make a corresponding call to unix_release. CAUTIONS
To avoid deadlock, do not call the unix_master routine under the following circumstances: When holding a simple lock In the driver's inter- rupt service routine RETURN VALUES
None SEE ALSO
routines: unix_release(9r) unix_master(9r)
All times are GMT -4. The time now is 04:59 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy