Results 1 to 6 of 6

Thread: Ubuntu 22.04 - Change the color, font and background of files and folders in terminal

  1. #1
    Join Date
    Jun 2024
    Beans
    2

    Ubuntu 22.04 - Change the color, font and background of files and folders in terminal

    Hi,

    I want to change the color, font and background of files and folders in terminal (see attachment).
    In the first picture for instance, bash_cmd is a folder.
    I want to change the background, but I don't know how.

    Thank you in advance.
    Attached Images Attached Images

  2. #2
    Join Date
    Dec 2014
    Beans
    2,698

    Re: Ubuntu 22.04 - Change the color, font and background of files and folders in term

    The colouring of the output of the 'ls' command is controlled by the environment variable LS_COLORS. There is a command named 'dircolors' for setting up that variable. The default ~/.bashrc is set up to load a file ~/.dircolors into that command. To create such a file you can use 'dircolors --print-database>~/.dircolors'. You can use any text editor to change that file. The generated file has comments that describe what value you can set.

    Holger
    Last edited by Holger_Gehrke; June 29th, 2024 at 07:48 PM.

  3. #3
    Join Date
    Jun 2007
    Location
    Arizona U.S.A.
    Beans
    5,847

    Re: Ubuntu 22.04 - Change the color, font and background of files and folders in term

    The terminal has lots of settings in it's preferences dialog, including theme and colors. You can change those in that dialog. See screenshot. Under profiles, the default is just called "unnamed" here. Click that and use the appropriate tab to make changes to the default. Or make a new profile.
    Attached Images Attached Images

  4. #4
    Join Date
    Jun 2016
    Beans
    2,938
    Distro
    Xubuntu 22.04 Jammy Jellyfish

    Re: Ubuntu 22.04 - Change the color, font and background of files and folders in term

    Is the problem actually that you're mounting a NTFS or other non-Unix filesystem with more permissive permissions than you're using? Does ls -la show those files and folders having the exact permissions you need/want?
    Xubuntu 22.04, ArchLinux ♦ System76 hardware, virt-manager/KVM, VirtualBox
    If your questions are resolved to your satisfaction, please use Thread Tools > "Mark this thread as solved..."

  5. #5
    Join Date
    Jun 2024
    Beans
    2

    Re: Ubuntu 22.04 - Change the color, font and background of files and folders in term

    In Screenshot_001, the folders are the ones with blue color. They are the folders in the home directory.


    In Screenshot_002 and Screenshot_003, the folders are on a green background. I would like that background to be gone.
    Indeed, those folders may be NTFS folders since they are shared Windows folders.
    Is it possible to remove that background?
    Thank you. All the best!
    Attached Images Attached Images

  6. #6
    Join Date
    Dec 2014
    Beans
    2,698

    Re: Ubuntu 22.04 - Change the color, font and background of files and folders in term

    That pattern of colours (blue text on green background) in 'ls' with the standard LS_COLORS settings means 'directory writable by others' and is meant to draw your attention to the question of whether or not those permissions are what you want. So you can either change the way you mount that NTFS-Volume (give the options uid=, gid=, and fmask= with appropriate values so the mounted device is not by default writable by anyone and everyone; see 'man mount.ntfs' for details) or if you only want to change the way it's presented you can change the colours produced by 'ls' in the way I mentioned in Post #2.

    Holger

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •