# I Want to use the CLI more.



## fiftyone (Aug 31, 2009)

howdy all.

Just a quick question I am hoping someone can give me some advice. 
I am not new to the command line, I know a whole lot of commands and I do use it occasionally, however, I want to use it more often so I can master it. 

The problem I have is that I don't know when to use it? I mean If you are compileing some source or something or moving some files around... but I find 90% of my daily activities take place in the GUI. Videos, reading BSD manuals, music etc. all done in KDE.

Call me strange but I wish I could flip my useage to like 80% CLI and 20% GUI. I find myself sitting at the CLI wanting to do something but all I end up doing is pwd... ls ... cd ... and then I go back to KDE. I need something with some substance so I can find myself in the CLI for a couple hours a day so after some time it comes as natural as click clickking. 

Any advice?


----------



## fonz (Aug 31, 2009)

Five suggestions:

1. Think of something that should probably be possible with just the CLI, switch to the console and try to get it done. When in doubt, use *man -k <keyword>* or google with a text-based browser (e.g. Lynx).

2. Press a letter (in a shell that supports tab completion, like bash or tcsh), hit tab twice and see what commands are available. Pick one, read its manual and experiment with it ([red]don't use the root account![/red]) That's how some of the best UNIX folks I know got started. Hint: awk starts with an a...

3. Start with sort/grep + pipe kind of exercises, like trying to find out how large the biggest file on your disk is, or which process is hogging most of the CPU time, trying to locate all core dumps or how many files larger than - say - 1 GB there are. That sort of thing.

4. Learn how to use mpg123 (or mpg321) to play MP3 files. And while you're at it, learn to use aumix to control the volume. Then try to rip a CD and make MP3s of it.

5. Name a task you normally do in KDE (which I NEVER use, by the way) and perhaps we can help you do it in a CLI.

Perhaps I'll think of other suggestions later, I'll add them if I do.

Alphons


----------



## aragon (Aug 31, 2009)

One suggestion:  uninstall X for a while


----------



## jrick (Aug 31, 2009)

Or try this: instead of using KDE (which encourages all of its own GUI applications) install a tiling window manager such as dwm, wmii, awesome, xmonad, or scrotwm.  Tiling window managers work great if all you are using are terminals, and because most of them discourage the use of the mouse, you'll often find that you won't even want to use a GUI application.

Here's my setup to give you some ideas (using terminals for everything except web browsing and viewing PDFs):

xmonad as my wm
rxvt-unicode for my terminal emulator
vim for my editor
mutt+offlineimap for my mail (previously I used alpine)
xmms2 for music (using nycli for my client)
LaTeX for writing documents
weechat for IRC
uzbl for web browsing (although I also like and use elinks)
xpdf for PDFs (anybody have any other suggestions? I'm not too happy with xpdf, isn't very keyboard friendly.)


----------



## roddierod (Aug 31, 2009)

burn dvd with growisofs
burn cds with burncd or cdrecord
encode/re-encode video with ffmpeg or handbrake(CLI version)

you can do it in an xterm in KDE and slowly ween yourself from KDE.


----------



## avilla@ (Aug 31, 2009)

aragon said:
			
		

> One suggestion:  uninstall X for a while



that's the best advice 
if that sounds too terrifying, try to install some lightweight (very lightweight) window manager (i used to use x11-wm/awesome back on arch linux days): you'll be forced to use the shell as much as you can to accomplish your usual tasks. that worked for me, in three weeks not only i improved a lot my shell knowledge, but i also wrote some awesome plugins (with cli, of course) to show cpu/ram/disc usage, e-mails and software updates count... and so on!

advice number two: don't try to find something to do in the shell, it's useless. as fonz said, try to do what you actually need. does it get too long? convert complex tasks in shell scripts. weeks ago i wrote few lines to order my music files according to their id3 tags: it turned out to be a full script with options and colors!

and... #3: use your fantasy


----------



## fonz (Sep 1, 2009)

*To avoid misunderstandings*

@OP: Just for the sake of clarity, we're *not* saying (at least I'm not) that KDE is evil dirty crap, that anyone who uses it is an idiot and that you should never ever use it again. Or something like that.

It's just that many of us get by pretty well without it, that's all. In fact, I've been around longer than KDE and I'm sure several other regulars here are too. That's why we know how to do things without KDE, Gnome and other such "newfangled" stuff. It may be a bit "old school" but back then it was all we had and to be honest it was good enough :h

Alphons (good luck and kudos for wanting to learn)


----------



## fiftyone (Sep 1, 2009)

_"@OP: Just for the sake of clarity, we're not saying (at least I'm not) that KDE is evil dirty crap, that anyone who uses it is an idiot and that you should never ever use it again. Or something like that. "_

I understand. I love KDE, in my opinion it is probibly one of the slickest GUIs out there. I used to use Gnome with Ubun2 but since I started using FreeBSD with KDE I am converted. I thought of uninstalling KDE but I think I might install "Awesome". Thanks for all the advice!


----------



## aragon (Sep 1, 2009)

I have to agree with jrick.  A nice tiling window manager is a good balance between using command line a lot and still having a graphical interface for web browsing, videos, etc.

I'm liking x11-wm/dwm a lot lately.


----------



## Beastie (Sep 1, 2009)

fiftyone said:
			
		

> reading BSD manuals, music etc. all done in KDE.


When you need to check something, _force_ yourself to open the terminal emulator (associate a keyboard shortcut to it) and type `% man some_command`. man pages are easy to use from there and you can search by typing / (and n for next match), just like in vi (which you _should_ definitely use from time to time).
For listening to your audio CDs, use cdcontrol. Try this: cdcontrol(1) -f /dev/acd1 > eject (put a CD) > close > info > play > pause > resume > next > status > stop > eject (remove CD) > close > quit. What could be easier?
As for MP3s, OGGs, and much more, try audio/moc (Music On Console), for a *very* easy to use and highly customizable and themeable music player.

Also, check these threads: 1) http://forums.freebsd.org/showthread.php?t=5238 2) http://forums.freebsd.org/showthread.php?t=235


----------



## fonz (Sep 1, 2009)

fiftyone said:
			
		

> I thought of uninstalling KDE but I think I might install "Awesome".



Remember: you can actually have your cake and eat it too. As far as I know it's perfectly safe (should be, anyway) to install awesome _(or black-/fluxbox or fvwm or this or that, there are several tiling window managers out there)_ while still keeping KDE around. You may need to edit your .xsession or some other file, which might be a good exercise anyway, but you don't need to uninstall anything until you're really sure you won't need/want it again in the near future.

Alphons


----------



## Beastie (Sep 1, 2009)

jrick said:
			
		

> xpdf for PDFs (anybody have any other suggestions? I'm not too happy with xpdf, isn't very keyboard friendly.)


Maybe you could try graphics/epdfview. It's the lightest, fastest and most simple PDF viewer, and it has keyboard shortcuts for virtually everything.


----------



## avilla@ (Sep 1, 2009)

fonz said:
			
		

> @OP: Just for the sake of clarity, we're *not* saying (at least I'm not) that KDE is evil dirty crap, that anyone who uses it is an idiot and that you should never ever use it again. Or something like that.



agreed. after leaving arch/awesome and installing freebsd, i've started using kde 4, and i like it so much... but i still have numbers of konsoles opened here and there


----------



## dennylin93 (Sep 1, 2009)

aragon said:
			
		

> One suggestion:  uninstall X for a while



Quite a nice idea. I forced myself to learn vi by aliasing ee. Now I'm glad I did it.


----------



## roddierod (Sep 1, 2009)

fonz said:
			
		

> It's just that many of us get by pretty well without it, that's all. In fact, I've been around longer than KDE and I'm sure several other regulars here are too.



Thanks for making me feel even older...I remember the announcements for the new K desktop environment...not as bad as telling my kids their was no web when I was your age...I guess I better go soak my feet in epsom salt...


----------



## graudeejs (Sep 1, 2009)

jrick said:
			
		

> Or try this: instead of using KDE (which encourages all of its own GUI applications) install a tiling window manager such as dwm, wmii, awesome, xmonad, or scrotwm.  Tiling window managers work great if all you are using are terminals, and because most of them discourage the use of the mouse, you'll often find that you won't even want to use a GUI application.
> 
> Here's my setup to give you some ideas (using terminals for everything except web browsing and viewing PDFs):
> 
> ...



x11-wm/fvwm2-devel as WM
x11/rxvt-unicode as terminal
editors/vim as editor
mail/mutt-devel for mail
irc/irssi as irc client
shells/mksh as shell
multimedia/playd or multimedia/playd2 as multimedia/mplayer wrapper (video/audio etc player)

as xpdf alternative, I suggest graphics/epdfview


----------



## aragon (Sep 1, 2009)

jrick said:
			
		

> xpdf for PDFs (anybody have any other suggestions? I'm not too happy with xpdf, isn't very keyboard friendly.)


Have you read its manual page?  I find it very keyboard friendly.  More so than epdfview, not to mention more functional and smaller...


----------



## graudeejs (Sep 1, 2009)

aragon said:
			
		

> Have you read its manual page?  I find it very keyboard friendly.  More so than epdfview, not to mention more functional and smaller...



but it's ugly as hell...


Will read manual...


----------



## fronclynne (Sep 1, 2009)

aragon said:
			
		

> One suggestion:  uninstall X for a while


When I first installed FreeBSD (4.0) I couldn't get XFree86 to work for the life of me.  Browsing the web and using forums/email via text console is certainly instructive and give you a whole new outlook on the ideas of useability & functionality.

There are various converters for pdf => ps, or text, or jpeg (I think) & mplayer with aalib, libcaca, or svgalib is pretty fun for videos.


----------



## jrick (Sep 1, 2009)

aragon said:
			
		

> Have you read its manual page?  I find it very keyboard friendly.  More so than epdfview, not to mention more functional and smaller...



No, but I'm reading it now. I didn't realize that they keybindings could be configured. I guess I'll stay with it. (And its looks don't bother me.)

Sorry, didn't mean this thread to go off-topic a little bit.


----------



## Bunyan (Sep 2, 2009)

fiftyone said:
			
		

> I know a whole lot of commands and I do use it occasionally, however, I want to use it more often so I can master it.
> 
> The problem I have is that I don't know when to use it?
> I find 90% of my daily activities take place in the GUI. Videos, reading BSD manuals, music etc. all done in KDE.
> ...



You have a big problem,man. And that problem is called KDE
I suppose you are using KDM, isn't that?
Give up that pointless bloated KDE and use a light window manager.
I use WindowMaker. 
Then you'll learn how to use the SHELL, be sure of this!

```
pkg_info | wc -l
630
```

I have this much packages installed on my system. But I don't use any KDE or GNOME.
In case you need to run *portupgrade*, how will you proceed with KDE?


----------



## ckester (Sep 2, 2009)

*uzbl*



			
				jrick said:
			
		

> Here's my setup to give you some ideas (using terminals for everything except web browsing and viewing PDFs):
> 
> uzbl for web browsing (although I also like and use elinks)



Doesn't uzbl depend on a later version of webkit-gtk than the one in the portstree?   

I've been wanting to try it -- but not enough to port webkit (and all its dependencies) myself.

Do you know if anyone is planning to port uzbl once we have a newer version of gnome and thus webkit?


----------



## jrick (Sep 3, 2009)

ckester said:
			
		

> Doesn't uzbl depend on a later version of webkit-gtk than the one in the portstree?



Yes



			
				ckester said:
			
		

> I've been wanting to try it -- but not enough to port webkit (and all its dependencies) myself.



I had to find a patch online (it's a PR) for an update to Webkit 1.1.7. Apparently we're waiting on the next Gnome release before it will be pushed to the ports tree.



			
				ckester said:
			
		

> Do you know if anyone is planning to port uzbl once we have a newer version of gnome and thus webkit?



That I know of? Just me.


----------



## jrick (Sep 3, 2009)

troberts said:
			
		

> You could always go to http://www.freebsd.org/ports/ and see if there is a newer version than what you have installed on your system.



I regularly use portsnap to update my ports tree. After that, you can use `% pkg_version -Ivl "<"` to see if any ports need updating.


----------



## ckester (Sep 4, 2009)

jrick said:
			
		

> I had to find a patch online (it's a PR) for an update to Webkit 1.1.7. Apparently we're waiting on the next Gnome release before it will be pushed to the ports tree.



Yeah, I saw that and fetched a copy for myself.  Haven't had a chance to try it yet.

Does Webkit 1.1.7 require similar patches to any other ports, or does it build with the versions in the current portstree?


----------



## jrick (Sep 4, 2009)

ckester said:
			
		

> Yeah, I saw that and fetched a copy for myself.  Haven't had a chance to try it yet.
> 
> Does Webkit 1.1.7 require similar patches to any other ports, or does it build with the versions in the current portstree?



I just installed the newer webkit, and it worked fine without any other patches to ports.  Unfortunately, it looks like the webkit port has been updated since the PR was filed, so you may have to do some manual patching to make everything work cleanly.


----------



## wonslung (Sep 7, 2009)

fiftyone said:
			
		

> howdy all.
> 
> Just a quick question I am hoping someone can give me some advice.
> I am not new to the command line, I know a whole lot of commands and I do use it occasionally, however, I want to use it more often so I can master it.
> ...



speaking from personal experience, the best way i learned command line was by setting up remote machines and setting up stuff like rtorrent, apache, Unrealircd, PureFTPD...it's not so much the USING command line, as it is setting stuff up....
For me, i started with easy stuff, then i'd run into issues that could be solved with command line scripts..then i'd have to research how to solve some problem.  I'd read online documentation and ask questions but each issue i tackle, i learn a new trick.  The more tricks you learn, the better you get, and also, the more stuff you end up doing...you find that the command line options are often much quicker.  At first it's daunting but the more you do it, the easier it gets...and the more fun it gets.


----------



## sim (Nov 30, 2009)

Further to the previous post...

How about setting yourself the task of setting up a full web server, via the CLI? - Apache, PHP, PostgreSQL (MySQL if you must...) - all inside a jail(8)?  First you get the task of preparing the jail, which you can then treat as a virtual server in its own right. Configure ssh public key, mod_sec, whatever.  Lots of things to configure and tweak, plus no risk of damaging your 'real' environment.

Just a thought.

sim


----------



## respite (Dec 2, 2009)

I started with finding replacements for the X applications i ran with console apps. The original motivation was to leave my stuff running in a screen session so i could have easy access to my things remotely. 

In the process I picked up a lot of new tricks and dont use X much at all anymore. When i do use it ill run a tiling window manager like scrotwm just to use firefox, and attach my screen session with everything else in xterm.


----------



## sixtydoses (Dec 8, 2009)

Beastie said:
			
		

> Maybe you could try graphics/epdfview. It's the lightest, fastest and most simple PDF viewer, and it has keyboard shortcuts for virtually everything.



I don't like acroread because it's heavy but the only reason why I still have it is because it has an option to index your search instead of just the basic search that jumps from one page to another based on the keyword that you're looking for. If there's other app that has this feature I'll definitely switch from acroread for good.


----------



## ckester (Dec 9, 2009)

+1 for the idea of using a tiling window manager as a way to ease into more CLI use.

My current favorite tiling window manager is musca.  It has very intuitive default keybindings and can be used in both tiled and untiled modes.  Easily configured via ~/.musca_start.  By default, it uses dmenu as a program launcher and for access to musca commands.


----------



## FRANCOIS (Dec 9, 2009)

jrick said:
			
		

> Or try this: instead of using KDE (which encourages all of its own GUI applications) install a tiling window manager such as dwm, wmii, awesome, xmonad, or scrotwm.  Tiling window managers work great if all you are using are terminals, and because most of them discourage the use of the mouse, you'll often find that you won't even want to use a GUI application.
> 
> Here's my setup to give you some ideas (using terminals for everything except web browsing and viewing PDFs):
> 
> ...



You could try 
mrxvt (multi tab) 
epdfview, gv for you pdf


----------



## foldingstock (Dec 9, 2009)

jrick said:
			
		

> [*]xpdf for PDFs (anybody have any other suggestions? I'm not too happy with xpdf, isn't very keyboard friendly.)
> [/LIST]



xpdf-utils is a set of packages that contains a program, pdftotext, that can be used to convert pdf files to regular "*.txt" files. In a console, the converted txt file can easily be read with a number of tools (cat, vi, nano, less, etc). This is helped me out a number of times.


----------



## monty_hall (Dec 10, 2009)

"GUI? we don't don't need no stinking GUI!" To be a cli purist, try watching more multimedia with aalib output, ie: aaxine.   

Although I'm kidding, aalib output is a slick novelty to show your windows friends - though they may not be able to appreciate it....


----------

