Operating Systems > Linux and UNIX

How do you find out ...

(1/2) > >>

heljy:
...from the commandline which kernel you are using?

Master of Reality:
i am sure i read something about telling whether you are using bash.

uname -a

[ October 31, 2002: Message edited by: The Master of Reality / B0B ]

KernelPanic:
well done mor you managed to completely misinterpret his question!  

foobar:
( lol )

If you want to see your default shell, take a peek at
/etc/passwd. So if your username would be 'joe':

$ cat /etc/passwd | grep 'joe'

(You could leave the "| grep 'joe'" part away, but what if your passwd file is extremely long?)

Your default shell should be somewhere on that entry that describes your username.

But If you want to know what kernel you are using,
try

$ uname -h

voidmain:
I believe he said "kernel", not "shell". In which case you would do this:

$ cut -d' ' -f3 /proc/version

or

$ dmesg | grep "^Linux version" | cut -d' ' -f3

But you really want to find out what your login shell is you could:

$ chsh

or

$ grep $USER /etc/passwd | cut -d':' -f7

or

$ echo $SHELL

or

$ env | grep SHELL

or

$ set | grep -i shell

or

$ which $SHELL

or

$ lkasjdflkasjdf

which will produce an error message indicating the shell from which the error was produced (in most shells, but not in csh/tcsh).

[ October 31, 2002: Message edited by: void main ]

Navigation

[0] Message Index

[#] Next page

Go to full version