Download files from below link https://drive.google.com/drive/folders/1E7xwtqhU1N4k9b0JE_NjzrdmFC4WDy8D?usp=sharing
Open Cygwin terminal
cd /cygwin/c
make directory ‘UNIX_PRACTICE’
Copy above downloaded files to ‘UNIX_PRACTICE’ cp -f downloaded_directory_path UNIX_PRACTICE/
cd UNIX_PRACTICE/UNIX_LABS
List all the files in the downloaded folder ‘UNIX_LABS’ find . -name “” o count the number of files find . -name “” | wc
List all the .sv files in the downloaded folder ‘UNIX_LABS’ o count the number of files
List all the .txt files in the downloaded folder ‘UNIX_LABS’ o count the number of files
List all .mti files in to mti.txt file find . -name “*.mti” > mti.txt
open the file keep cursor at 1st line, 1st char ctrl+v down arrow, select all lines shift i (I) o now you can type o whatever we do in 1st line, it will reflect in all the lines cp space escape
vi editing go to semaphore folder open top.sv using vi set line number by using :se nu remove line number by using :se nonu again set the numbers
how to quit a file from vi editor escape mode shift+:q! (even if some changes are there, don’t save those changes) shift+:wq (write the changes and quit)
Go to line number 15 :15 enter copy line number:15 (yy) :25 copy it after line number:25 (p)
search for a line escape mode /initial o this is for searching initial o to go next initial, enter ‘n’ o to go prev initial, enter ‘N’
how to replace a word in vi editor replace all initial with start :g/initial/s//start/g all initial are replaced with start now replace start with mystart on selective basis :g/start/s//mystart/gc
while practicing, something wrong happened or some unwanted lines got added, o escape :q! o quit without saving the file
grep is used for searching for a word
open top.sv go to line numebr#17 replace mem_inst with dut
copy line numebr 14 to 16 and paste 3 lines after line number#25 go to line#14 y2 enter go to line#25 p
copy line numebr 30 to 35 and paste 6 lines before line number#17 use P (upper case)
in beginning of all the lines, we want to add one tab space go to line#1 (beginning of the line)` ctrl+v select all lines using down arrow shift+i (I) tab escape
starting from 15th to 25th line, put cp in beginniing of the lines go to line#15 use left arrow, move cursor to start(as much allowed) ctrl+v shift+i select 10 lines till 25 cp escape check if it working, then u (undo)