The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > OS Specific Forums > Linux
Google UNIX.COM


Linux RedHat, Ubuntu, SUSE, Fedora, Debian, Mandriva, Slackware, Gentoo linux, PCLinuxOS. All Linux questions here!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Help Required: Command to find IP address and command executed of a user loggedout Security 2 08-06-2008 05:12 PM
how to? launch command with string of command line options TinCanFury Shell Programming and Scripting 5 04-28-2008 03:06 PM
inconsistent ls command display at the command prompt & running as a cron job rajranibl Linux 5 07-30-2007 05:26 AM
How to use more than one MPE command STREAM with Unix command in a single shell? bosskr HP-UX 1 10-16-2006 01:16 PM
How to use more than one MPE command STREAM with Unix command in a single shell? bosskr Shell Programming and Scripting 0 09-19-2006 06:44 PM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1  
Old 07-23-2007
Registered User
 

Join Date: Jul 2007
Posts: 6
Lightbulb ls command

Hi there,
I am using command "ls -Rl" so it is giving me complete listing of directories including subdirectories,
can we modify the above ls command so that we can get the complete path alog with the directory name and subdirectory name.

thanks in advance

Manvar
Reply With Quote
Forum Sponsor
  #2  
Old 07-23-2007
sysgate's Avatar
Unix based
 

Join Date: Nov 2006
Location: /root
Posts: 1,197
It depends on your distro, Fedora has this, example :
If I invoke "ls -lR" at my home folder I will see :
Quote:
./builds/project/number/the-last-one
./cluster/man/
./cvs/root/project/units/case/number
So, if you enter certain folder, and invoke just "ls -lR" it will print the full path, but if you do "ls -lR some-folder" it will accept "some-folder" as base, and will lsit everything after with "some-folder" considered as main one.
For this issue, you should be able to find the answer in "man ls" once again, it depends on the distro.
Reply With Quote
  #3  
Old 07-23-2007
Registered User
 

Join Date: Jul 2007
Posts: 93
This should do the trick: ls -Rl `pwd`
Reply With Quote
  #4  
Old 07-23-2007
radoulov's Avatar
addict
 

Join Date: Jan 2007
Location: Milano, Italia/Варна, България
Posts: 1,859
With zsh:

Code:
print -l **/*
If you want hidden (dot) files to be included:

Code:
print -l **/*(D)
Reply With Quote
  #5  
Old 07-23-2007
blowtorch's Avatar
Supporter
 
Join Date: Dec 2004
Location: Singapore
Posts: 2,326
Quote:
Originally Posted by denn View Post
This should do the trick: ls -Rl `pwd`
There isn't really a need to run a command here. Most shells set the $PWD variable. You can just use that:
Code:
ls -lR $PWD
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 11:47 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0