You are not logged in.
Pages: 1
I want to make an alias rmall for removing everything within a directory... I may be blatantly wrong, but i think the command for that is:
rm -d -R folder/* && rmdir folder
so i'd like to make an alias for rmall folder
Can i do this in the .bashrc file? or do I have to make an actual script?
Offline
i've never heard of it,
i don't think you need a script for it really, just run "rm -r folder" ,that should fix it,
arch + gentoo + initng + python = enlisy
Offline
Here's how to do alias defititions, from my .bashrc:
alias ls='ls --color'
alias lsa='ls --color --all'
alias reboot='sudo /sbin/reboot'
alias halt='sudo /sbin/halt'
alias pacman='sudo /usr/bin/pacman'
alias jedit='jedit -reuseview'
alias cdb='cd $(cat $HOME/.currentbuffer)'
alias rmpkg='rm -r filelist src/ pkg/ *.pkg.tar.gz'
And here's one way to do multiple commands, also in my .bashrc:
function cvsrm() {
rm $1
cvs remove $1
}
function tarpkg() {
name=`basename $1`
tar cf $name.tar $1
gzip $name.tar
}
But yes, rm -r will remove a directory and all its contents for you.
Dusty
Offline
if you want to use arguments for other stuff you should do as dusty shows with his functions examples,
arch + gentoo + initng + python = enlisy
Offline
great, thanks - btw where is the sudo file so that i can add my account to that list?
Offline
Offline
removing a dir and its contents can be done with
rm -rf dirname
Be careful! Don't try "rm -rf /" !
:: / my web presence
Offline
When I run Visudo, would it be a bad idea to grant myself all permissions?
Offline
Of course it would.
Hello girls, I like rock climbing, mountain biking and rafting! Write me!
Offline
Todd_Z, you may want to start reading some man pages and searching google a little before posting here. This is the Newbie Corner, and all questions are welcome, but work with Linux often requires an ability to research difficult questions. It helps to gain experience with easier questions than to get thrown into it when nobody has an answer.
http://www.catb.org/~esr/faqs/smart-que … tml#before
Dusty
Offline
Offline
Lol, its not serious. Newbie corner is a great place to post any sort of question. I was just suggesting research as an alternative to asking questions. You'll also find that its quicker in a lot of cases. ;-)
Dusty
Offline
You're also much more likely to remember something if you work it out yourself.
Offline
You're also much more likely to remember something if you work it out yourself.
I couldn't agree more - also, you tend to remember sites for reference and it helps improve search skills (which is a big deal, IMHO)
Offline
Pages: 1