Browse
Hewlett Packard Enterprise Community
Sign In
Help
Community Home
>
Servers and Operating Systems
>
Operating Systems
>
Operating System - HP-UX
>
Re: How to do an ls and show the path
Options
Subscribe to RSS Feed
Mark Topic as New
Mark Topic as Read
Float this Topic for Current User
Bookmark
Subscribe
Printer Friendly Page
All community
This category
This board
Knowledge base
Users
cancel
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Showing results for
Search instead for
Did you mean:
How to do an ls and show the path
SOLVED
Go to solution
Carme Torca
Super Advisor
Mark as New
Bookmark
Subscribe
Subscribe to RSS Feed
Permalink
Print
Report Inappropriate Content
04-29-2008
06:25 AM
04-29-2008
06:25 AM
How to do an ls and show the path
Hi,
I would like to list all the directories and files of one dir.
Is there any instruccion to make it?
For exemple:
/tmp
/tmp/dir1
/tmp/dir1/file1
/tmp/dir2
/tmp/dir2/file1
/tmp/dir3
/tmp/file1
/tmp/file4
Thanks a lot of,
Carmen.
Users are not too bad ;-)
Solved!
Go to Solution.
All forum topics
Previous Topic
Next Topic
10 REPLIES
10
James R. Ferguson
Acclaimed Contributor
Mark as New
Bookmark
Subscribe
Subscribe to RSS Feed
Permalink
Print
Report Inappropriate Content
04-29-2008
06:29 AM
04-29-2008
06:29 AM
Re: How to do an ls and show the path
Hi Carmen:
One way:
# find /tmp
Regards!
...JRF...
James R. Ferguson
Acclaimed Contributor
Mark as New
Bookmark
Subscribe
Subscribe to RSS Feed
Permalink
Print
Report Inappropriate Content
04-29-2008
06:30 AM
04-29-2008
06:30 AM
Re: How to do an ls and show the path
Hi (again):
Of course, if you want to include more of the attributes, do:
# find /tmp -exec ls -ld {} \+
Regards!
...JRF...
Adam Winebaugh
Regular Advisor
Mark as New
Bookmark
Subscribe
Subscribe to RSS Feed
Permalink
Print
Report Inappropriate Content
04-29-2008
09:57 AM
04-29-2008
09:57 AM
Re: How to do an ls and show the path
Carme,
You can break it down even more say by size with:
find /opt -mount -mtime -1 -type f -ls -ld| awk '{ print $7 " " $11 }' | sort -n | tail -20
Many variables to manage and change though dependant on what you need.
Adam Winebaugh
Regular Advisor
Mark as New
Bookmark
Subscribe
Subscribe to RSS Feed
Permalink
Print
Report Inappropriate Content
04-29-2008
10:05 AM
04-29-2008
10:05 AM
Re: How to do an ls and show the path
My apologies I wrote the wrong command down. Here is what I meant! Sorry about that
find /tmp -type f -size +1000000c -exec ls -ld {} \; | sort -rn | more
Or you can switch sizes or names or whatever you want basically.
Adam Winebaugh
Regular Advisor
Mark as New
Bookmark
Subscribe
Subscribe to RSS Feed
Permalink
Print
Report Inappropriate Content
04-29-2008
10:10 AM
04-29-2008
10:10 AM
Re: How to do an ls and show the path
OR sorry to keep posting here, this is another way:
find /tmp -type f â xdev -size +1000000c -exec ls -ld {} \; | sort -rn | more
Ok I will leave you all alone now. Good Luck.
Sajjad Sahir
Honored Contributor
Mark as New
Bookmark
Subscribe
Subscribe to RSS Feed
Permalink
Print
Report Inappropriate Content
04-29-2008
10:10 AM
04-29-2008
10:10 AM
Re: How to do an ls and show the path
dear carme
see find command
man find
thanks and regards
sajjad
Bill Hassell
Honored Contributor
Mark as New
Bookmark
Subscribe
Subscribe to RSS Feed
Permalink
Print
Report Inappropriate Content
04-29-2008
11:23 AM
04-29-2008
11:23 AM
Re: How to do an ls and show the path
The simplest way is:
ls -R -1 /tmp
The ls man page is quite large with all the extra options.
Bill Hassell, sysadmin
john D_3
Frequent Advisor
Mark as New
Bookmark
Subscribe
Subscribe to RSS Feed
Permalink
Print
Report Inappropriate Content
04-29-2008
11:40 AM
04-29-2008
11:40 AM
Re: How to do an ls and show the path
ls -R *[1-4]*
Highlighted
john D_3
Frequent Advisor
Mark as New
Bookmark
Subscribe
Subscribe to RSS Feed
Permalink
Print
Report Inappropriate Content
04-29-2008
11:40 AM
04-29-2008
11:40 AM
Re: How to do an ls and show the path
ls -R /tmp/*[1-4]*
CharlesC
Advisor
Mark as New
Bookmark
Subscribe
Subscribe to RSS Feed
Permalink
Print
Report Inappropriate Content
04-29-2008
05:28 PM
04-29-2008
05:28 PM
Re: How to do an ls and show the path
I think "ls *" should do the trick already.
What if...