1.2 Bash shell 11
Commands to list output of les: includescat,od, andnl,
Formatting:fmt,fold,
Output parts of les:head,tail, and split,
Summarizing les:wc,sum,cksum, md5sum, and sha1sum,
Sorting:sortanduniq,
Operating on elds within a line:cut,paste, and join,
Operating on characters:tr, andexpand,
Directory listing:ls, anddir,
Basic operations:cp,mv,rm,shred, dd, andinstall,
Changing le attributes:chown, chmod, chgrp, and touch,
Disk usage:df,du,stat, truncate, and sync,
Printing text:echo, printf, and yes,
Conditions:false, true, test, and expr,
Redirection:tee,
File name manipulation:basename, dirname, and pathchk,
Working context:pwd,tty, andprintenv,
User information:id,logname, whoami, groups, users, and who,
System context:date, arch, uname, hostname, hostid, and uptime,
Process control:killandsleep.
1.2 Bash shell
The Bash shell is an UNIX shell for the GNU system and is often the default shell
on GNU/Linux. Bash is actually an acronym forBourne-again shell, which is a pun
on theBourneshell. Bash is POSIX compliant, but also has a number of extensions.
We list some of the important features of Bash below:
Brace expansion: running:
[skoranne@celex ]$ echo a,{b,c,d},e
a,b,e a,c,e a,d,e
Keyboard shortcuts: supports Emacs style keyboard shortcuts,
Startup scripts: loads and executes/etc/profilefor login,/.bashrcfor
interactive shells,
Redirection: supports input and output redirection.
1.2.1 Bash shell scripting
The Bash shell supports scripting and programming. This feature is very useful in
automating repetitive tasks and system administration. Consider a directory with
JPG les, and that you want to add a prex to all the lenames, such as Printed.