head that accepts gz files?

2009-12-01 Thread Peng Yu
I'm wondering if there is a similar program to 'head' that accepts gz files. (just as zgrep to grep)

how to replace tab by '\t' (literally) with tr?

2009-12-28 Thread Peng Yu
I have the following file head.txt. I'm wondering what the correct way is to change the tab to a backslash and the character 't'. $ tr \t \\t head.txt a a b c $ cat head.txt a a b c

How to make the colors different for a symbol link pointing to a file and symbol link pointing to a dir?

2009-12-30 Thread Peng Yu
alias dir='ls --color=auto --format=vertical' The above alias doesn't distinguish the color for a symbol link pointing to a file and a symbol link pointing to a dir. I'm wondering if there is a way to configure it to do so?

Re: How to make the colors different for a symbol link pointing to a file and symbol link pointing to a dir?

2009-12-30 Thread Peng Yu
On Wed, Dec 30, 2009 at 7:34 PM, Eric Blake e...@byu.net wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to Peng Yu on 12/30/2009 4:09 PM: alias dir='ls --color=auto --format=vertical' The above alias doesn't distinguish the color for a symbol link pointing to a file

Re: How to make the colors different for a symbol link pointing to a file and symbol link pointing to a dir?

2009-12-30 Thread Peng Yu
On Wed, Dec 30, 2009 at 8:47 PM, Eric Blake e...@byu.net wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to Peng Yu on 12/30/2009 7:30 PM: Use dircolors (as in adding the line: eval `dircolors path/to/preferences` http://linux.die.net/man/5/dir_colors According

Re: How to make the colors different for a symbol link pointing to a file and symbol link pointing to a dir?

2009-12-31 Thread Peng Yu
On Thu, Dec 31, 2009 at 9:31 AM, Chris Jones cjns1...@gmail.com wrote: On Thu, Dec 31, 2009 at 07:28:05AM EST, Eric Blake wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to Chris Jones on 12/30/2009 11:26 PM: But pardon my ignorance, where exactly do you specify LINK target?

How to ls (sorted by file size)?

2009-12-31 Thread Peng Yu
I don't see an option that sorts ls result by file size. Could somebody let me know if there is such an option?

How to overwrite the destination directory by 'cp'?

2010-01-21 Thread Peng Yu
Suppose I have directory a and b, the following command will copy the content of a to b/a, rather than overwrite the directory 'b' by the directory 'a'. I'm wondering if there is an option to overwrite 'b'? cp -r a b

How to create an empty file?

2010-01-25 Thread Peng Yu
'touch' will not make the file size empty if the file is not empty. I don't not want to use 'rm -f' first then touch because I might accidentally remove something if I type anything wrong. Could somebody let me a better way to create an empty file?

How to print the target of a symbolic link?

2010-03-06 Thread Peng Yu
'ls -l' shows the symbolic link and its target. I could parse the output. But I'm wondering whether there is a convenient command that only print the target if it is a symbolic link otherwise print nothing? Thank you for your help.

bug#6138: mv while maintaining relative symbolic links

2010-05-07 Thread Peng Yu
I'm wondering if there is any tool that can do almost exact the same thing as mv, but it can maintain symbolic links. mv doens't maintain relative symbolic links. For example, I have file /tmp/A/file1.txt and a symbolic link /tmp/file1.txt that point to A/file.txt (by the relative path). If I mv

bug#6138: mv while maintaining relative symbolic links

2010-05-08 Thread Peng Yu
On Fri, May 7, 2010 at 5:03 PM, Bob Proulx b...@proulx.com wrote: severity 6138 wishlist thanks Peng Yu wrote: I'm wondering if there is any tool that can do almost exact the same thing as mv, but it can maintain symbolic links. mv doens't maintain relative symbolic links. For example, I

bug#6138: mv while maintaining relative symbolic links

2010-05-10 Thread Peng Yu
On Mon, May 10, 2010 at 4:37 AM, Voelker, Bernhard bernhard.voel...@siemens-enterprise.com wrote: Peng Yu wrote: I agree with you that this is may not be possible for whole file system. But under the assumptions that symbolic links and their targets are always in a number of directories (user

bug#6251: How only show time of files with ls?

2010-05-22 Thread Peng Yu
ls -go gives me permission and file sizes. But I only want to show time and file names. Would you please let me know what command to use? -- Regards, Peng

bug#6356: How to avoid showing the 'total' line with wc -l?

2010-06-05 Thread Peng Yu
When I use wc -l *.txt, it show the total number of lines at the end. I don't necessary need this last line. Is there a way to disable it? -- Regards, Peng

bug#6379: process substitution with a give suffix

2010-06-08 Thread Peng Yu
On Tue, Jun 8, 2010 at 1:02 PM, Greg Wooledge wool...@eeg.ccf.org wrote: On Tue, Jun 08, 2010 at 12:53:47PM -0500, Peng Yu wrote: I have a program that only accept argument with a give suffix ./program xxx.suffix If I use process substitution, which gives me /dev/fd/xx, it will not work

bug#6393: The meaning of --key of sort command?

2010-06-10 Thread Peng Yu
Hi, I don't think that I completely understand what key means. In the following example, I thought that --key=2 should order the lines by the 2nd letter in each line without reordering the lines with the same 2nd letter. But it turns out my understanding is not correct. For example, u a was

bug#6393: The meaning of --key of sort command?

2010-06-10 Thread Peng Yu
On Thu, Jun 10, 2010 at 11:39 AM, Peng Yu pengyu...@gmail.com wrote: Hi, I don't think that I completely understand what key means. In the following example, I thought that --key=2 should order the lines by the 2nd letter in each line without reordering the lines with the same 2nd letter

bug#6394: Is it possible to reorder fields with cut?

2010-06-10 Thread Peng Yu
Hi, I need to reorder the fields in a file. But the -f option can not be used to reorder field 1 and field 2. Basically, I want the original 1st field as the new 2nd field and the original 2nd field the first. Is reordering fields possible with cut. $ cat input.txt a b c e f

bug#6395: How sort based on a list of fields?

2010-06-10 Thread Peng Yu
Hi, -k option of sort only allow a range of files. But I would like a list of fields. For example, field 7, field 3 then field 8. Would you please let me know how to do it? -- Regards, Peng

bug#6405: cp from -MM to -M

2010-06-11 Thread Peng Yu
I'm trying to cp -MM to -M. But so far I don't have a way to do it. Would you please let me know what is the correct way to cp from -MM to -M? $ cp -r -- -MM/ -- -M cp: target `-M' is not a directory $ ll -go total 0 drwx-- 2 64 2010-06-11 14:35 -MM -- Regards, Peng

bug#6442: About the modifier of -k option in sort

2010-06-16 Thread Peng Yu
Hello, The modifiers of -k are discussed in the examples in 'info sort' rather than in the main entry of -k. I feel that this be improved by clearly describe each modifier under the main entry of -k. It is not very clear to how many modifiers there are. -- Regards, Peng

bug#6442: About the modifier of -k option in sort

2010-06-17 Thread Peng Yu
2010/6/17 Pádraig Brady p...@draigbrady.com: On 17/06/10 03:07, Peng Yu wrote: Hello, The modifiers of -k are discussed in the examples in 'info sort' rather than in the main entry of -k. I feel that this be improved by clearly describe each modifier under the main entry of -k

bug#6554: [coreutils] Additional suffix for split

2011-02-13 Thread Peng Yu
On Fri, Jul 2, 2010 at 2:51 PM, Eric Blake ebl...@redhat.com wrote: [adding bug-coreutils, to create a bug id to track this by] On 06/15/2010 09:23 PM, Peng Yu wrote: I need to add an additional common suffix to the files splited by split. Right now, I have to use mv to do so. But I feel

bug#9611: Copy an item with its parent directory

2011-09-27 Thread Peng Yu
Hi, Suppose I have a file 'a/b/c/d/e/f', I want to copy it to 'target' with the parent 'd/e'. I.e., the resulted file is 'target/d/e/f'. I can make a bash script to do so, but I wondering if there is an existing command or option. Thanks! -- Regards, Peng

bug#13075: fifo unlimited buffer size?

2012-12-03 Thread Peng Yu
Hi, I have the following script. When the number to the right of 'seq' is large (as 10 in the example), the script will hang. But when the number is small (say 1000), the script can be finished correctly. I suspect that the problem is that there is a limit on the buffer size for fifo. Is it