wc user error?

2010-02-20 Thread Faheem Mitha


I'm puzzled by this. What am I missing here?

Regards, Faheem.

fah...@avicenna:/home/cj35$ wc -l snpdb/illumina_cj35.fg_40101.map
620902 snpdb/illumina_cj35.fg_40101.map
fah...@avicenna:/home/cj35$ wc -l /home/cj35/snpdb/illumina_cj35.fg_40101.map
wc:  /home/cj35/snpdb/illumina_cj35.fg_40101.map: No such file or directory


Re: wc user error?

2010-02-20 Thread Andreas Schwab
Faheem Mitha  writes:

> wc:  /home/cj35/snpdb/illumina_cj35.fg_40101.map: No such file or directory
  ^

That character looks like a space, but is a no-break space character
(U00A0).

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




Re: -readable by who

2010-02-20 Thread jidanni
Gentlemen, some of these are clearer than man test or
(info "(coreutils) Access permission tests")
bash$ help test|grep you
  -r FILETrue if file is readable by you.
  -w FILETrue if the file is writable by you.
  -x FILETrue if the file is executable by you.
  -O FILETrue if the file is effectively owned by you.
  -G FILETrue if the file is effectively owned by your group.

Likewise, for find -readable, something should be done.
> "JY" == James Youngman  writes:
JY> On Wed, Jan 13, 2010 at 11:06 PM,   wrote:
>>       -readable
>>              Matches files which are readable...
>> Also mention "by the current user" I suppose.

JY> Since there is more than one possible interpretation of the "current
JY> user" this clarification doesn't help much, I think.




Re: wc user error?

2010-02-20 Thread Andreas Schwab
Faheem Mitha  writes:

> On Sat, 20 Feb 2010, Andreas Schwab wrote:
>
>> Faheem Mitha  writes:
>>
>>> wc:  /home/cj35/snpdb/illumina_cj35.fg_40101.map: No such file or directory
>>  ^
>>
>> That character looks like a space, but is a no-break space character
>> (U00A0).
>
> Wow. Nice catch. Just FYI, how did you detect this?

It's kind of a FAQ.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




Re: wc user error?

2010-02-20 Thread Faheem Mitha



On Sat, 20 Feb 2010, Andreas Schwab wrote:


Faheem Mitha  writes:


wc:  /home/cj35/snpdb/illumina_cj35.fg_40101.map: No such file or directory

 ^

That character looks like a space, but is a no-break space character
(U00A0).


Wow. Nice catch. Just FYI, how did you detect this?

Thanks, Faheem.


Andreas.

--
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."



How to only show symbol link with ls?

2010-02-20 Thread Peng Yu
I don't see an option to list only symbolic link with ls. Could
somebody let me know if there is such an option?




Re: How to only show symbol link with ls?

2010-02-20 Thread Eric Blake
According to Peng Yu on 2/20/2010 2:48 PM:
> I don't see an option to list only symbolic link with ls. Could
> somebody let me know if there is such an option?

What exactly do you mean?

If you want to list only the symbolic links, and nothing else, contained
in a directory, then find(1) is the tool to use, not ls.  And it appears
that you recently asked how to do that on the findutils list; did you read
the answers you got?
http://lists.gnu.org/archive/html/bug-findutils/2010-02/msg00018.html

If you want to list all files, but mark symbolic links with an indicator,
so that they stand out, you can use ls -F.

-- 
Don't work too hard, make some time for fun as well!

Eric Blake e...@byu.net



signature.asc
Description: OpenPGP digital signature


Re: How to only show symbol link with ls?

2010-02-20 Thread Jon Stanley
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Sat, Feb 20, 2010 at 4:48 PM, Peng Yu  wrote:
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Use GnuPG with Firefox : http://getfiregpg.org (Version: 0.7.10)

iEYEARECAAYFAkuAWqwACgkQcREpSR+FEY0GvwCfZg/wgHgnNEn5ZOKUAuE4IpOw
qWwAn0Wq7teBH+fj9o7VPz9VLj9IimaW
=zCaN
-END PGP SIGNATURE-


> I don't see an option to list only symbolic link with ls. Could
> somebody let me know if there is such an option?

I'm not quite sure of what you mean - you want to list only the
symbolic links in a given directory? ls has no facilities for that,
the UNIX way is tools that are tailored to a specific purpose.  For
this purpose, you likely want to use the 'find' utility, with the
'-type l' option.




Re: How to only show symbol link with ls?

2010-02-20 Thread Bob Proulx
Peng Yu wrote:
> I don't see an option to list only symbolic link with ls. Could
> somebody let me know if there is such an option?

I don't quite understand the nature of your question.  'ls' lists
files in directories.  There aren't specific options to 'ls' to only
list files of certain types.  For example there isn't a way to only
have 'ls' list out named pipes, or just directories, or just character
devices, and so on.  That isn't its job.

If you want to traverse a directory structure and select files based
upon specific attributes then you should use 'find' for this.  For
example to list out only symbolic links use something like this:

  $ ln -s bar foo
  $ find . -maxdepth 1 -type l -print
  ./foo

Almost any particular format can be produced using find's -printf with
the appropriate format specification.

Of course you can also pipe the output of 'ls' to a filter and select
based upon the strings.  I often do this.

  $ ls -Clog | grep ^l
  lrwxrwxrwx  1  3 2010-02-20 14:56 foo -> bar
  $ ls -Clog | grep ^d
  drwxr-xr-x  6   4096 2008-03-26 06:30 Maildir/

Bob




chmod directory mode extention

2010-02-20 Thread seaking1
Hello,

  I would like to suggest and offer the code to extend chmod in a small
way.  My extension merely allows for a different mode to be applied to
directories than the one applied to all other files.  I have looked for this
utility but never found it and being such a useful addition though it may be
possible to add it to the standard release.

  What it does: Add an option -d|--dirmode to chmod that will give all
directories in the files chmod is told to change the mode specified by the
-d argument instead of the other mode.
  Reason: I have found this to be a necessity.  Say for example I have a
directory structure filled with data files of some sort and they are of
assorted permissions; If I chmod -R 664 foo/ or something to that effect It
will of course give all the permissions 664 including directories hence
making them inaccessible.  With this is could run chmod -R -d 775 644 foo/
and give the directories the permissions 775.

Andy.


Re: chmod directory mode extention

2010-02-20 Thread Eric Blake
According to seaking1 on 2/20/2010 5:26 PM:
>   I would like to suggest and offer the code to extend chmod in a small
> way.  My extension merely allows for a different mode to be applied to
> directories than the one applied to all other files.

Thanks for the report.  However, it is difficult to justify adding new
features when, to some extent, such an option already exists.

> With this is could run chmod -R -d 775 644 foo/
> and give the directories the permissions 775.

Rather than using numeric permissions, you can use symbolic permissions.
For example, this usage is guaranteed by POSIX to grant directory search
permissions and to preserve file executable permissions where they already
existed, without granting it to non-executable files.

chmod -R ug+X,o-x foo/

-- 
Don't work too hard, make some time for fun as well!

Eric Blake e...@byu.net



signature.asc
Description: OpenPGP digital signature


Re: chmod directory mode extention

2010-02-20 Thread Alan Curry
seaking1 writes:
> 
> Hello,
> 
>   I would like to suggest and offer the code to extend chmod in a small
> way.  My extension merely allows for a different mode to be applied to
> directories than the one applied to all other files.  I have looked for this
> utility but never found it and being such a useful addition though it may be
> possible to add it to the standard release.
> 
>   What it does: Add an option -d|--dirmode to chmod that will give all
> directories in the files chmod is told to change the mode specified by the
> -d argument instead of the other mode.
>   Reason: I have found this to be a necessity.  Say for example I have a
> directory structure filled with data files of some sort and they are of
> assorted permissions; If I chmod -R 664 foo/ or something to that effect It
> will of course give all the permissions 664 including directories hence
> making them inaccessible.  With this is could run chmod -R -d 775 644 foo/
> and give the directories the permissions 775.

chmod -R ug=rwX,o=rX is pretty close to what you're asking for. The only
difference is that the X also adds x permission to files that already have at
least one x bit.

Your suggestion is more generalized, so no necessarily a bad idea. I just
mention this because lots of people overlook the +X option.

-- 
Alan Curry




Re: wc user error?

2010-02-20 Thread Faheem Mitha



On Sat, 20 Feb 2010, Andreas Schwab wrote:


Faheem Mitha  writes:


On Sat, 20 Feb 2010, Andreas Schwab wrote:


Faheem Mitha  writes:


wc:  /home/cj35/snpdb/illumina_cj35.fg_40101.map: No such file or directory

 ^

That character looks like a space, but is a no-break space character
(U00A0).


Wow. Nice catch. Just FYI, how did you detect this?


It's kind of a FAQ.


Sorry to trouble you, but can you give me a pointer to this?

  Thanks, Faheem.


Andreas.

--
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."