Results 1 to 10 of 11
when i drop a directory i want this directory listed?
how can i do that.
thx...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 09-17-2003 #1Linux Newbie
- Join Date
- Mar 2003
- Location
- Istanbul/Türkiye
- Posts
- 246
automatically list
when i drop a directory i want this directory listed?
how can i do that.
thxJust a Newbie....Looking 4 Info....
- 09-17-2003 #2Linux Engineer
- Join Date
- Jan 2003
- Location
- Lebanon, pa
- Posts
- 994
alias cd="cd $1; ls"
Probaby want to put that line in your .bashrc file.
- 09-17-2003 #3Linux Newbie
- Join Date
- Mar 2003
- Location
- Istanbul/Türkiye
- Posts
- 246
Thanks alot.
Exactly i ll do.Just a Newbie....Looking 4 Info....
- 09-22-2003 #4Linux Newbie
- Join Date
- Mar 2003
- Location
- Istanbul/Türkiye
- Posts
- 246
Ooops that just list the directory doesnt drop it !
It seems ok but why it doesnt work?,
for example when i am in
/root
and i want to drop and list the directory
/linux which is under /root it just list the directory /root/linux and stay in /root ??Just a Newbie....Looking 4 Info....
- 09-22-2003 #5Linux Engineer
- Join Date
- Apr 2003
- Location
- Sweden
- Posts
- 796
What do you mean with drop?? Do you want to remove a directory you use
To list a directory you executeCode:rmdir or rm -rf <dirname>
Do you want to list and remove directorys in a program/script?? A little more info please.Code:ls -l <dirname>
Regards
Andutt
- 09-22-2003 #6Linux Guru
- Join Date
- Oct 2001
- Location
- Täby, Sweden
- Posts
- 7,578
Try this instead:
Code:function cd () { command cd $1; ls; }
- 09-23-2003 #7Linux Newbie
- Join Date
- Mar 2003
- Location
- Istanbul/Türkiye
- Posts
- 246
with drop i mean "get in" like
Originally Posted by andutt
cd directory-name
ls directory-name
i want an alias for this..
thx all of you and Dolda i ll try your suggestion.Just a Newbie....Looking 4 Info....
- 10-01-2003 #8Linux Newbie
- Join Date
- Mar 2003
- Location
- Istanbul/Türkiye
- Posts
- 246
thx Dolda your suggestion worked properly except ls' color function so i added ls --color=always....
but why the other aliases didnt work?Just a Newbie....Looking 4 Info....
- 10-11-2003 #9Linux Guru
- Join Date
- Oct 2001
- Location
- Täby, Sweden
- Posts
- 7,578
That is because aliases can't take parameters; they are like macro expansions. Therefore, if you run the following:
That would be the same as running this:Code:alias cd="cd $1; ls" cd testdir
(That is because in the current shell, $1 is the empty string, and testdir as just inserted after "cd $1; ls").Code:cd ; ls testdir
- 10-16-2003 #10Linux Newbie
- Join Date
- Mar 2003
- Location
- Istanbul/Türkiye
- Posts
- 246
Got it. Thx Dolda and everyone who replied my question.
I have to study too much
Just a Newbie....Looking 4 Info....


Reply With Quote
