LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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



Reply
 
Search this Thread
Old 03-15-2009, 09:58 AM   #1
robinhoodmp
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
Senior Member
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slackware{,64}-{14.1,current} on a Lenovo Thinkpad W520
Posts: 4,681

Rep: Reputation: 1240Reputation: 1240Reputation: 1240Reputation: 1240Reputation: 1240Reputation: 1240Reputation: 1240Reputation: 1240Reputation: 1240
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:
Code:
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
ccargo
LQ Newbie
 
Registered: Feb 2009
Distribution: Slackware
Posts: 20

Rep: Reputation: 1
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
 
Old 03-15-2009, 10:20 AM   #4
malekmustaq
Senior Member
 
Registered: Dec 2008
Location: /root
Distribution: Slackware & BSD
Posts: 1,223

Rep: Reputation: 231Reputation: 231Reputation: 231
Quote:
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
(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 10:21 AM.
 
Old 03-15-2009, 01:03 PM   #5
Robhogg
Member
 
Registered: Sep 2004
Location: Old York, North Yorks.
Distribution: Debian 7 (mainly)
Posts: 653

Rep: Reputation: 85
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 06:52 AM. Reason: Removed unnecessary line
 
Old 07-15-2010, 11:30 AM   #6
dcatiii
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 http://www.thegeekstuff.com/2008/08/...-line-history/
 
  


Reply

Tags
help


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


All times are GMT -5. The time now is 04:05 PM.

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