Linux - NewbieThis 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!
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.
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.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
What do you mean by "the number of the command"; do you mean the process number or the command history number?
Also, when asking questions about shell-scripting, please provide some sort of inkling as to which shell you're using. Although the Bourne shell (sh) and the Bourne-again shell (bash) are the most popular, that does not necessarily mean that is the shell at hand - as different shells (quite often) have different syntaxes and environment variables.
EDIT: Also, please use pertinent thread titles; this post has nothing to do with redefining the $PATH environment variable.
Last edited by indienick; 01-02-2008 at 10:30 AM.
i am using bash. sorry 4 not mentioning that!
i called my question redifining your path, because im supposed to add this to my path if i want it(the command-nr "fc -l" and the HISTSIZE variable) to work(be stated) everytime i log in i suppose ?
and thats what im trying to do !!!
BUT sadly without success !
Last edited by mayaabboud; 01-02-2008 at 10:56 AM.
PATH is an environment variable that contains a list of directories in which to look for executables, meaning that you don't have to type the full path to the executable when you want to run a program (/usr/bin/foo vs. foo). fc is a Bash built in command (i.e. it doesn't have a separate exeuctable). Not sure which file you need to modify for your purposes, though.
i need to create a .profile file that gives me the result of the fc -l command and the variable HISTSIZE=20 when i log in ,
in order to do this, doesnt mean that i have to add it to my PATH ?
but i ve been trying to write that in a file all day
nthg seems 2 work
What do you want to do? Do you want your command history displayed when you start a new shell? Why not create an alias for "fc -nl". For example: alias h='fc -nl'. Then you only need to type a single letter to see your history.
Okay - two things off the top of my head. I think I know what you're trying to get at...
1. Word of warning: avoid making changes to /etc/profile. If you want EVERY user on the system to have this functionality, then by all means, edit this file. However, if you're the only user who requires this (or you are the only user on the system), write any changes to your ~/.bashrc file.
2. Query: Where, exactly, do you want to keep the output of "fc -l"? Where do you want it to show? Setting the $HISTSIZE variable isn't anything tricky, I'm just curious as to where you want to keep, and what you want to do with the "fc -l" value.
Easy peasy! Of course, change "FOO" to a variable name that makes sense as to what you want to use the value for, but now you can do what you want with it. HOWEVER, I don't think you can force "fc -l" to run upon every command issued to the shell (unless you maybe figure something out with "alias").