LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 09-04-2020, 12:31 AM   #31
ul7
Member
 
Registered: Jan 2020
Posts: 115

Original Poster
Rep: Reputation: 30

OK...so eventually (probably a long time from now) I could "forge" my own Slackware, right? That explains why the family trees of Linux are insane. Wow, I guess that means understanding kernels and shells. Probably won't go down that rabbit hole yet lol. The man pages are really helpful. The Slackbook is also helpful. So in the CLI or Terminal Console, BASH is the default shell right?

Last edited by ul7; 09-04-2020 at 12:33 AM.
 
Old 09-04-2020, 12:43 AM   #32
ul7
Member
 
Registered: Jan 2020
Posts: 115

Original Poster
Rep: Reputation: 30
Funny story: Was talking to another classmate about Linux, and he asked what distro I was trying out. I told him Slackware, and he was like "WTF? Why on earth would you use that?" I replied, "Because it's challenging, and doesn't hold your hand?" I then said, "Let me guess, you use Ubuntu, right?" I think we know the rest of this story. ^_^ I'm sure Ubuntu is great nothing against it, but I need something that's going to really teach me the rich history of Linux ya know?

Last edited by ul7; 09-04-2020 at 01:01 AM.
 
Old 09-04-2020, 03:30 AM   #33
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,651
Blog Entries: 19

Rep: Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480
Quote:
Originally Posted by ul7 View Post
OK...so eventually (probably a long time from now) I could "forge" my own Slackware, right? That explains why the family trees of Linux are insane. Wow, I guess that means understanding kernels and shells.
All Linux distros use basically the same kernel. Different versions and different build parameters but it's the same program. That program is the only one that's actually called Linux (it's named after its creator).

Where distros differ is in their userspace software. They have different package managers, different default desktops and so on. And different philosophies of course. As well as the Expert-Novice axis, there are also differences between bleeding edge, continuously updated distros and stable ones with point releases. There are even some distros that distribute source code rather than binaries.
Quote:
So in the CLI or Terminal Console, BASH is the default shell right?
Nearly always, yes. Gentoo used to use zsh but I don't know if it still does.
Quote:
-Learning VIM for future C Programming and Python. (I'm kind of glad I waited later in life to start learning this. I haven't developed any habits at all, so thank god I found VIM first. The thing about these editors is NO MOUSE TOUCHING. Super productive.)
Don't be such a snob! There's nothing wrong with using a mouse in moderation. vim has so many commands, I doubt if anyone can remember them all. I certainly can't! I prefer gvim, which has all the power of vim but also ancillary menu and tool bars.

For programming, I use geany. It has syntax colouring like vim (like most Linux editors in fact) but it also has function name completion and you can have multiple files open side by side. That's very useful in C. You can also fold the code display to bring more distant parts of a file together for comparison. There are even limited build facilities, though it isn't really an IDE. A feature that I particularly like is that when you launch it, it comes up with the contents it had when you last shut it down.

Last edited by hazel; 09-04-2020 at 03:41 AM.
 
Old 09-04-2020, 08:38 AM   #34
ul7
Member
 
Registered: Jan 2020
Posts: 115

Original Poster
Rep: Reputation: 30
Talking

Quote:
Don't be such a snob! There's nothing wrong with using a mouse in moderation. vim has so many commands, I doubt if anyone can remember them all. I certainly can't! I prefer gvim, which has all the power of vim but also ancillary menu and tool bars.

For programming, I use geany. It has syntax colouring like vim (like most Linux editors in fact) but it also has function name completion and you can have multiple files open side by side. That's very useful in C. You can also fold the code display to bring more distant parts of a file together for comparison. There are even limited build facilities, though it isn't really an IDE. A feature that I particularly like is that when you launch it, it comes up with the contents it had when you last shut it down.
LOL!...sorry hazel I didn't meant to come off snooty! :-D I probably won't even start programming right now, because I'm still learning the file systems and stuff like that. I think I was mainly thinking out loud, and was maybe getting ahead of myself. It's so fun learning Linux! I wish I would have used Linux earlier in life, but I think the main thing that always strayed me away was compatibility with PC gaming. Now that I have put gaming aside to improve my lifestyle and gain skills, I realize I should have done that a LONG time ago. I'll definitely check out few different editors like geany. I've got a few No Starch Press books on command line and learning Linux as an OS. I think for me, learning the fundamentals is paramount. Thanks for the feedback!

Last edited by ul7; 09-04-2020 at 08:59 AM.
 
Old 09-04-2020, 12:30 PM   #35
ul7
Member
 
Registered: Jan 2020
Posts: 115

Original Poster
Rep: Reputation: 30
Is there a way to permanently put dircolors on the bash for ls command with out typing --col? I have a screen shot to show what I mean. The middle terminal is the one I tried configuring. It's not a big deal, but it would make learning filesystems a lot faster for me. I probably shouldn't mess with these things yet, since I'm just randomly trying things out. Thanks slackers!!!

UPDATE: Nevermind I used an alias instead.

-ul7
Attached Thumbnails
Click image for larger version

Name:	snapshot1.png
Views:	29
Size:	227.7 KB
ID:	34011  

Last edited by ul7; 09-04-2020 at 12:41 PM. Reason: I used the alias command to change "ls" to "ls --color"
 
Old 09-04-2020, 01:09 PM   #36
Fat_Elvis
Member
 
Registered: Oct 2016
Distribution: FreeDOS 1.2
Posts: 309

Rep: Reputation: 92
Quote:
Originally Posted by ul7 View Post
Is there a way to permanently put dircolors on the bash for ls command with out typing --col? I have a screen shot to show what I mean. The middle terminal is the one I tried configuring. It's not a big deal, but it would make learning filesystems a lot faster for me. I probably shouldn't mess with these things yet, since I'm just randomly trying things out. Thanks slackers!!!

UPDATE: Nevermind I used an alias instead.

-ul7
You could put a dircolors file, in for example ~/.config/dir_colors, and put this in your ~/.bash_profile:

Code:
eval $(dircolors -b "${HOME}/.config/dir_colors")
Get the original file from /etc/DIR_COLORS and modify to your liking by adding lines. Like so:

Code:
.txt    00;33
.gz     01;31
.ogg    01;35

Last edited by Fat_Elvis; 09-04-2020 at 01:12 PM.
 
1 members found this post helpful.
Old 09-04-2020, 01:57 PM   #37
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
Quote:
Originally Posted by ul7 View Post
Is there a way to permanently put dircolors on the bash for ls command with out typing --col? I have a screen shot to show what I mean. The middle terminal is the one I tried configuring. It's not a big deal, but it would make learning filesystems a lot faster for me. I probably shouldn't mess with these things yet, since I'm just randomly trying things out. Thanks slackers!!!

UPDATE: Nevermind I used an alias instead.

-ul7
You'll want to learn about login and non-login shells. login shells will automatically run all the contents in /etc/profile.d/, which includes setting colors for ls. non-login shells will not do this and will rely on settings in ~/.bashrc

There's many things you can do (which you may want to add to your list of things to research) to get things working properly, but seeing that it looks like you're using konsole, the simplest thing to do is just make all shells within konsole open up as a login shell.

If you go to Settings -> Edit current profile, and then change the command from /bin/bash to /bin/bash -l (dash lower-case L), that will change each shell to be a login shell. You may need to exit your current shell to fix this. You can also start a login shell by running bash -l at the prompt.

When you do your research on these, make sure you look up login vs non-login shell, interactive vs non-interactive shell, and ~/.bash_profile vs ~/.bashrc

I'm too lazy to remember all the research I did on those and found it was easier to just force a login shell every time. You'll also get the side benefit of a better PS1 prompt (the text that shows to the left of the cursor on a new line in the shell).
 
1 members found this post helpful.
Old 09-04-2020, 02:08 PM   #38
ul7
Member
 
Registered: Jan 2020
Posts: 115

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by bassmadrigal View Post
You'll want to learn about login and non-login shells. login shells will automatically run all the contents in /etc/profile.d/, which includes setting colors for ls. non-login shells will not do this and will rely on settings in ~/.bashrc

There's many things you can do (which you may want to add to your list of things to research) to get things working properly, but seeing that it looks like you're using konsole, the simplest thing to do is just make all shells within konsole open up as a login shell.

If you go to Settings -> Edit current profile, and then change the command from /bin/bash to /bin/bash -l (dash lower-case L), that will change each shell to be a login shell. You may need to exit your current shell to fix this. You can also start a login shell by running bash -l at the prompt.

When you do your research on these, make sure you look up login vs non-login shell, interactive vs non-interactive shell, and ~/.bash_profile vs ~/.bashrc

I'm too lazy to remember all the research I did on those and found it was easier to just force a login shell every time. You'll also get the side benefit of a better PS1 prompt (the text that shows to the left of the cursor on a new line in the shell).
Yep that fixed it permanently. Thanks, sounds like I need to learn a bit about shells and bash. That's actually what I'm doing tonight. Lol I love fortune, so that pops up on every session now on the desktop. Nice! This also shows the pwd like you mentioned which will help when following some of the books and man pages I'm reading.

Last edited by ul7; 09-04-2020 at 02:20 PM.
 
Old 09-04-2020, 02:10 PM   #39
ul7
Member
 
Registered: Jan 2020
Posts: 115

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by Fat_Elvis View Post
You could put a dircolors file, in for example ~/.config/dir_colors, and put this in your ~/.bash_profile:

Code:
eval $(dircolors -b "${HOME}/.config/dir_colors")
Get the original file from /etc/DIR_COLORS and modify to your liking by adding lines. Like so:

Code:
.txt    00;33
.gz     01;31
.ogg    01;35
This along with bassmadrigal's suggestion has made this easier and now customizable. Thanks you two!
 
Old 09-04-2020, 02:32 PM   #40
ul7
Member
 
Registered: Jan 2020
Posts: 115

Original Poster
Rep: Reputation: 30
Ah never mind I just fixed another issue I had. I guess the bash_profile is not set by default. So I just made one in VIM with the alias's I find nice.

Last edited by ul7; 09-04-2020 at 02:53 PM.
 
Old 09-04-2020, 02:54 PM   #41
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
You can add that to a ~/.bash_profile to be run on login shells or a ~/.bashrc to be run in non-login shells.

(You can source one or the other within the other to have it work in both.)

Since you're now using a login shell, you can just add it to ~/.bash_profile (the file doesn't exist by default, just create it and add the text in there).

NOTE: You should also know that there's ~/.profile and ~/.bash_profile. ~/.profile is read with pretty much any shell on when in a login session (including bash incompatible shells, like korn or csh). ~/.bash_profile is only run by bash shells. If you have no intention on trying other shells, you can put everything in ~/.profile.
 
2 members found this post helpful.
Old 09-04-2020, 03:06 PM   #42
ul7
Member
 
Registered: Jan 2020
Posts: 115

Original Poster
Rep: Reputation: 30
Oh OK that makes sense. What about when I go into su mode? I notice when I go into su mode my alias's and colors are gone as well. I'm assuming that's a different profile? I probably shouldn't worry about using su right now.

Last edited by ul7; 09-04-2020 at 03:27 PM.
 
Old 09-04-2020, 03:41 PM   #43
Fat_Elvis
Member
 
Registered: Oct 2016
Distribution: FreeDOS 1.2
Posts: 309

Rep: Reputation: 92
Quote:
Originally Posted by ul7 View Post
Oh OK that makes sense. What about when I go into su mode? I notice when I go into su mode my alias's and colors are gone as well. I'm assuming that's a different profile? I probably shouldn't worry about using su right now.
Every user will have their own shell RC files. /root/.bash_profile will be read by the root user.

Note that you may want to set different defaults for root.

If you decide on Bash as your shell, I recommend playing around with it. It is both very customizable, and an impressive scripting language in its own right.

Last edited by Fat_Elvis; 09-04-2020 at 03:50 PM.
 
Old 09-04-2020, 03:48 PM   #44
ul7
Member
 
Registered: Jan 2020
Posts: 115

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by Fat_Elvis View Post
Every user will have their own shell RC files. /root/.bash_profile will be read by the root user.


Note that you may want to set different defaults for root.
Nice. I will definitely keep that in mind. I better take snapshots while I'm ahead. It's only a matter of time before my curiosity breaks something lol...
 
Old 09-04-2020, 04:42 PM   #45
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
Quote:
Originally Posted by ul7 View Post
Oh OK that makes sense. What about when I go into su mode? I notice when I go into su mode my alias's and colors are gone as well. I'm assuming that's a different profile? I probably shouldn't worry about using su right now.
Correct. Root's files would be located in root's home directory (which is /root/, whereas all other users reside under /home/$USER/). So if you want root to have the same things, you can either copy your ~/.bash_profile to root's home directory, or you can make the changes systemwide by editing /etc/profile directly (or adding your own file under /etc/profile.d/, just make sure it ends in .sh or it won't be added).

Also, when running plain su, you don't get a login shell. This works for a lot of things, but sometimes you need all the scripts in /etc/profile.d/ to be run (especially when compiling). To run su with a login instance, you would run:

Code:
su -
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
New to this forum, but not completely new to Linux... mercfocus LinuxQuestions.org Member Intro 0 11-30-2011 09:34 PM
Problem installing pidgin 2.6.3..am completely new to linux...very new deepak.nagadi Linux - Newbie 5 11-10-2009 05:12 PM
New member - not completely new to Linux corgi LinuxQuestions.org Member Intro 3 03-13-2006 10:42 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 03:58 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration