Announcement

Collapse
No announcement yet.

simple CLI questions

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    simple CLI questions

    I've had to use the CLI a bit lately. I haven't used a CLI since msdos. Some things befuddle me;

    1) Is there a keyboard shortcut to launch the konsole? The official manual isn't telling.

    2) how do you run a command as though you launched it in a different directory. for example I can be in folder alpha and can run an executable in folder alpha/beta but how do i run the command as though I launched it in alpha/beta rather than alpha.

    3) When pasting text into the konsole how do you stop it automatically executing it on paste (as though there is a carriage return after the paste)? It's infuriating.

    4) How do you close man. The manual displayer. man man didn't shed much light here.

    5) Sometimes when I make a mistake I get a '>' prompt below which seems to be asking for more information. How do i cancel it and go back the the $ prompt?

    CLI is a spelling nazi. One little character out of place and splat, if you're lucky nothing happens.

    #2
    Re: simple CLI questions

    1) Alt+F2 brings up a command line for launching things.


    2) If I follow the question... format is: appname [arguments] [path] / [filename]
    for example if I am currently in /home/user and wanted to open xorg.conf in /etc/X11/
    the command I would type is: nano /etc/X11/xorg.conf
    Using that format it would not matter where you are and if the app you are trying to use is CLI capable. Instead of nano insert your favorite console text ed. I prefer joe myself.

    If you wanted to open as root use the sudo command at the beginning of the command.
    sudo nano /etc/X11/xorg.conf


    3) not sure on that one... I have seen it both ways so it may come down to how the source was copied.


    4) To close man hit q


    5) To exit the > prompt hit Ctrl+C that type of prompt usually indicates it is expecting more of a command to follow or something like that. Ctrl+C is your friend in the console as it "should" cancel what action you have it working on.


    CLI is a spelling nazi. Try to use the tab key for autocompletion more


    -ed for read
    Kubuntu 18.04 on AMD

    Comment


      #3
      Re: simple CLI questions

      Fantastic, thanks for the response.

      1) I was hoping for a direct konsole launch though this looks useful too

      2) Not quite what i was after. I want to do it like that but as though i had executed in the /etc/X11/ directory. Actually I'm not explaining it well and I'm not sure i know how to. I need the executable to see all the other stuff in the directory it is in. If i do it your way it cannot find it because it's been executed as though you are in the /home/user directory. So it's looking in /home/user not /etc/X11.

      3) I often copy from openoffice writer. Perhaps it's copying more than the text. Maybe something in formatting does it.

      4) works like a charm thanks

      5) also works like a charm

      ahh tab. I find the up and down arrow useful too.

      Comment


        #4
        Re: simple CLI questions

        1) You can use KDE menu editor to assign shortcut for an app. Run `kmenuedit`, locate konsole there and click on "advanced" tab. An option to assign shortcut should be there.

        2) If your executable is shell script you can simply change working dir in that script before running other stuff , `cd /home/to/dir`.

        You can do something like this too on shell prompt `cd alpha/beta && ls` which should list files in your alpha/beta dir

        Comment


          #5
          Re: simple CLI questions

          8.10 assumed.

          Put a direct shortcut on the panel:

          Right click on desktop and select unlock widgets. Then navigate the kmenu to the Konsole menu entry. Right click on it then select copy to panel. Manouevre the icon to where you want it, then right click on desktop and lock widgets again.

          Your second point (you might like this one). When running Dolphin, navigate to the directory where the necessary file is. Hit F4. A terminal will open at the bottom and you have already "CD'd" to the necessary directory. Type in your command (say sudo sh <space>) and drag and drop the file into the terminal window and you are away

          Comment


            #6
            Re: simple CLI questions

            on 3), have had the same problem; even worse, when copying from OOo Writer to Konsole, the commands don't execute! Sometimes, not always. Rx: re-type the commands by hand.

            Sounds like much of my how-to is too basic for you (if you've had DOS work), but I'll post it here anyway, and it does spend a lot of time on navigating the Kubuntu directory tree (using cd, ls, pwd) and includes a few intermediate topics:

            Commands at Konsole: Beginners
            http://kubuntuforums.net/forums/inde...opic=3091607.0
            In 3 parts, new/improved, complete basic tutorial.

            (please post questions back here, not in the how-to -- thx)



            An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

            Comment


              #7
              Re: simple CLI questions

              Thanks again.

              sasha: Yes a shell script or the && will turn the trick. Is a shell script as simple as a list of commands in a text file? I know you need to make it executable and use sh.

              The Liquidator: I should have thought of putting it on the panel, i already have firefox and my email on there. I do like the dolphin trick.

              Qqmike: the how-to very very useful. Plenty there I knew. Plenty there I had no idea about. I had no idea you could mount a .iso directly but i guess it makes sense if devices are files as well.

              I have two questions. You've got in there that ~ is the home directory but for me ~ is home/username

              is [!0} a typo or does it need the alternating brackets?

              It's a lot to take in.

              Comment


                #8
                Re: simple CLI questions

                The symbol ~ means your home directory.
                So, for me
                ~
                means
                /home/mike
                and
                ~/Desktop
                means
                /home/mike/Desktop
                and
                ~/Desktop/file1
                means
                /home/mike/Desktop/file1


                The notation
                [!0]
                indicates everything but zero; ie., not zero; or "non-zero" characters, which means any character (alphanumeric) except zero.


                EDIT: Ah! I see what you mean; right ], not right }
                I will correct it. Thanks!
                An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

                Comment


                  #9
                  Re: simple CLI questions

                  Originally posted by Argent

                  3) When pasting text into the konsole how do you stop it automatically executing it on paste (as though there is a carriage return after the paste)? It's infuriating.

                  Hate it when that happens, but just remember, if what you are copying is at the end of a line and that line has a carriage return, well the carriage return gets copied, gets pasted, and because it's there gets executed!!

                  So if you are copying something, be a little careful and stop at the last printable character. If your copy mark goes beyond the end, then guess what -- there's something in that little bit of extra space. It may, or may not, be something that you really want.
                  The next brick house on the left
                  Intel i7 11th Gen | 16GB | 1TB | KDE Plasma 5.27.11​| Kubuntu 24.04 | 6.8.0-31-generic



                  Comment


                    #10
                    Re: simple CLI questions

                    That sounds like it'd be the problem. Maybe a copy or paste as text would be useful which would remove all the hidden surprises.

                    Comment


                      #11
                      Re: simple CLI questions

                      didn't read everything...but for the shortcut to konsole, install yakuake...
                      Code:
                      sudo apt-get install yakuake
                      set it to run at start up...then just press f12, and a konsole window will drop down from the top of the screen. Don't remember how it is configured by default, but my preference is to set it to 'roll back up' when it looses focus.

                      I couldn't live without this program...

                      mm0
                      Dell Inspiron 1720 Laptop<br />Intel T9300 Core2Duo Processor @ 2.5Ghz<br />4 GB Ram | 1920 X 1200 Resolution<br />2 X 160 GB SATA HD Internal<br />Nvidia GeForce 8600M Graphics Adapter<br />Using Kubuntu 9.10

                      Comment


                        #12
                        Re: simple CLI questions

                        Originally posted by muzicman0
                        didn't read everything...but for the shortcut to konsole, install yakuake...
                        Code:
                        sudo apt-get install yakuake
                        set it to run at start up...then just press f12, and a konsole window will drop down from the top of the screen. Don't remember how it is configured by default, but my preference is to set it to 'roll back up' when it looses focus.

                        I couldn't live without this program...

                        mm0
                        just ... just WOW! cheers for that
                        ASUS M4A87TD | AMD Ph II x6 | 12 GB ram | MSI GeForce GTX 560 Ti (448 Cuda cores)
                        Kubuntu 12.04 KDE 4.9.x (x86_64) - Debian "Squeeze" KDE 4.(5x) (x86_64)
                        Acer TimelineX 4820 TG | intel i3 | 4 GB ram| ATI Radeon HD 5600
                        Kubuntu 12.10 KDE 4.10 (x86_64) - OpenSUSE 12.3 KDE 4.10 (x86_64)
                        - Officially free from windoze since 11 dec 2009
                        >>>>>>>>>>>> Support KFN <<<<<<<<<<<<<

                        Comment


                          #13
                          Re: simple CLI questions

                          nice, isn't it!
                          Dell Inspiron 1720 Laptop<br />Intel T9300 Core2Duo Processor @ 2.5Ghz<br />4 GB Ram | 1920 X 1200 Resolution<br />2 X 160 GB SATA HD Internal<br />Nvidia GeForce 8600M Graphics Adapter<br />Using Kubuntu 9.10

                          Comment


                            #14
                            Re: simple CLI questions

                            oh yeah, one more thing, you can right click in yakuake, and edit the profile to change background and text colors...I kept looking in preferences for that, but it is actually in the right click menu.
                            Dell Inspiron 1720 Laptop<br />Intel T9300 Core2Duo Processor @ 2.5Ghz<br />4 GB Ram | 1920 X 1200 Resolution<br />2 X 160 GB SATA HD Internal<br />Nvidia GeForce 8600M Graphics Adapter<br />Using Kubuntu 9.10

                            Comment


                              #15
                              Re: simple CLI questions

                              Originally posted by muzicman0
                              oh yeah, one more thing, you can right click in yakuake, and edit the profile to change background and text colors...I kept looking in preferences for that, but it is actually in the right click menu.
                              Ah King mate .. was a thought I had aswell ... and you answered before I asked .. I just love this forum
                              next stop el KDE quatro.due cheers again!
                              ASUS M4A87TD | AMD Ph II x6 | 12 GB ram | MSI GeForce GTX 560 Ti (448 Cuda cores)
                              Kubuntu 12.04 KDE 4.9.x (x86_64) - Debian "Squeeze" KDE 4.(5x) (x86_64)
                              Acer TimelineX 4820 TG | intel i3 | 4 GB ram| ATI Radeon HD 5600
                              Kubuntu 12.10 KDE 4.10 (x86_64) - OpenSUSE 12.3 KDE 4.10 (x86_64)
                              - Officially free from windoze since 11 dec 2009
                              >>>>>>>>>>>> Support KFN <<<<<<<<<<<<<

                              Comment

                              Working...
                              X