Unix Shell Scripting; it provides you with an interface to the UNIX system
- Bourne shell ( sh)
- Korn shell ( ksh)
- Bourne Again shell ( bash)
- POSIX shell ( sh)
Unix Shell commands are powerful tools used to interact with and manage the Unix operating system. They allow users to perform a wide range of tasks, from basic file manipulation to complex system administration. Here's a summary of key aspects and commonly used commands:
ls: Lists files and directories. cd: Changes the current directory. pwd: Prints the current working directory. mkdir: Creates new directories. rmdir: Removes empty directories.
touch: Creates empty files or updates timestamps. cp: Copies files or directories. mv: Moves or renames files or directories. rm: Removes files or directories.
cat: Concatenates and displays file contents. more and less: View file contents page by page. head: Displays the beginning of a file. tail: Displays the end of a file.
grep: Searches for patterns within files. find: Searches for files in a directory hierarchy.
chmod: Changes file permissions. chown: Changes file ownership and group.
ps: Displays current processes.
echo: Displays messages or variables. man: Displays the manual for other commands.
vi data.txt
cat /usr/include/linux/capability.h
wc -l
tar -xvf data.tar.gz -C /opt/landingpad/stagingarea
df -kh
ping github.com
netstat -tulpn
traceroute github.com
awk '{print $1,$4}' app.log
split -b 1024K bigdata.psv segment
echo 'someimportanttext' | base64
echo 'c29tZWltcG9ydGFudHRleHQ=' | base64 --decode
md5sum filename
tail -f data.txt
date +%H:%M
curl -O --silent ftp://<someserver>/data.zip
30 08 10 06 * /home/jobs/run_backup.sh
- 30 – 30th Minute
- 08 – 08 AM
- 10 – 10th Day
- 06 – 6th Month (June)
-
- – Every day of the week
mail -s 'subject' -c 'cc-address' -b 'bcc-address' 'to-address'
awk '{print $1,$4}' data.txt
awk '{ if (length($0) > max) max = length($0) } END { print max }' data.txt
egrep -i data filename | less
uname
uname -a
diff A.dat B.dat
kill PID
or
kiil -9 PID