LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-27-2004, 10:22 PM   #1
r4nd0mz
LQ Newbie
 
Registered: Apr 2004
Location: Canada
Distribution: FreeBSD 4.10
Posts: 7

Rep: Reputation: 0
Question How do I display colours with ls, without using -G (using bash)


Hello, I recently installed FreeBSD (v. 4.10) on a semi-old computer of mine, to use mostly as a programming workstation. However, when I went to 'ls' a directory to view the files there, it was all listed in black and white, and I was unable to tell which files were programs, files, directories, etc. I read the 'man' on ls, and it talked about 3 environment variables: CLICOLOR, CLICOLOR_FORCE, and LSCOLORS. However, I couldn't really do anything with those, I played around them for a while, and didn't get anywhere. It also told me that I could use 'ls -G' to see colours, and I used that, but it was annoying, and I'd rather not type ' -G' everytime I wish to view the contents of a directory with colours.

After searching all the forums here, and finding only one topic that seemed semi-similar, it turning out not to be very close; I decided to post! Where would I go, and what would I do so that it would permanently display appropriate colours of files. (I'm not really concerned about which colours they are, as long as they're different, and distinguishable).

Thanks for any help at all, or even just your time!


Last edited by r4nd0mz; 04-27-2004 at 10:23 PM.
 
Old 04-27-2004, 10:25 PM   #2
ToniT
Senior Member
 
Registered: Oct 2003
Location: Zurich, Switzerland
Distribution: Debian/unstable
Posts: 1,357

Rep: Reputation: 47
in bash:
alias ls='ls -G'

For permanent setting, put that into your ~/.bashrc or ~/.bash_profile or whatever (see invocation section in man bash).
 
Old 04-27-2004, 10:34 PM   #3
r4nd0mz
LQ Newbie
 
Registered: Apr 2004
Location: Canada
Distribution: FreeBSD 4.10
Posts: 7

Original Poster
Rep: Reputation: 0
Yeee-Haw!! It worked!! (I also did: PS1=">> " - my preferred cmd thingy..)
Thanks ever so much!

Gotta love this site
 
Old 04-27-2004, 10:50 PM   #4
r4nd0mz
LQ Newbie
 
Registered: Apr 2004
Location: Canada
Distribution: FreeBSD 4.10
Posts: 7

Original Poster
Rep: Reputation: 0
One more question... How can I set my user to be able to make directories, and files in: /home/?? Would I have to make that the user's 'home' folder? Or what?
 
Old 04-27-2004, 11:34 PM   #5
ToniT
Senior Member
 
Registered: Oct 2003
Location: Zurich, Switzerland
Distribution: Debian/unstable
Posts: 1,357

Rep: Reputation: 47
You shouldn't do it. Other users shouln't be able to modify other users data.

Why would you want to do such thing? Where are you aiming at in a long run?

If you still want to do it, see chmod.
 
Old 04-28-2004, 04:59 PM   #6
r4nd0mz
LQ Newbie
 
Registered: Apr 2004
Location: Canada
Distribution: FreeBSD 4.10
Posts: 7

Original Poster
Rep: Reputation: 0
I'm using that computer mainly for programming, and I'm storing all my files in /home/. I don't want to have to be logged in as root all the time to create files, and make directories, etc. (There is only one user - me. [root too, of course]) And I want full permissions to be able to create files and do w/e without having to be logged in with root. Anyways, I'll look at chmod to see the proper settings. Thx!
 
Old 04-28-2004, 05:53 PM   #7
Matt Collier
Member
 
Registered: Apr 2004
Distribution: Debian
Posts: 80

Rep: Reputation: 15
regardless, it's still good practice to do as little as possible as root. most programmers that do require a full file system to test with use a chroot'd environment so as to not possibly corrupt the system with buggy code. even if you were creating a farily ambitious program that did require access to the majority of the file system, standard practice is to create a new user for the system and to chmod the required dirs to this user, and have the code executed as this user, so if it potentially runs away, the worst it can do is destroy it's own run environment, leaving the system itself safe.
i would recommend looking into suid.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
BASH colours in SSH term jambo4u Linux - Newbie 2 11-22-2005 05:44 AM
xset is unable to open display from within bash script copolii Linux - General 3 10-22-2005 06:26 PM
How to use colours in c++ ? twirl Programming 3 10-05-2005 10:09 PM
bash colours devinWhalen Linux - Newbie 6 12-02-2003 10:49 AM
in bash japanese can't properly display. lrp Linux - General 2 05-30-2002 02:04 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:39 AM.

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