≡ Menu

Unix C Shell ( csh / tcsh ) Tutorials

Tutorials, tips, tricks, and shell scripting techniques about Berkeley UNIX C shell and tcsh – an enhanced version of original csh ( rss feed ).

Unix Copy Command Examples [ cp command ]

How do I copy files under Unix operating system using ksh or csh or bash shell prompt?
[click to continue…]

TCSH / CSH / C Shell Check Whether a Directory is Empty or Not

How do I check whether a directory is empty or not under Linux / UNIX using a TCSH / C shell script?
[click to continue…]

Linux / UNIX: Run Command a Number of Times In a Row

How do I run "foo" command 10 times (or n times) under Linux or UNIX like operating systems?
[click to continue…]

UNIX: Lynx Browser Set / Change the Default Home Page

How do I change the default home page with Lynx browser under UNIX or Linux operating system? How do I set the startup page to http://google.co.uk with Lynx?
[click to continue…]

Linux / UNIX: Run Commands When You Log Out

I've written a Perl script that connects to our central server for me and it allows me feed data so that I make a timesheet later. How do I run my script when I log out from Apple OS X or Linux / UNIX workstation using bash shell?
[click to continue…]

HowTo: Display / Echo Path Settings In Linux / UNIX / *BSD

How do I display my current path settings under Linux / FreeBSD / OpenBSD / NetBSD / Apple OS X / UNIX like operating systems using bash or ksh or csh / tcsh shell?
[click to continue…]

Configure BASH, KSH, TCSH, ZSH Shell To Logout User Automatically After Idle Time

tmout on a Linux/Unix shell
How can I configure the bash or ksh shell to logout any user automatically after a period of idle time under a Debian Linux or any other UNIX-like operating system?
[click to continue…]

Understanding command line shell

Q. I’ve migrated from Windows NT to Linux workstation. Most documents refer to a command line shell. Can you explain me command line shell?

A. A shell allows you to type the commands such as date or clear. There are many shell available. BASH (bourne again shell) is default shell for most Linux distributions.

It also known as a command interpreter which takes command from user and pass the same to kernel for execution. Bash shell supports aliases, filename completion, command history, POSIX compatibility and many other features.

Other UNIX / Linux shell

  • csh / tcsh
  • sh / ksh

Howto: Changing Linux Login Shell

Q. Can you tell me command to change login shell in Linux / UNIX operating system?

A. You don't have to edit /etc/passwd file to change your shell. You need to use chsh command. It changes the user login shell. This determines the name of the users initial login command. A normal user may only change the login shell for his/her own account, the super user i.e. root user may change the login shell for any account. Following is syntax of chsh command:
chsh -s {shell-name} {user-name}


  • -s {shell-name} : Specify your login shell name. You can obtained list of avialble shell from /etc/shells file.
  • User-name: It is optional, useful if you are a root user.

First, find out available shell list:
$ less /etc/shells



Now change your shell name to /bin/tcsh:
$ chsh -s /bin/tcsh

When promoted for password, type your own password. If you just type chsh command, it will prompt for shell name interactively:
$ chsh


Changing the login shell for tv
Enter the new value, or press ENTER for the default
       Login Shell [/bin/bash]: