move contents of the current directory to the parent directory, then remove current directory.

mv * .[0-9a-Z]* ../; cd ..; rm -r $OLDPWD
I think this is less resource consuming than the previous examples

By: Elisiano
2010-11-12 11:03:58
cd mv rm

2 Alternatives + Submit Alt

What Others Think

I'm affraid a-Z is not doing what you think it does, as a is after Z in the ASCII order. Second problem with your command is that you don't test for the resultst of 'mv'. If, for a reason or another the move fails, you end up deleting all the files you wanted to move in the first place.
Baramin · 607 weeks ago
Even if you correct the glob to [0-9a-zA-Z]*, that still leaves a lot of possible filenames that would not be moved... what about a file named '.~foo'? or '. foo'? (dot space foo)?
bartonski · 602 weeks and 2 days ago
I discovered your blog post site on google and appearance many of your early posts. Always maintain on the really good operate. I just now extra increase your Feed to my MSN News Reader. Seeking forward to reading much more within you down the road!…">Cream chargers delivery in Manchester
nakav51247 · 9 weeks and 5 days ago
This particular is usually apparently essential and moreover outstanding truth along with for sure fair-minded and moreover admittedly useful My business is looking to find in advance designed for this specific useful stuffs… standing desk
KayGasaway · 9 weeks and 5 days ago
Took me time to read all the comments, but I really enjoyed the article. It proved to be Very helpful to me and I am sure to all the commenters here! It’s always nice when you can not only be informed, but also entertained! ????
KayGasaway · 9 weeks and 4 days ago
You have outdone yourself this time. It is probably the best, most short step by step guide that I have ever seen. trash chute spring
KayGasaway · 9 weeks and 1 day ago
We notion it really is a good idea to publish could anyone was initially having issues searching for however , My organization is a bit of dubious just have always been allowed to insert leaders together with contact regarding at this point.">Toronto Iron Railings
goxah55535 · 8 weeks and 5 days ago
We notion it really is a good idea to publish could anyone was initially having issues searching for however , My organization is a bit of dubious just have always been allowed to insert leaders together with contact regarding at this point. Toronto Iron Railings
goxah55535 · 8 weeks and 5 days ago
I really loved reading your blog. It was very well authored and easy to understand. Unlike other blogs I have read which are really not that good.Thanks alot! ??? ???
KayGasaway · 8 weeks and 4 days ago
You understand your projects stand out of the crowd. There is something unique about them. It seems to me all of them are brilliant. Nft games
KayGasaway · 3 weeks and 6 days ago
I admire this article for the well-researched content and excellent wording. I got so involved in this material that I couldn’t stop reading. I am impressed with your work and skill. Thank you so much. wilkinson chutes
Audrey10 · 3 weeks and 2 days ago
Thanks, that was a really cool read! nft projects
Audrey10 · 2 weeks and 4 days ago
This article was written by a real thinking writer. I agree many of the with the solid points made by the writer. I’ll be back. ACCT2288 Assessment 3
KayGasaway · 2 weeks and 3 days ago
Thanks for posting this info. I just want to let you know that I just check out your site and I find it very interesting and informative. I can't wait to read lots of your posts. small business cybersecurity consulting
KayGasaway · 2 weeks and 2 days ago
What a fantabulous post this has been. Never seen this kind of useful post. I am grateful to you and expect more number of posts like these. Thank you very much. ????
Audrey10 · 2 weeks and 2 days ago
Really a great addition. I have read this marvelous post. Thanks for sharing information about it. I really like that. Thanks so lot for your convene. Top Cambridge Attractions
fomajob · 2 weeks and 2 days ago
I found that site very usefull and this survey is very cirious, I ' ve never seen a blog that demand a survey for this actions, very curious... Buy Whisky online free delivery
Audrey10 · 1 week and 5 days ago
Wow i can say that this is another great article as expected of this blog.Bookmarked this site.. ugly cartoon characters
Audrey10 · 1 week and 1 day ago
Merely a smiling visitant here to share the love (:, btw outstanding style. Harga Beton Ready Mix Depok
KayGasaway · 6 days ago
This article gives the light in which we can observe the reality. This is very nice one and gives indepth information. Thanks for this nice article.
KayGasaway · 5 days ago
It is a fantastic post – immense clear and easy to understand. I am also holding out for the sharks too that made me laugh. what dinosaur has 500 teeth
KayGasaway · 4 days ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this? is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands

Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.


Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: