Sponsored Content
Top Forums UNIX for Beginners Questions & Answers How do I use the cut command to only print the directories? Post 302983164 by rbatte1 on Friday 7th of October 2016 06:48:59 AM
Old 10-07-2016
Yes, apologies, I never thought of varying column widths when the byte count grows or the file age exceeds 6 months.

I suppose I could argue that if people insist on putting spaces in file names then, ..........



Robin
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Need help with Cut command

Hi I am using 'find' on a particular directory which has some subdirectories too,so when I search for .txt files from the parent directory, it gives all files that matches the pattern in the parent aswellas in the sub directories . eg: Iam at /a/b/c where c has many other directories in it ... (7 Replies)
Discussion started by: jagadish_gaddam
7 Replies

2. UNIX for Dummies Questions & Answers

cut and print part of a string

I have a file that contains: yahoo.com.23456 web.log.common.us.gov.8675 192.168.1.55.34443 john-doe.about.com.22233 64.222.3.4.120 sunny.ca.4442 how can i remove the strings after the last dot (.) and reprint the file? Thanks. (3 Replies)
Discussion started by: apalex
3 Replies

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

4. UNIX for Dummies Questions & Answers

Using grep command to find the pattern of text in all directories and sub-directories.

Hi all, Using grep command, i want to find the pattern of text in all directories and sub-directories. e.g: if i want to search for a pattern named "parmeter", i used the command grep -i "param" ../* is this correct? (1 Reply)
Discussion started by: vinothrajan55
1 Replies

5. Shell Programming and Scripting

Print the whole line which contains the result of the command cut

Hey everyone I have a file 'agenda' which contains: Object Day Month Year Birthday 09 02 2012 i want to extract from a script the line which contains the day the user typed. for example if he type 09 the line is showed using... (4 Replies)
Discussion started by: Goldstein
4 Replies

6. Shell Programming and Scripting

Print path files in different directories

Hi guys :) First of all Happy New Year :) so i dont know if my doubt its already here posted by other person ... i need to print to one file the path of few files that are in different directories, like this: directory muscle ATP6.aa.muscle.fasta COX1.aa.muscle.fasta . . . ... (2 Replies)
Discussion started by: andreia
2 Replies

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

8. UNIX for Dummies Questions & Answers

Print/cut/grep/sed/ date yyyymmdd on the filename only.

I have this filename "RBD_EXTRACT_a3468_d20131118.tar.gz" and I would like print out the "yyyymmdd" only. I use this command below, but if different command like cut or print....etc. Thanks ls RBD_EXTRACT* | sed 's/.*\(........\).tar.gz$/\1/' > test.txt (9 Replies)
Discussion started by: dotran
9 Replies

9. 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
eucset(1)						      General Commands Manual							 eucset(1)

NAME
eucset - set and get code widths for ldterm SYNOPSIS
HP15-codeset] or or or or [cswidth] ] DESCRIPTION
The command sets or gets (reports) the encoding and display widths of the Extended UNIX Code (EUC), UCS Transformation Format (UTF8), or GB18030 characters processed by the current input terminal. EUC is an encoding method for codesets composed of single or multiple bytes. EUC permits applications and the terminal hardware to use the 7-bit US ASCII code and up to three single byte or multibyte codesets simul- taneously. ldterm is a STREAMS terminal line discipline module which obtains codeset information from See ldterm(7). The cswidth value defines the character widths for codesets. If cswidth is not implicitly or explicitly defined by passing no argument to the command, the cswidth value is determined by the following criteria in descending priority: 1. Use the cswidth value stored in the current locale, if defined. 2. Use predefined cswidth values if the codeset name defined in the locale is GB18030, UTF8, or one of the four HP15 codesets. 3. Use the environment variable if defined and in the correct format. 4. Use 7-bit US ASCII as the default codeset and its cswidth value. This command must be used to specify EUC or non-EUC codesets, whether they are single byte or multibyte. However, the command can correctly set the cswidth parameter without using any options in most cases except for ASIAN_UTF8. See the section for special warnings on the val- ues of the cswidth argument. For the GB18030, ASIAN_UTF8, or UTF8 setting, use the option. Options The command recognizes the following options and arguments: Displays the current settings of the EUC character widths for the terminal. Sets the width to one of the four HP15 codesets, or or The HP15 codesets supported are and cswidth Defines the character widths for codesets 1 through 3. See the section in this manpage for more information. EUC Code Set Classes EUC divides codesets into four classes. Each codeset has two characteristics: the number of bytes for encoding the characters in the code- set, and the number of display columns to display the characters in the codeset. All characters within a codeset possess the same charac- teristics. ASIAN_UTF8 is used for setting double width display, and UTF8 is used for single width. o Codeset 0 consists of all 7-bit, single byte ASCII characters. The most significant bit of each of these characters is 0 (zero). Characters in codeset 0 require one byte for encoding, and occupy one display column. These values are fixed for codeset 0 (zero). The 7-bit US ASCII code is the primary EUC codeset, which is available to users without direct specification. o Codeset 1 is a supplementary EUC codeset. Codeset 1 characters have an initial byte whose most significant bit is 1. Characters in codeset 1 may require more than one byte for encoding, and may require more than one display column. The command must be used to set the characteristics for codeset 1. o Codesets 2 and 3 are supplementary EUC codesets. Characters in these codesets have an initial byte of SS2 or SS3, respectively. They require more than one byte for encoding, and may require more than one display column. The command must be used to set the characteristics for codesets 2 and 3. The cswidth argument in the command line is a character string that describes the character widths for codesets 1 through 3. This command does not allow the user to modify the settings for codeset 0. The character string is of the following format: X1[:Y1],X2[:Y2],X3[:Y3] X1 The number of bytes required to encode a character in codeset class 1. Y1 The number of display columns needed to display characters in this class. X2 The number of bytes required to encode a character in codeset 2, not counting the SS2 byte, Y2 The number of display columns for codeset 2 characters. X3 The number of bytes needed to encode characters in codeset 3, not counting the SS3 byte, Y3 The number of display columns required for these characters. The values for the column widths may be omitted if they are equal to the number of encoding bytes. If the encoding value of any of the EUC codesets is set to (zero), then the codeset does not exist. See the section for special warnings on the values of the cswidth argument. If no cswidth argument is supplied, the command uses the value of the environment variable. If this variable is not present, the following default string is substituted: This default string designates that the environment uses a single byte EUC codeset that has characters in the EUC codeset 1 format. If the environment uses a multibyte EUC codeset in the codeset 1 format, single byte or multibyte EUC codesets in the codeset 2 or 3 format, or both, the default setting cannot be used. EXTERNAL INFLUENCES
Environment Variables Provide a default value for the internationalization variables that are unset or null. If is not specified or is set to the empty string, a default of (see lang(5)) is used instead of If any of the internationalization variables contain an invalid setting, behaves as if all internation- alization variables are set to See environ(5). If set to a nonempty string value, override the values of all other internationalization variables. Determines the locale that should be used to affect the format and contents of diagnostic messages written to standard error and informative messages written to standard output. Determines the location of message catalogs for the processing of EXAMPLES
To display the encoding and display widths for the EUC codesets 1 to 3 in your environment, enter: Assuming has been previously used to set for the entry generates the following: To change the current settings of the encoding and display widths for the EUC characters in codesets 1 and 2 to two bytes each, enter one of the following: To set the encoding and display widths for the EUC characters in the locale enter: For enter: For enter: To set the code width to that of enter: To set the code width to that of enter: To set the code width to that of enter: WARNINGS
The cswidth argument does not include the SS2 or SS3 bytes in the byte width values. This command is not specified by standards, may not be available on other vendor's systems, and may be subject to change or obsolescence in a future release. AUTHOR
was developed by OSF and HP. SEE ALSO
dtterm(1), ldterm(7). eucset(1)
All times are GMT -4. The time now is 09:53 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy