The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Problem count with wc-l command kunimi UNIX for Dummies Questions & Answers 2 02-27-2008 03:42 AM
byte count and cut command hemangjani Shell Programming and Scripting 4 04-12-2007 11:32 AM
command to count files in dir balireddy_77 Shell Programming and Scripting 4 11-15-2006 01:56 AM
May download a folder using wget command! ThrdF UNIX for Dummies Questions & Answers 1 02-15-2006 06:34 AM
zipped or unzipped file ted UNIX for Dummies Questions & Answers 3 06-25-2002 08:11 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 10-17-2007
arunkumar_mca arunkumar_mca is offline
Registered User
  
 

Join Date: Oct 2004
Posts: 255
command to get count in unzipped folder

Hi All,

Is there is a way to do this in a single unix command

I have unzipped some files into a directory ..

I want to check the count of the files in the directory and also i need to check whether the files is having read permision or not.. I know it can be done by a script isthere any way to it in a single command

Thanks,
Arun
  #2 (permalink)  
Old 10-17-2007
tomas's Avatar
tomas tomas is offline
Registered User
  
 

Join Date: Sep 2007
Posts: 35
you can use a semicolon ";" to separate commands. this allows you to run multiple commands in a single string. remember if you need the output of one command to be the input of another to use a pipe "|".

$ uncompress file; wc -l path/file; etc
  #3 (permalink)  
Old 10-17-2007
arunkumar_mca arunkumar_mca is offline
Registered User
  
 

Join Date: Oct 2004
Posts: 255
Thanks thomas ..

But i want to list the files only which has read permision

Thanks,
Arun
  #4 (permalink)  
Old 10-17-2007
porter porter is offline Forum Advisor  
Registered User
  
 

Join Date: Jan 2007
Posts: 2,965
Code:
man test

...

    -r file       True if file exists and is readable.
  #5 (permalink)  
Old 10-17-2007
matrixmadhan matrixmadhan is offline Forum Advisor  
Technorati Master
  
 

Join Date: Mar 2005
Location: leaf node in B+ tree
Posts: 2,944
Quote:
Originally Posted by arunkumar_mca View Post
Thanks thomas ..

But i want to list the files only which has read permision

Thanks,
Arun
Code:
ls -l | awk '{ if( substr($0, 2, 1) == "r" ) { print } }'
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 07:56 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0