Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place! |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
03-15-2009, 08:58 AM
|
#1
|
|
LQ Newbie
Registered: Mar 2009
Location: Indiana
Distribution: sorry, not sure what this means...I'm using Fedora 10
Posts: 1
Rep:
|
a couple of questions about linux
Hello, I'm very new to this O.S. and need a couple questions answered please. 1. when I'm in the terminal, how can I get back my last command I entered? And 2. How do I get a list of all the C code files? Thanks for any and all help....R
|
|
|
|
03-15-2009, 09:12 AM
|
#2
|
|
Senior Member
Registered: Nov 2008
Location: Paris, France
Distribution: Slackware-14.0 on a Lenovo T61 6457-4XG
Posts: 2,786
|
Welcome to LQ.
1) Hit the "arrow up" key on your keyboard.
2) If we suppose that all C code files and only C code files end in ".c", issue following command in a terminal: You will get a list of all files ending on .c that the user and/or associated group(s) under which you log in are allowed to see.
In the aforementioned command you can refine your search replacing / by the directory under which you search for files meeting the -name "*.c" predicate.
Last edited by Didier Spaier; 03-15-2009 at 09:17 AM.
|
|
|
|
03-15-2009, 09:13 AM
|
#3
|
|
LQ Newbie
Registered: Feb 2009
Distribution: Slackware
Posts: 20
Rep:
|
Hi,
You can usually just use arrow-up and arrow-down to page through your previous commands.
I don't really understand the second question, what C-files?
Regards,
Cash
|
|
|
|
03-15-2009, 09:20 AM
|
#4
|
|
Senior Member
Registered: Dec 2008
Location: /root
Distribution: Slackware & BSD
Posts: 1,188
|
Quote:
Originally Posted by robinhoodmp
Hello, I'm very new to this O.S. and need a couple questions answered please.
1. when I'm in the terminal, how can I get back my last command I entered? And
2. How do I get a list of all the C code files? Thanks for any and all help....R
|
(1)
==> Press Ctl+P
{this should return you to the immediate previous code you entered}
==> Press the UP arrow of the navigation keys
{this should sequentially bring you to previous commands}
(2)
/usr/src/linux/kernel
{here you'll have the source codes written in C}
/usr/include
{here are some C headers}
/go-take-a-survey/of_your_directories/get-familiar
Hope it helps.
Last edited by malekmustaq; 03-15-2009 at 09:21 AM.
|
|
|
|
03-15-2009, 12:03 PM
|
#5
|
|
Member
Registered: Sep 2004
Location: solihull.w-mids.uk
Distribution: Debian 5.0, CentOs, Solaris 8-10
Posts: 576
Rep:
|
You may not find many C source-code files on your system if you have just followed a standard install. Some may be available from the Fedora package manager (e.g., if I want the source code for my current kernel, I can download the linux-source-2.6.24 using Ubuntu's package manager). For sources for other parts of the system, you may have to go to the site of the project that developed it. For instance,
The GNU core utilities: http://directory.fsf.org/project/coreutils/
Gnome projects: http://projects.gnome.org/
If you haven't already found it, the file command is useful for identifying particular types of file. You could use it with grep filtering the output to identify all C files in a particular directory:
Code:
rob:src$ file * | grep 'C program text'
base64.c: ASCII C program text
basename.c: ASCII C program text
c99-to-c89.diff: ASCII C program text
...
The advantage of this (as the c99-to-c89.diff entry shows) is that it doesn't depend on the filename suffix.
Rob.
Last edited by Robhogg; 03-16-2009 at 05:52 AM.
Reason: Removed unnecessary line
|
|
|
|
07-15-2010, 10:30 AM
|
#6
|
|
LQ Newbie
Registered: Apr 2010
Location: Dallas, TX
Distribution: Arch, Ubuntu, Redhat
Posts: 26
Rep:
|
It seems you may have found your answer, but these methods may work as well...
1. Use the up arrow to view the previous command and press enter to execute it.
2. Type !! and press enter from the command line
3. Type !-1 and press enter from the command line.
4. Press Control+P will display the previous command, press enter to execute it
taken from http://www.thegeekstuff.com/2008/08/...-line-history/
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 07:31 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|