View previous topic :: View next topic |
Author |
Message |
rottingdead Tux's lil' helper
Joined: 12 Sep 2011 Posts: 133
|
Posted: Sat Oct 22, 2011 11:39 pm Post subject: Fluxbox + Xterm[solved] |
|
|
I'm currently using Fluxbox, I'm trying out Gentoo x86_64, and only have xterm, and aterm installed, ad did emerge --search mp3, but the list is too long, I tried enabling scroll lock, and that still didn't work, what other ways is there to scroll through files when the list is too long to fit in the Emulators? I haven't installed KDE, so Konsole is out of the question right now.. KDE takes many hours to install, just trying to get my sounds working first, so it'll give me something to do while waiting for the wait, Thanks.. I know in FreeBSD enabling scroll lock and hitting Pg:Up and Pg:Dn works, but no here, =(. _________________ Die Geschichte wiederholt sich!!!!!
Last edited by rottingdead on Sun Oct 23, 2011 1:08 am; edited 1 time in total |
|
Back to top |
|
|
Bones McCracker Veteran
Joined: 14 Mar 2006 Posts: 1611 Location: U.S.A.
|
Posted: Sun Oct 23, 2011 12:46 am Post subject: |
|
|
Pipe the command into a pager, which you can use to scroll through the output at your own pace:
Code: | emerge --search mp3 | more |
The default pager is 'more', which only lets you scroll forward (a screen-full at a time). If you haven't done so already, you might want to replace it with 'less', which is more flexible (lets you scroll up and down):
Code: | emerge --search mp3 | less |
Or
Redirect the output of the command to a file, which you can then open in an editor or a pager. This is a useful approach if you're going to want to refer to the output again later:
Code: | emerge --search mp3 > search_results.txt |
_________________
patrix_neo wrote: | The human thought: I cannot win.
The ratbrain in me : I can only go forward and that's it. |
|
|
Back to top |
|
|
rottingdead Tux's lil' helper
Joined: 12 Sep 2011 Posts: 133
|
Posted: Sun Oct 23, 2011 12:51 am Post subject: |
|
|
BoneKracker wrote: | Pipe the command into a pager, which you can use to scroll through the output at your own pace:
Code: | emerge --search mp3 | more |
The default pager is 'more', which only lets you scroll forward (a screen-full at a time). If you haven't done so already, you might want to replace it with 'less', which is more flexible (lets you scroll up and down):
Code: | emerge --search mp3 | less |
Or
Redirect the output of the command to a file, which you can then open in an editor or a pager. This is a useful approach if you're going to want to refer to the output again later:
Code: | emerge --search mp3 > search_results.txt |
|
Awesome, thanks, =). How come stuff has you use two >> or some stuff only > ?? _________________ Die Geschichte wiederholt sich!!!!! |
|
Back to top |
|
|
Jaglover Watchman
Joined: 29 May 2005 Posts: 8291 Location: Saint Amant, Acadiana
|
|
Back to top |
|
|
rottingdead Tux's lil' helper
Joined: 12 Sep 2011 Posts: 133
|
Posted: Sun Oct 23, 2011 1:08 am Post subject: |
|
|
Jaglover wrote: | >> appends
> writes (as in overwriting) |
Aaah, =). _________________ Die Geschichte wiederholt sich!!!!! |
|
Back to top |
|
|
Bones McCracker Veteran
Joined: 14 Mar 2006 Posts: 1611 Location: U.S.A.
|
Posted: Sun Oct 23, 2011 2:03 am Post subject: |
|
|
That is an important distinction to remember.
Many a file has been wiped out by somebody hastily trying to add a line to it, and mistakenly using "replace or create" redirection:
Code: | echo "GENTOO_MIRRORS="http://gentoo.osuosl.org/" > /etc/make.conf | (Doh! Say "bye-bye make.conf".)
rather than "append or create" redirection: Code: | echo "GENTOO_MIRRORS="http://gentoo.osuosl.org/" >> /etc/make.conf |
With > redirection, the output goes to a newly created file; if the file already exists, its contents are truncated (the existing file's contents are entirely replaced with the new output).
With >> redirection, the output also goes to a newly created file; but if the file already exists, its contents are added at the end of the existing contents.
This is described in the man page for the shell (most Linux distributions use BASH by default). Type:
It's in the section entitled REDIRECTION.
Although, you might be better served to use a more tutorial-oriented approach:
Bash Beginner's Guide
Advanced Bash Scripting
Since you were using FreeBSD, if you used the command line much, you may be used to the tcsh shell (the FreeBSD default), which is very much like the bash shell, but there are a few differences. I found the second guide above to be very helpful. The more comfortable you are with the shell, the more fun you'll have with Gentoo. _________________
patrix_neo wrote: | The human thought: I cannot win.
The ratbrain in me : I can only go forward and that's it. |
|
|
Back to top |
|
|
rottingdead Tux's lil' helper
Joined: 12 Sep 2011 Posts: 133
|
Posted: Sun Oct 23, 2011 12:38 pm Post subject: |
|
|
BoneKracker wrote: | That is an important distinction to remember.
Many a file has been wiped out by somebody hastily trying to add a line to it, and mistakenly using "replace or create" redirection:
Code: | echo "GENTOO_MIRRORS="http://gentoo.osuosl.org/" > /etc/make.conf | (Doh! Say "bye-bye make.conf".)
rather than "append or create" redirection: Code: | echo "GENTOO_MIRRORS="http://gentoo.osuosl.org/" >> /etc/make.conf |
With > redirection, the output goes to a newly created file; if the file already exists, its contents are truncated (the existing file's contents are entirely replaced with the new output).
With >> redirection, the output also goes to a newly created file; but if the file already exists, its contents are added at the end of the existing contents.
This is described in the man page for the shell (most Linux distributions use BASH by default). Type:
It's in the section entitled REDIRECTION.
Although, you might be better served to use a more tutorial-oriented approach:
Bash Beginner's Guide
Advanced Bash Scripting
Since you were using FreeBSD, if you used the command line much, you may be used to the tcsh shell (the FreeBSD default), which is very much like the bash shell, but there are a few differences. I found the second guide above to be very helpful. The more comfortable you are with the shell, the more fun you'll have with Gentoo. |
Oooooh, tcsh, I didn't know that.. I thought FreeBSD used BASH.. How many shell/terminals are there? LOL.. _________________ Die Geschichte wiederholt sich!!!!! |
|
Back to top |
|
|
Bones McCracker Veteran
Joined: 14 Mar 2006 Posts: 1611 Location: U.S.A.
|
Posted: Mon Oct 24, 2011 1:00 am Post subject: |
|
|
Maybe they do now; I haven't used in a long time.
There are lots of shells for unix and unix-like systems.
The most universal is simply 'sh' (the Bourne shell). Many people write their scripts on that, so that they'll run on any machine.
Other popular ones include csh and tcsh (typical of certain unixen and written to use a C-like syntax easy for C programmers), bash or "Bourne again shell" (which is part of GNU-linux), ksh (typical of certain unixen, which combined and extended features of those already listed -- the open source version of which, pksh, is default on openbsd), and zsh (an extended bash, more than anything else). They each built upon earlier ones and have, over time, incorporated many of each other's features.
There are also some "light" shells useful in certain situations such as bootup or embedded devices (ash, dash, busybox, etc.).
You can read some history here, if you're interested.
http://en.wikipedia.org/wiki/Unix_shell
Don't get intimidated by all this. Just learn bash, which is quite featureful and the default on linux; there's really not that much difference. Also, bash can be invoked as 'sh', in which case it automatically limits itself to sh-compatible features. So, you don't need to install another shell in order to write 'portable' scripts.
If you master the shell and various tools and utilities that can be easily invoked in it, the command-line interface becomes more efficient than a GUI for many purposes, and the same commands can all be scripted, so you can automate virtually anything that you do frequently. I think this is part of the magic of unix-like systems.
Use the links I provided earlier to learn bash. If you're only going to use one of them, use the 2nd one (the Advanced Bash Scripting guide. Have fun. _________________
patrix_neo wrote: | The human thought: I cannot win.
The ratbrain in me : I can only go forward and that's it. |
|
|
Back to top |
|
|
rottingdead Tux's lil' helper
Joined: 12 Sep 2011 Posts: 133
|
Posted: Mon Oct 24, 2011 1:30 am Post subject: |
|
|
BoneKracker wrote: | Maybe they do now; I haven't used in a long time.
There are lots of shells for unix and unix-like systems.
The most universal is simply 'sh' (the Bourne shell). Many people write their scripts on that, so that they'll run on any machine.
Other popular ones include csh and tcsh (typical of certain unixen and written to use a C-like syntax easy for C programmers), bash or "Bourne again shell" (which is part of GNU-linux), ksh (typical of certain unixen, which combined and extended features of those already listed -- the open source version of which, pksh, is default on openbsd), and zsh (an extended bash, more than anything else). They each built upon earlier ones and have, over time, incorporated many of each other's features.
There are also some "light" shells useful in certain situations such as bootup or embedded devices (ash, dash, busybox, etc.).
You can read some history here, if you're interested.
http://en.wikipedia.org/wiki/Unix_shell
Don't get intimidated by all this. Just learn bash, which is quite featureful and the default on linux; there's really not that much difference. Also, bash can be invoked as 'sh', in which case it automatically limits itself to sh-compatible features. So, you don't need to install another shell in order to write 'portable' scripts.
If you master the shell and various tools and utilities that can be easily invoked in it, the command-line interface becomes more efficient than a GUI for many purposes, and the same commands can all be scripted, so you can automate virtually anything that you do frequently. I think this is part of the magic of unix-like systems.
Use the links I provided earlier to learn bash. If you're only going to use one of them, use the 2nd one (the Advanced Bash Scripting guide. Have fun. |
Awesome, thanks, =). _________________ Die Geschichte wiederholt sich!!!!! |
|
Back to top |
|
|
ppurka Advocate
Joined: 26 Dec 2004 Posts: 3256
|
Posted: Mon Oct 24, 2011 5:14 am Post subject: |
|
|
BoneKracker wrote: |
Don't get intimidated by all this. Just learn bash, which is quite featureful and the default on linux; there's really not that much difference. Also, bash can be invoked as 'sh', in which case it automatically limits itself to sh-compatible features. So, you don't need to install another shell in order to write 'portable' scripts. | That's not quite true. This piece of code will run happily in bash (called as /bin/sh), but won't run in some other shells like dash Code: | #!/bin/sh
AAA="bbccdd"
echo "${AAA//b/}" |
_________________ emerge --quiet redefined | E17 vids: I, II | Now using kde5 | e is unstable :-/ |
|
Back to top |
|
|
rottingdead Tux's lil' helper
Joined: 12 Sep 2011 Posts: 133
|
Posted: Mon Oct 24, 2011 5:32 am Post subject: |
|
|
ppurka wrote: | BoneKracker wrote: |
Don't get intimidated by all this. Just learn bash, which is quite featureful and the default on linux; there's really not that much difference. Also, bash can be invoked as 'sh', in which case it automatically limits itself to sh-compatible features. So, you don't need to install another shell in order to write 'portable' scripts. | That's not quite true. This piece of code will run happily in bash (called as /bin/sh), but won't run in some other shells like dash Code: | #!/bin/sh
AAA="bbccdd"
echo "${AAA//b/}" |
|
Hah, just threw me off there with that, =P. _________________ Die Geschichte wiederholt sich!!!!! |
|
Back to top |
|
|
Bones McCracker Veteran
Joined: 14 Mar 2006 Posts: 1611 Location: U.S.A.
|
Posted: Mon Oct 24, 2011 6:15 am Post subject: |
|
|
I had said that when it is invoked as 'sh', 'bash' will pretend to be 'sh', limiting itself to the functions available in 'sh'. He's showing that was not exactly accurate -- that even when you're asking bash to pretend that it is sh, it will handle some bash-unique syntax if it happens to be present.
His point is valid, but don't worry about this trivia for now. Just understand that there are some differences between various unix shells (like different dialects of a language). You are in Linux-land, so learn bash, and worry about the other stuff if and when it comes up. _________________
patrix_neo wrote: | The human thought: I cannot win.
The ratbrain in me : I can only go forward and that's it. |
|
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|