![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to view my IP | blowFish@ubuntu | UNIX for Dummies Questions & Answers | 14 | 05-09-2008 06:35 AM |
| Listing directories and sub directories | jinxor | UNIX for Advanced & Expert Users | 3 | 03-11-2008 07:27 AM |
| moving directories to new directories on multiple servers | mackdaddy07 | Shell Programming and Scripting | 0 | 04-06-2007 08:30 AM |
| view all others terminals | vkandati | UNIX for Dummies Questions & Answers | 2 | 03-08-2005 04:27 PM |
| DBM View | schafferm | UNIX for Dummies Questions & Answers | 1 | 08-06-2002 01:18 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#8
|
|||
|
|||
|
have u tried dir command
type:- I cant understand what u looking for??? but i guess thats it...or u want to see files within dir also??? dir |
| Forum Sponsor | ||
|
|
|
#9
|
|||
|
|||
|
do u want this??
ls -ld mails |
|
#10
|
|||
|
|||
|
Displays all the directories (current location)
Append this in profile:
alias lsd='ls -1F $* | grep '/$' ' type lsd This will display all the directories. E.g.:- dir_a/ dir_b/ mails/ |
|
#11
|
||||
|
||||
|
Quote:
I'm an alias junkie.. I'll make sure I add that one Cheers |
|
#12
|
|||
|
|||
|
The given alias is quite ok for listings of the $PWD.
But if I remember correctly aliases (or better alii) are parameter ignorant. If you wish to pass parameters you need to define a shell function. For instance you could put this in your .shrc file. Code:
lsd() { ls -p $*|grep /\$; }
lsd /etc /var |
|
#13
|
|||
|
|||
|
Of course the classic way to list directories is simply to use find
e.g. for a recursive search find /var -type d But you could restrict the descent to inodes of the same filesystem find /var -xdev -type d Or even limit the depth of descent find /var -maxdepth 1 -type d But better consult your Unix's manpage of find because despite a common denominator the different finds all deviate slightly in their scope and syntax. Probably the widest functionality is offered by GNU find, as is part of findutils of Linux distros. Note also, if you run find with restricted permissions as far as read and execute of dirs is concerned that it's probably advisable to redirect stderr to /dev/null to prevent error messages cluttering your find results. |
|
#14
|
||||
|
||||
|
Quote:
I've never had a problem passing arg's to aliases. Consider the RH default, which aliases 'ls' to 'ls --color'.. Perhaps the problem is a "shell specific", one. In which case, we could chalk it up to another example of of how much bash RULES. |
||||
| Google The UNIX and Linux Forums |