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 under Spark development environment to build (Server)

- How to use the beta / unstable version of the software in Debian library (Linux)

- To install the Ubuntu Touch emulator on Ubuntu (Linux)

- Digital jQuery scrolling effect (Programming)

- Nginx load balancing configuration (http proxy) (Server)

- Some problems and countermeasures Linux system calls exist (Linux)

- AWK principles and commands and file input (Linux)

- The Sublime Text 3 configuration file (Linux)

- I use the desktop environment in GNU / Linux combination tool (Linux)

- Unity Greeter Badges: the lost session icon back to the login screen Ubuntu (Linux)

- Firewall settings oracle remote connection in Linux systems (Linux)

- Partition contrast manifestations under Windows and Linux (Linux)

- MyCAT read and write separation of MySQL (Database)

- MySQL 5.7.9 source compiler installation instructions (Database)

- How to install new fonts on Ubuntu 14.04 and 14.10 (Linux)

- Oracle 11g new features and associated SQL TUNING (Database)

- Search Linux commands and files - which, whereis, locate, find (Linux)

- The security administrator network analysis tools SATAN Introduction under Linux (Linux)

- Getting CentOS Learning Notes (Linux)

- Nginx configuration support f4v video format player (Server)

 
         
  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:      
 
- Create your own YUM repository (Linux)
- ORA-4031 error Solution (Database)
- C ++ implementation of the list of basic operations and test cases (Programming)
- To configure Samba to share files with Windows under CentOS (Linux)
- Unix system security configuration (Linux)
- FileZilla FTP && TLS connection settings of (Linux)
- Java MD5 encryption implementation (Programming)
- Ubuntu 15.10 installation and deployment Swift development environment (Linux)
- Use Ansible to bulk manage remote servers (Server)
- Getting Started with Linux: Learn how to install and access CentOS 7 Remote Desktop on a VPS (Server)
- The several technical presentation Raid under Linux (Linux)
- Automatic and Manual Proxy Settings Switch GNOME Shell Extension Proxy Switcher Recommend (Linux)
- Linux Learning Notes: Users and Groups (Linux)
- C ++ why we chose to use the smart pointer (Programming)
- Monitor log file (listener.log) (Database)
- 10 useful Linux command line tips (Linux)
- Linux, MySQL root privilege escalation another method (Linux)
- How to upgrade to Ubuntu 14.04 Ubuntu 14.10 (Linux)
- CentOS yum install LNMP PHP5.4 version (Server)
- Sort search algorithm Java - application examples with recursive dichotomy (Programming)
     
           
     
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.