I was excited on joining this course because i consider this as a major stepping stone in my life of becoming a programmer. On the first day, Noufal Ibrahim sir showed how the syllabus works.
We started with the basics. The first task was to know the Unix and it's commands. For that he gave us a book called "Unix Programming Environment" written by "Brian W.Kernighan". For those who are beginners, i would strictly recommend this book because the author has written it in simple words. some of the commands mentioned in the book are below :-
ls -List out names in current Directory
man -Open the terminal manual for better understanding of the command
cat -prints the contents of the specified file
mkdir -Make Directory
cd -Change Directory
grep -searches a file for words that have a specified pattern
sort -sorts the file (the command is case sensitive)
wc -displays the number of lines,words,characters are present in a text file
mv/cp/rm -move/copy/remove a specified file
| -Pipe -putting an output of one program as the input of the other program
most of the time they are used along with their arguments such as -r, -f, -t, -k etc
from the first day onwards we started using gtypist. By practising everyday my speed has started to increase. It is really helpful in gaining speed.
An ounce of practice is worth more than tons of preaching. - Mahatma Gandhi
For the first week my presentation was about the command dd. It was mainly used to convert and copy files. dd can also read and/or write from/to the harddisk whereas the cp command cannot. It has a nickname called data destroyer because without the proper usage it can destroy all the files. It is a super user command. The main uses are :-
1) Backing up harddisk.
2) convert ascii codes to readable text/lower case to upper case etc.
dd if=<source filename> of=<target filename>
mainly used arguments are :-
read and write up to BYTES bytes at a time (default: 512); over‐
rides ibs and obs
convert the file as per the comma separated symbol list.
count=N copy only N input blocks.
1)Master boot record backup and restore
It is possible to repair a master boot record. It can be transferred to and from a repair file. To create an image of the entire x86 master boot record:
dd if=/dev/sda of=MBR.img bs=512 count=1
dd can modify data in place. For example, this overwrites the first 512 bytes of a file with null bytes:
dd if=/dev/zero of=path/to/file bs=512 count=1 conv=notrunc
notrunc - do not truncate the output file, that is, if the output file already exists, just replace the specified bytes and leave the rest of the output file alone.
Sometimes it is necessary to have a disk wipe of a discarded device. To wipe a disk by writing zeros to it, dd can be used this way:
dd if=/dev/zero of=/dev/sda bs=16M
4)Converting a file to upper case
To convert a file to uppercase:
dd if=filename of=filename1 conv=ucase,notrunc
ucase - convert into uppercase.
That's all for today's blog. See you all in the next one.