LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   delete files which have no extensions (https://www.linuxquestions.org/questions/linux-newbie-8/delete-files-which-have-no-extensions-811103/)

sridhar.bodike 05-30-2010 01:15 PM

delete files which have no extensions
 
how to delete only files which have no extensions in the directories. but other files should exist.

jamescondron 05-30-2010 01:18 PM

Why...? I mean its easy enough, but are you sure?

sridhar.bodike 05-30-2010 01:22 PM

if it is easy for u dude then wat abt me its not easy for me thats d reason i asked the question if u know plz answer me.

jamescondron 05-30-2010 01:29 PM

Code:

man rm
or even

Code:

man find
will tell you. But I'm standing by it... are you absolutely sure thats what you want to do? Also, please don't use text talk on these forums; its often hard enough to understand what people mean without having to decipher further.

fruttenboel 05-30-2010 01:56 PM

Quote:

Originally Posted by sridhar.bodike (Post 3986454)
how to delete only files which have no extensions in the directories. but other files should exist.

Use the midnight commander (mc) from a terminal window.

jamescondron 05-30-2010 02:10 PM

Quote:

Originally Posted by fruttenboel (Post 3986481)
Use the midnight commander (mc) from a terminal window.

Not quite; OP wants a single line script. He/She could do it any number of ways without needing to ask if this were the case.

Not to mention that this requires mc, or installing it.

tredegar 05-30-2010 02:54 PM

Quote:

how to delete only files which have no extensions in the directories. but other files should exist.
It's a "homework" Q.

bkcreddy17 05-30-2010 09:09 PM

find . -type f ! -name "*.*" -exec rm '{}' \;

fruttenboel 05-31-2010 05:24 AM

Quote:

Originally Posted by jamescondron (Post 3986499)
Not quite; OP wants a single line script. He/She could do it any number of ways without needing to ask if this were the case.

Not to mention that this requires mc, or installing it.

In the original post is no reference to a single line of script. mc is installed always (afaik). mc is intuitive and failsafe. mc asks you if you are sure. mc is a fine program, also for experienced linuxers.

fruttenboel 05-31-2010 05:27 AM

Quote:

Originally Posted by tredegar (Post 3986553)
It's a "homework" Q.

yeah and we're fixing it so he can get an 'A' so he can steal our job in a few years.... :0(

Bratmon 05-31-2010 07:41 AM

Quote:

Originally Posted by fruttenboel (Post 3987198)
he can steal our job in a few years.... :0(

I don't think that will be an issue.

HasC 05-31-2010 09:04 AM

Quote:

Originally Posted by Bratmon (Post 3987294)
I don't think that will be an issue.

It won't. 'Cause if he/she ever stoles your job, the first thing he/she will do is post to LQ asking for help :D Just point his/her boss in the "right" direction (or hyperlink for that matter)

fruttenboel 06-01-2010 04:58 AM

Quote:

Originally Posted by HasC (Post 3987368)
It won't. 'Cause if he/she ever stoles your job, the first thing he/she will do is post to LQ asking for help :D Just point his/her boss in the "right" direction (or hyperlink for that matter)

Well, me and my friends (we publish about microcontroller programming) got sick and tired from the requests from India and Pakistan for help with their projects. The arrogance drips from these mails. They wanted it for free, immediate delivery, with full documentations and source code (tested to run of course).

We don't even look at these 'requests for help' anymore. Especially since an indian engineer, studying in UK, told us that many IED roadside explosives were based on simple microcontrollers like PIC and AVR8. Helping such a poor engineer might as well kill one of our own soldiers..

Lots of dutch companies have their research done in India. For the money. What they produce in results is aweful. Still, these guys are cheap and if you spawn 6 teams, one might come up with a sensible solution.


All times are GMT -5. The time now is 06:54 AM.