Apr
14
2010

How to capture C and CPP files in the linux operating system?

I am new to linux and have been trying to figure this out forever for a homework assignment! I am supposed to use appropriate linux commands to capture all "C or CPP" files in the linux operating system and make a list of the files. I am using Xubuntu. I am a beginner and could use any advice! Thanks!

 Mail this post

Popularity: 2% [?]

StumbleUpon It!

Technorati Tags: , , , , ,

1 Comment »

  • Udi K

    What does it mean to capture a file??

    If you mean to find the files and list the results, use the ‘find’ command to search for *.c and *.cpp files in the whole system. You will get the result on the screen, and you can redirect the output to a file.

    To find *.c files:
    find / -name *.c

    To find *.cpp files:
    find / -name *.cpp

    Explanation: the "/" means to start the search at the top of the file system, meaning that the search will include all the system. The "-name" means to search by name, and "*.c" is the file pattern you want to find.

    To redirect the output, use "> output_file" for example:
    find / -name *.cpp > output_file

    Hope it helps. See the manual page ‘man find’ to learn more.

    Comment | April 13, 2010

RSS feed for comments on this post. TrackBack URL

Leave a comment

CommentLuv Enabled

This site uses KeywordLuv. Enter YourName@YourKeywords in the Name field to take advantage.

Powered by WordPress | Aeros Theme | TheBuckmaker.com WordPress Themes

Powered by Yahoo! Answers