Results 1 to 4 of 4
Inside /proc/ folder, this
Code:
ls -l | cut -d' ' -f35 | grep ^1$ #35th field is folder names
finds folder "1" (init).
Is there a better way to ...
- 12-12-2010 #1Just Joined!
- Join Date
- Dec 2010
- Posts
- 15
[SOLVED] cut from ls -l
Inside /proc/ folder, this
finds folder "1" (init).Code:ls -l | cut -d' ' -f35 | grep ^1$ #35th field is folder names
Is there a better way to find folder names (rather than "cut" 35th (!) field)?Code:cut -d' ' -f35
Last edited by courteous; 12-12-2010 at 12:02 PM.
- 12-12-2010 #2Just Joined!
- Join Date
- Jul 2010
- Posts
- 26
I think that all the folders in /proc/ have the permissions :
so you can get the folder names by :Code:dr-xr-xr-x
Code:ls -l /proc/ | grep -e "dr-xr-xr-x" | cut -d: -f2 | cut -d' ' -f2
Last edited by Barakat; 12-12-2010 at 04:09 PM.
- 12-12-2010 #3
What about find /proc -type d -maxdepth 1?
Refining Linux Advent calendar: “24 Outstanding ZSH Gems”
- 12-12-2010 #4Just Joined!
- Join Date
- Dec 2010
- Posts
- 15
Thank you both Barakat and Manko!


