≡ Menu

set command

Unix/ Linux: Print Environment Variables Command

I am a new shell user. How do I print or list environment variables on Linux and Unix-like operating system using shell prompt? In Linix and Unix, how can I print values of all my environment variables?
[click to continue…]

Linux: List All Environment Variables Command

How do I display all my environment variables using bash shell on RHEL / Debian / Ubuntu / CentOS / Fedora / Mint Linux operating systems?
[click to continue…]

TCSH / CSH: set vs setenv Command Differences

I've recently started to use FreeBSD operating system with tcsh (c shell clone) shell. I noticed that both set and setenv command set shell user environment. What's the difference between the SET and SETENV commands?
[click to continue…]

Linux: Set Environment Variable

Bash shell is used for various purposes under Linux. How do I customize the shell environment variable under Linux operating systems?
[click to continue…]

Linux / UNIX Automatically Logout BASH / TCSH / SSH Users After a Period of Inactivity

My development and testing webserver is used by over 100s of users. These users login from Windows XP, Linux, Mac OS X system via ssh/putty client. How do I set or automatically log users out after a period of inactivity under RHEL/Fedora/CentOS Linux server to improve server security and save some resources?
[click to continue…]

FreeBSD Display Environment Settings

Q. How do I display shell environment settings under FreeBSD operating systems?
[click to continue…]

UNIX / Linux: Set your PATH Variable Using set or export Command

How do I add a new path to $PATH variable under Linux and UNIX like operating system? What is my path, and how do I set or modify it using csh/tcsh or bash/ksh/sh shell?
[click to continue…]

Change default Linux / UNIX text editor from VI to Pico

Q. I find vi hard to use. How do I change my default text editor from vim / vi to Pico under Debian Linux?

A. To use and change an editor to edit your text message, set the variable EDITOR to the pathname of the vi / vim binary file. You need to use export or set command for the same purpose.

Many Linux / UNIX command read shell EDITOR environment variable to determine which editor to use for editing a text file.

Set default text editor to pico

Type the command as follows:
$ which pico


Now setup a new text editor:
export EDITOR=/usr/bin/pico
export EDITOR=pico

Add above line to ~/.bashrc file:
$ vi ~/.bashrc
Append text as follows:
export EDITOR=pico
Close and save the file. There is no no need to reboot system.

Also you can add alias if you want:
alias vi=/usr/bin/pico

BASH Shell setup filename tab-completion case insensitive

Q. I’m using BASH shell filename tab completion feature to complete file names and other stuff. However default tab-completion in bash case-sensitive. It cannot show me /tmp/Y* or /tmp/Y* files. How do I force filename tab-completion in bash case insensitive?

A. According to bash man page completion-ignore-case set to Off. If set to On, readline performs filename matching and completion in a case-insensitive fashion. Readline has variables that can be used to further customize its behavior. A variable may be set in the /etc/inputrc file with a statement of the form. So all you have to do is type following command:
$ set completion-ignore-case on

You need to add set completion-ignore-case on to /etc/inputrc command:
vi /etc/inputrc
Append text as follows:
set completion-ignore-case on
Close and save the file. For more information read bash man page.