Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 03-15-2009, 09: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: Reputation: 0
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
Old 03-15-2009, 10:12 AM   #2
Didier Spaier
LQ Addict
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-14.2.1 on Lenovo Thinkpad W520
Posts: 8,591

Rep: Reputation: Disabled
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:
find / -name "*.c"
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 10:17 AM.
Old 03-15-2009, 10:13 AM   #3
LQ Newbie
Registered: Feb 2009
Distribution: Slackware
Posts: 20

Rep: Reputation: 1

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?


Old 03-15-2009, 10:20 AM   #4
Senior Member
Registered: Dec 2008
Location: root
Distribution: Slackware & BSD
Posts: 1,665

Rep: Reputation: 489Reputation: 489Reputation: 489Reputation: 489Reputation: 489
Originally Posted by robinhoodmp View Post
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

==> 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}


{here you'll have the source codes written in C}

{here are some C headers}


Hope it helps.

Last edited by malekmustaq; 03-15-2009 at 10:21 AM.
Old 03-15-2009, 01:03 PM   #5
Registered: Sep 2004
Location: Old York, North Yorks.
Distribution: Debian 7 (mainly)
Posts: 653

Rep: Reputation: 97
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:
Gnome projects:

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:

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.

Last edited by Robhogg; 03-16-2009 at 06:52 AM. Reason: Removed unnecessary line
Old 07-15-2010, 11:30 AM   #6
LQ Newbie
Registered: Apr 2010
Location: Dallas, TX
Distribution: Arch, Ubuntu, Redhat
Posts: 26

Rep: Reputation: 0
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



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
want to use Linux, but got a couple of questions? 3kings Linux - General 19 10-20-2006 06:48 AM
Sorry n00b Here...A Couple Linux Questions? Steve1492 Linux - Software 16 07-28-2006 12:26 PM
A couple linux server questions... SonoranFun Linux - Distributions 1 01-25-2005 08:49 AM
A couple of Linux newbie questions BBB Linux - Newbie 4 09-03-2004 09:18 AM
How to download Linux? and a couple other questions... RHLinuxGUY Linux - Newbie 3 12-01-2003 06:29 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:22 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration