basename – strip directory and suffix from filenames

A UNIX Command $basename basename: missing operand Try `basename –help’ for more information. $basename /usr/bin/ bin $basename /usr/ usr $ $basename /usr/bin/less less $basename /usr/include/ma malloc.h math.h $basename /usr/include/math.h math.h $basename /usr/include/math.h . math.h $basename /usr/include/math.h .h math $basename /usr/lib/libgccpp.so.1 libgccpp.so.1 $basename /usr/lib/libgccpp.so.1 .1 libgccpp.so $ UNIX Explanation `basename’ removes any leading directory components from …

truncate – shrink or extend the size of a file to the specified size

A UNIX Command $cat example.text hello $ls -l example.text -rw-r–r– 1 jeffrin jeffrin 6 Jun 21 02:32 example.text $truncate -s 10 example.text $ls -l example.text -rw-r–r– 1 jeffrin jeffrin 10 Jun 21 02:35 example.text $hexdump example.text 0000000 6568 6c6c 0a6f 0000 0000 000000a $cat example.text hello $truncate -s 9 example.text $ls -l example.text -rw-r–r– 1 …

touch -c behaves incorrectly (non-POSIX)

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=439033 POSIX says about ‘touch'[*]: -c Do not create a specified file if it does not exist. Do not write any diagnostic messages concerning this condition. [*] http://www.opengroup.org/onlinepubs/009695399/utilities/touch.html But under some conditions, ‘touch’ writes a diagnostic message when the file doesn’t exist. For instance: vin:~> mkdir dir vin:~> chmod 000 dir vin:~> /usr/bin/touch -c dir/file …

coreutils: ls –quoting-style=c and | (pipe) symbol

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=432945 output of ls –quoting-style=c is incorrect when filename contains | (pipe) symbol. Steps: mkdir /tmp/bla touch “/tmp/bla/filename with | pipe” ls –quoting-style=c /tmp/bla returns: “filename with \| pipe” thanks, -Mathieu Ref: http://groups.google.com/group/comp.lang.c/browse_thread/thread/0db8070def6a4453

coreutils: join outputs wrong field order for -v option

join – join lines of two files on a common field http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=410270 Package: coreutils Version: 5.97-5 Severity: normal the join field is incorrect for the -v version. #08-Thu-20-03-40 /tmp$ cat>|a #a1,a2,c3,a4,a5 #a21,a22,a33,a44,a55 #08-Thu-20-05-07 /tmp$ cat>|b #b1,b2,b3,c3,b5 #b21,b22,b33,b44,b55 #08-Thu-20-06-07 /tmp$ join -t, -i -1 3 -2 4 a b #c3,a1,a2,a4,a5,b1,b2,b3,b5 #08-Thu-20-06-10 /tmp$ join -v 2 -t, …