|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today! |
|
#1
|
|||
|
|||
|
Using find command
How would I use find to display the names of all files in the /home subdirectory tree without displaying errors for files I can't read?
Is this correct? find /home -name * -print 2>/dev/null |
|
#2
|
||||
|
||||
|
IMPORTANT: which shell are you using? by bourne¦korn¦bash just try:
Quote:
or when working on YOUR home Quote:
the -print on SVR4 is obsolete
__________________
working on Solaris[5-9], preferred languages french and C. |
|
#3
|
||||
|
||||
|
well in bash, you could just do the following:
find /home -name "*" -print | grep -v "Permission denied" christo
__________________
. Spiration channels: Free scripts, programming tutorials and articles Dotcut alerts: Online Press cuttings / news alerts Clearprop: UK microlight school, wiltshire Uk dating: UK safe dating with Topdates About Christo . . |
|
#4
|
|||
|
|||
|
find /home -type f 2>/dev/null
or find /home -type f -ls 2>/dev/null or find /home -type f -exec ls -l {} \; 2>/dev/null and as guggach pointed out... get relative pathnames by changing to /home first and then doing "find ." (useful for backups...) |
|
#5
|
|||
|
|||
|
Quote:
sorry christo, who teached you that? find /home -name "*" : is a st..*y AND will not find dotfiles -print IS OBSOLETE (i repeat) grep -v "Permission denied" NEVER heard about 2>/dev/null |
|
#6
|
||||
|
||||
|
Quote:
woah easy, dude... it was just a fleeting poke at a solution. Probably it wasn't the best, but it's just what tricked off my fingers at the time. christo |
![]() |
| Viewing: Dev Shed Forums > Operating Systems > UNIX Help > Using find command |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|