PDA

View Full Version : Living Life in CLI



IWantFroyo
July 29th, 2011, 03:40 AM
I've decided to start trying to use the command line for as much as I can. I'm typing this thread right now in elinks, actually. Hope it comes out right. So anyways, what are some of your favorite command line programs?

krapp
July 29th, 2011, 03:44 AM
Music on console

cariboo
July 29th, 2011, 04:04 AM
Music on console

Easy, I use a combination of randomplay and mpg123, on my headless Debian powered G4 mp3 player. Both are in the repositories.

msandoy
July 29th, 2011, 04:11 AM
I'm not an advanced CLI user, but my most frequently used programs are screen, mc, rtorrent, alpine, emacs, less, tail and head.

Actually the absolutely most used one is SSH, since it is used every time I connect to my server either via tunnel or just for a remote session.

jerenept
July 29th, 2011, 04:54 AM
I'm not an advanced CLI user, but my most frequently used programs are screen, mc, rtorrent, alpine, emacs, less, tail and head.

Actually the absolutely most used one is SSH, since it is used every time I connect to my server either via tunnel or just for a remote session.

Music Player Daemon? I use it.

Lucradia
July 29th, 2011, 05:02 AM
htop is one of my favorite commands, over top.

Also, finch is pretty fun to experiment with, to see how keyboard shorts work. ;) Note, finch doesn't need gnome deps for some strange reason, even though it STILL needs proxy info.

krapp
July 29th, 2011, 05:21 AM
Media Player Daemon? I use it.

Don't you mean music player daemon? and what a waste.

jerenept
July 29th, 2011, 05:24 AM
htop is one of my favorite commands, over top.

Also, finch is pretty fun to experiment with, to see how keyboard shorts work. ;) Note, finch doesn't need gnome deps for some strange reason, even though it STILL needs proxy info.

Oh, after using htop, I could never go back.

Another useful command is "history". Pipe it through grep, like
history | grep history


Don't you mean music player daemon? and what a waste.

Yes, I'll fix it.

Metallion
July 29th, 2011, 05:29 AM
I work in the CLI almost exclusively every day. I never really use a graphical file manager. I don't really use it for multimedia or browsing though. I don't really see the benefit of that.

I can help you out if you post some more specifics on what you want to do with the CLI.

SadisticCheeto
July 29th, 2011, 07:06 AM
I recently ruined my laptop which left me to use an old desktop with an old CPU and low memory. It was kind of a necessity that I use applications that used less memory. So, I have been using console applications a lot more than I normally used them.

Currently, I use tmux, mutt for email, ranger for managing files, vim for editing, htop for monitoring the system, mpd (with ncmpcpp) for my music collection, herrie for random mp3s, shell-fm for Last.fm radio, pianobar for Pandora, abcde for CD ripping, cdrecord for CD burning, cclive for downloading videos instead of using Flash. I can't seem to get into using a console browser, though.

Although I put myself in a tough situation, I'm able to make the best of it with these applications. But they are great to use no matter what the specs of your computer are.

jwbrase
July 29th, 2011, 07:19 AM
The ones I use absolutely most often are probably ls, cat, grep, and man. And, of course, zsh to provide the command line environment in the first place.

uRock
July 29th, 2011, 07:33 AM
I use
startx :D

ScionicSpectre
July 29th, 2011, 09:55 AM
If I remember correctly, Qt itself can run on the framebuffer. Does that count?

Also, aren't there some graphical CLI web browsers out there? I forget the name. Also, mplayer's ASCII video playback is something to see. XD

Random_Dude
July 29th, 2011, 10:38 AM
screenie - I find it easier to use than screen
cmus - easy to use music player
irssi - IRC
rtorrent - torrent client
tudu - TODO list
newsbeuter - RSS feed reader
vim - when I have to edit a config file and don't feel like opening gVim

And that's about it in terms of CLI programs that I use.
I've tried mutt and alpine. I liked mutt's keybindings and interface, but the configuration was too hard for me to insist on it. I just stayed with thunderbird.

Cheers :cool:

kaldor
July 29th, 2011, 11:12 AM
I don't live in a TTY, but when I have work to get done I always have a Terminal running.

keithpeter
July 29th, 2011, 12:04 PM
Easy, I use a combination of randomplay and mpg123, on my headless Debian powered G4 mp3 player. Both are in the repositories.

So is moc, which is Music On Console, invoked once installed by the command mocp. I use it as my main music player because I like the navigation.

The Man for command line is K Mandla, who appears to be having a sabbatical at present. See

http://kmandla.wordpress.com/software/

krapp
July 29th, 2011, 01:14 PM
So is moc, which is Music On Console, invoked once installed by the command mocp. I use it as my main music player because I like the navigation.

The Man for command line is K Mandla, who appears to be having a sabbatical at present. See

http://kmandla.wordpress.com/software/

Thanks, I wasn't sure if it was clear what I meant by Music on console. It's a wonderful program. I don't get the appeal of mpd unless it's actually streaming music over a network.

VCoolio
July 29th, 2011, 01:56 PM
zsh, ncmpcpp, vim, weechat, tmux, transmission-remote-cli (https://github.com/fagga/transmission-remote-cli).

There is a whole list of cli alternatives here (http://www.jaredandcoralee.com/CLIapps.html), have fun.

nothingspecial
July 29th, 2011, 01:56 PM
There are no problems browsing in the console, you can even watch youtube

198767

It takes a bit of setting up, if you really want to know how I'll take you through it when I have more time. Post back if you want to know.

:popcorn:

BrokenKingpin
July 29th, 2011, 02:08 PM
I used Debian from the command line for about a year on one of my boxes. It was a good learning experience.

I used the following programs:
- Elinks: for browsing
- CenterIM: for chat
- mpg321: for music
- VI: for text editing

fi2
July 29th, 2011, 02:09 PM
nothingspecial: Please, I'd really appreciate it...

nothingspecial
July 29th, 2011, 02:12 PM
I have a 3000 word article to be submited by 5pm :cry:

However, I am home alone tonight. I'll give you a full run down later when the kids are in bed.

Might end up another 3000 words :shock:

tdrusk
July 29th, 2011, 03:20 PM
There was a guy from this forum that had a blog and wrote about 30 days of the command line using Ubuntu. I wish I could find that to link it...

EDIT: found it, but site is dead. http://ubuntuforums.org/archive/index.php/t-839919.html

aeiah
July 29th, 2011, 03:40 PM
Thanks, I wasn't sure if it was clear what I meant by Music on console. It's a wonderful program. I don't get the appeal of mpd unless it's actually streaming music over a network.

its not just about streaming music over a network (which i use mpd for as well), its also about controlling it over the network. it isnt much fun controlling your music player on your phone if you have to open an ssh session to do it :P

or for that matter, if you want to control it from xbmc, or your girlfriend wants to use it on a graphical desktop.


but yes, i can quite happily use the cli for everything except web browsing. cli browsers just take longer to get around.

nothingspecial
July 29th, 2011, 04:34 PM
its not just about streaming music over a network (which i use mpd for as well), its also about controlling it over the network. it isnt much fun controlling your music player on your phone if you have to open an ssh session to do it :P

or for that matter, if you want to control it from xbmc, or your girlfriend wants to use it on a graphical desktop.


but yes, i can quite happily use the cli for everything except web browsing. cli browsers just take longer to get around.

Not with the numbered link function in elinks (back to work).

oldos2er
July 29th, 2011, 06:31 PM
K.Mandla's blog has a lot of info on CLI apps. http://kmandla.wordpress.com/

Old_Grey_Wolf
July 29th, 2011, 08:12 PM
In addition to what has already been mentioned...

I remotely manage several computers. For example, 3 of the computers are for may grandchildren. Those 3 computers are identically configured. I like to use "Cluster SSH" (cssh) to control all 3 of the computers' terminal windows via a single terminal window open on my computer. That saves time since I can enter commands only once and have the commands execute on all 3 of their computers simultaneously.

I also like "iperf" for testing network performance.

nothingspecial
July 29th, 2011, 08:20 PM
This uses youtube-dl to stream, not download to you hard disk, downloading youtube videos is against their terms and conditions


Ok, as promised

How to watch you tube in the console without running X.

First grab some packages.


sudo apt-get install mplayer youtube-dl elinks surfraw

I'm using surfraw and because the keybindings don't seem to work on the console so you will loose elinks anyway if you want to stop the video.

First, take control of your framebuffer


sudo mkdir /etc/udev/my-rules.d


echo 'KERNEL=="fb0", OWNER="root", MODE="0660"' | sudo tee -a /etc/udev/my-rules.d/framebuffer.rules


sudo usermod -a -G video $USER

Now reboot and setup surfraw (this assumes you are using bash although surfraw does support most shells, just change where it says bash in the last command for your shell).


mkdir $HOME/.config/surfraw/

echo -e "SURFRAW_graphical=no"'\n'"SURFRAW_text_browser=/usr/bin/elinks" > $HOME/.config/surfraw/conf

surfraw-update-path -add bash

Add $HOME/bin to your path


nano ~/.bashrc

add this at the bottom


if [ -d $HOME/bin ]; then
PATH=$HOME/bin:$PATH
fi



Now source bash so that the changes to .bashrc are read


. ~/.bashrc

Before I forget, update youtube-dl to the latest version


sudo youtube-dl -U

Now make a script


mkdir ~/bin


nano ~/bin/ytwv

call it what you like, that's what I call it and for the rest of this I'll assume you did too.

Put this in it


#!/bin/bash

COOKIE_FILE=/var/tmp/youtube-dl-cookies.txt
mplayer -cookies -cookies-file ${COOKIE_FILE} "$(youtube-dl -g --cookies ${COOKIE_FILE} $1)" > /dev/null 2>&1

make it executable


chmod +x ~/bin/ytwv

Now let's find a video eg


youtube rastamouse

note, it's that surfraw we set up that let's you do that.

You can type


google space robots

or


wikipedia frozen bubble

Type man surfraw to see what it can do.

Anyway, a text browser (elinks) should have appeared but before we do anything else we need to configure it to use the script.

Press O and a menu should pop up, the options manager

scroll down to "Document" in the menu with your arrow keys and press Space to expand it.

Then scroll down to URI Passing and press A to add an option. In the name I put youtube, it doesn't matter, call it Rodger if you like. Use your arrow keys to highlight it and press E to edit.

In the value put


ytwv %c

Press the Tab key to get to the Ok button press Enter then press V to save.

Then C to close the options manager.

Right back on the elinks page. Press . (period/fullstop). Numbers should appear next to every link. The ones we want on a youtube page are either Img or a time (you'll get used to it). Press the number of the link you want.

You may want to scroll down (Insert) or up (Delete), or scroll through the links using the up and down arrows.

Anyway, once you have a link highlighted, don't press Enter, you shoould see one of those http://youtube.com/watch?v=blahblahblah links.

To view it Press Shift-L then X

It probably won't work at first because in a post this long I am certain to have made a typo or left something out.

By the way, elinks will probably look rubbish. It can look really nice but that is outside the confines of this.

Have fun :popcorn:

IWantFroyo
July 30th, 2011, 03:42 AM
Thanks A LOT guys! Life here in the command line is quite comfortable :popcorn:

Especially thanks to nothingspecial. Maybe one of the mods will take their post and turn it into a HOWTO.

nothingspecial
July 30th, 2011, 10:41 PM
Glad you are enjoying it.

You realise that now you can also watch any video without X?

Just mplayer /path/to/video

:D

Thewhistlingwind
July 30th, 2011, 10:47 PM
Glad you are enjoying it.

You realise that now you can also watch any video without X?

Just mplayer /path/to/video

:D

How about photo/image viewing?

nothingspecial
July 30th, 2011, 11:15 PM
fbi

for viewing images.

You can even take a sreenshot with fbgrab like this

198890

nothingspecial
July 30th, 2011, 11:21 PM
Ok, that looks like I just posted a picture.

If you want to try this, and you have the framebuffer set up as set out in my big long post earlier.


sudo apt-get install fbi fbgrab

If you still happen to be running X press Ctrl-Alt-F1

login

navigate to a folder with pictures in it and type


fbi image.png

change image.png for the actual image.

Then press Ctrl-Alt-F2

login

and type


fbgrab -c 1 shot.png

-c tells fbgrab which console to take the screenshot from, without the -c flag it takes the current one. You need to specify an output file.

:popcorn:

Random_Dude
August 1st, 2011, 10:11 AM
How about photo/image viewing?

You can use feh.

@nothingspecial:
I never thought that you could watch youtube videos only with the CLI, I'm gonna try that latter. :D

Cheers :cool:

nothingspecial
August 1st, 2011, 10:18 AM
You can use feh.



feh doesn't work without X although it is an excellent app. :)

fi2
August 5th, 2011, 10:18 PM
@nothingspecial: Thanks a lot.

Thewhistlingwind
August 6th, 2011, 05:06 AM
*looks up surfraw*

*notices the creator is Julian Assange*

0_0

Of all the things I'd expect him to write.........

Khakilang
August 6th, 2011, 05:28 AM
The only CLI I use is sudo apt-get install ..... I hope to learn more.

rjbl
August 6th, 2011, 09:03 AM
I've decided to start trying to use the command line for as much as I can. I'm typing this thread right now in elinks, actually. Hope it comes out right. So anyways, what are some of your favorite command line programs?

startX

GrouchyGaijin
August 11th, 2011, 10:09 PM
For what it is worth I use todo.txt which is a cli to do list and gpo which is the cli of gpodder

el_koraco
August 11th, 2011, 11:18 PM
Favorites: mutt, MOC, nano, and of course, glxgears.

honeybear
August 1st, 2012, 09:36 PM
I've decided to start trying to use the command line for as much as I can. I'm typing this thread right now in elinks, actually. Hope it comes out right. So anyways, what are some of your favorite command line programs?

centerim is for chat. Anyhone using it still?

|{urse
August 1st, 2012, 10:04 PM
Fav cli apps,

1. irssi
2. zenity
3. wget

Theres also a really cool one called hello, sudo apt-get install hello.
lol

AllRadioisDead
August 2nd, 2012, 12:21 AM
cmatrix, htop, archey.

Elfy
August 2nd, 2012, 07:36 AM
Sleep well old friend.