Storing linux commands

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read this

Storing linux commands

Postby PeterTi on Thu Apr 18, 2013 8:39 am

Hi people,

I'm quite new to Linux and fortunately enjoying working with it a lot.
The good thing is that i also enjoy working with the terminal.

I've done quite some tasks with the terminal. But some of them i just keep forgetting and i have to google everytime to find a command. For example starting and stopping a server and switching off my mousepad when i'm coding.

My question is:
Is there a nice terminal kind of way to remember my commands with and store them alphabetically or chronologically?
With other words automatically making a personal file where i can find al my used commands in without googling al the time.

This will speed up my command learning proces 8-)

Thanks a lot.
PeterTi
Level 1
Level 1
 
Posts: 11
Joined: Wed Apr 17, 2013 1:27 pm

Linux Mint is funded by ads and donations.
 

Re: Storing linux commands

Postby cecar on Thu Apr 18, 2013 9:06 am

Maybe not exactly what you want but the terminal stores used commands. Cycle through them with arrow up, arrow down.
cecar
Level 4
Level 4
 
Posts: 364
Joined: Tue Aug 24, 2010 2:47 am
Location: Stenungsund, Sweden

Re: Storing linux commands

Postby semicolon on Thu Apr 18, 2013 9:18 am

Hi PeterTi,

Good to hear you like the command line! :D The commands you use in the terminal are automatically saved in the history, I believe it keeps the last 2000 commands you ran in the terminal.

There are several ways to use the history:
  • 1. Use the 'up key' to go one command back in the command line history.
  • 2. Use the command
    Code: Select all
    history

    to show the entire command line history. This is often combined with a search, for example:
    Code: Select all
    history | grep 'config'

    will show you all commands from the history in which the string 'config' occurs.
  • 3. Use the 'bang'-syntax (that's what commands starting with an exclamation mark are called). For example:
    Code: Select all
    !!

    will run the last command again. But probably more useful is:
    Code: Select all
    !foo

    which will run the most recent command which started with 'foo'.

I hope that's enough to let you enjoy the command line even more :)

Also see:
Code: Select all
man history
Last edited by semicolon on Thu Apr 18, 2013 9:24 am, edited 1 time in total.
semicolon
Level 2
Level 2
 
Posts: 56
Joined: Sat Mar 09, 2013 7:26 am
Location: Netherlands

Re: Storing linux commands

Postby GeneC on Thu Apr 18, 2013 9:22 am

This may be of interest..

http://www.webupd8.org/2010/09/cli-comp ... o-use.html

CLI Companion is a tool aimed at making the terminal easier to use: it's a GUI that displays a list of commands and an embedded terminal under it. The application comes with a list of commonly used commands by default, each having a short description and if you want to find out more about a certain command, simply right click it and select "Help". This will display the "man" (manual) for the selected command.


You can of course add your own commands to CLI Companion: simply click the "Add" button, then enter your command, an argument (optional) and a description.

To run a command, you just have to select it and click "Apply" and you'll see the output in the embedded terminal. If the command requires an argument, it will prompt you - all using a GUI. You can also run multiple commands in the same time: click the "+" sign on the right and a new tab will open.

Advanced users may also find Cli Companion useful by storing custom commands they came across for easier access and since CliCompanion has a built-in search tool, those commands will be easy to find and run.


Image
Last edited by GeneC on Thu Apr 18, 2013 9:27 am, edited 1 time in total.
GeneC

AMD Phenom2x4 3.2 ghz, 12GB DDR3, Nvidia GTX 460

Qiana (Cinnamon/XFCE)
Sparky XFCE (Debian Testing)
LMDE Cin 2.2 (SID)
User avatar
GeneC
Level 7
Level 7
 
Posts: 1538
Joined: Fri Sep 03, 2010 1:59 pm
Location: Maine, USA

Re: Storing linux commands

Postby PeterTi on Thu Apr 18, 2013 9:25 am

Just found it:
Code: Select all
gedit ~/.bash_history

And i will try cli companion. Thanks!
PeterTi
Level 1
Level 1
 
Posts: 11
Joined: Wed Apr 17, 2013 1:27 pm

Re: Storing linux commands

Postby homerscousin on Sat Apr 20, 2013 8:33 pm

Thank-you GeneC. I have been wanting to compile a list of commands for some time. This looks like it will keep a database of all my commands with my notes plus a terminal to run them in. Seems easier than searching the net or opening a seperate text file I created.
i5 3570k, ASRock z77 Extreme 4, 8 Gb Ripjaws 1600, Antec 430w psu, HVR 1600 tv tuner, custom case- marble top, oak face. Carver & DCM Time Window sound system. Mint 14 KDE.
homerscousin
Level 5
Level 5
 
Posts: 541
Joined: Fri May 25, 2012 2:43 pm
Location: Somewhere on planet Earth (mostly)


Return to Newbie Questions

Who is online

Users browsing this forum: Google Adsense [Bot], Zetor895 and 48 guests