Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Linux \ Linux System Getting Started Tutorial: How do you know Shell which is currently being used     - Ubuntu 14.10 / 14.04 / 12.04 virtual users to install the printing software Boomaga (Linux)

- Linux account related documents Interpretation (Linux)

- Job achieve automation in Ubuntu 14.04 - Using Cron (Linux)

- The text formatting tools awk Linux system (Linux)

- secureCRT remote login Linux must first open the connection protocol (Linux)

- Spring declarative transaction management (Programming)

- Varnish configuration language VCL and its built-in variables (Server)

- Bash How to read a file line by line (Programming)

- How nodeclub constructed Docker image (Server)

- Linux basis: a comprehensive study pwd command (Linux)

- Fedora 20 users install the Mate 1.8 desktop (Linux)

- 7 extremely dangerous Linux commands (Linux)

- Text editing and viewing text Linux command (Linux)

- Not safe procedure under Linux (Linux)

- Depth study and understanding for individual users suicide DDoS attacks (Linux)

- Oracle RMAN-06023 and ORA-19693 errors (Database)

- Hadoop configuration ssh automation of automation (Server)

- To setup Cocos2dx project under Ubuntu (Linux)

- Adjust the size of the hard disk VirtualBox (Linux)

- W and uptime command (Linux)

 
         
  Linux System Getting Started Tutorial: How do you know Shell which is currently being used
     
  Add Date : 2018-11-21      
         
         
         
  Question: I often switch on the command line shell. Is there a quick and easy way to find out I'm currently using shell it? Also, how can I find the current version of the shell?

Find Shell version you are currently using

There are several ways to view what you are currently using shell, the easiest way is through the use of shell special parameters.

One special parameters, named "$$" indicates the current PID you are running shell instance. This parameter is read-only and can not be modified. Therefore, the following command will show that you are running shell name:

$ Ps-p $$
PID TTY TIME CMD
21666 pts / 400: 00: 00bash
The above command can operate in all available shell.

If another way you do not use csh, find the current use of the shell is to use the special parameter "$ 0", which represents the name of the currently running shell or shell script. This is a special parameter Bash, but can also be used in other shell, such as sh, zsh, tcsh or dash. Using the echo command to view the name of the shell you are currently using.

$ Echo $ 0
bash
Do not be called a separate $ SHELL environment variable confused, it is set to the full path of your default shell. Thus, this variable does not necessarily point to your use of the current shell. For example, even if you call a different shell in a terminal, $ SHELL remains unchanged.

$ Echo $ SHELL
/ Bin / shell

So find out the current shell, you should use $$ or $ 0, but not the $ SHELL.

Find out the current version of the Shell

Once you know what you are using the shell, you may want to know this shell version. To do this, enter the shell command line and add "--version" argument in the back can see the version information. E.g:

For bash shell:

$ Bash - version
GNU bash, version 4.3.30 (1) -release (x86_64-pc-linux-gnu)
Copyright (C) 2013FreeSoftwareFoundation, Inc.
LicenseGPLv3 +: GNU GPL version 3or later
Thisis free software; you are free to change and redistribute it.
Thereis NO WARRANTY, to the extent permitted by law.
For zsh shell:

$ Zsh --version
zsh 5.0.7 (x86_64-pc-linux-gnu)
For tcsh shell: $ tcsh --version

tcsh 6.18.01 (Astron) 2012-02-14 (x86_64-unknown-linux) options wide, nls, dl, al, kan, rh, nd, color, filec
For some shell, you can also use shell-specific variables (for example, $ BASHVERSION or $ ZSHVERSION).

$ Echo $ BASH_VERSION
4.3.8 (1) -release
     
         
         
         
  More:      
 
- Oracle GoldenGate tutorial Second, configure and use (Database)
- Linux GCC 5.1.0 compiler installation (Linux)
- Storm how to ensure that at least once semantics (Programming)
- MySQL use benchmarking tool sysbench (Database)
- Volatile keyword in C language understanding (Programming)
- To control based on IP address routing policy under Linux (Linux)
- Windows 7 hard disk installation notes Debian (Linux)
- How to use the on-screen keyboard in Linux (Linux)
- PostgreSQL-- run Supervisord on Docker in Ubuntu (Database)
- Installation of Theano + CUDA under Ubuntu (Linux)
- Android memory optimization of the memory cache (Linux)
- Hadoop1.2.1 plug compilation (Server)
- RabbitMQ tutorial examples: RabbitMQ installation under Windows (Linux)
- Thinking in Java study notes - initialization and cleanup (Programming)
- About Linux iptables firewall interview questions and answers (Linux)
- Using shell users or virtual users to login to pureftpd (Linux)
- TWiki LDAP error appears the problem is solved (Linux)
- Learning Linux coding style (Programming)
- linux system optimization and security configuration (Linux)
- CentOS 6.5_x64 install Oracle 11g R2 (Database)
     
           
     
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.