1. Download files from below link
    https://drive.google.com/drive/folders/1E7xwtqhU1N4k9b0JE_NjzrdmFC4WDy8D?usp=sharing
  2. Open Cygwin terminal
  3. cd /cygwin/c
  4. make directory ‘UNIX_PRACTICE’
  5. Copy above downloaded files to ‘UNIX_PRACTICE’
    cp -f downloaded_directory_path UNIX_PRACTICE/
  6. cd UNIX_PRACTICE/UNIX_LABS
  7. List all the files in the downloaded folder ‘UNIX_LABS’
    find . -name “” o count the number of files find . -name “” | wc
  8. List all the .sv files in the downloaded folder ‘UNIX_LABS’
    o count the number of files
  9. List all the .txt files in the downloaded folder ‘UNIX_LABS’
    o count the number of files
  10. List all .mti files in to mti.txt file
    find . -name “*.mti” > mti.txt
  11. 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
  12. 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
  13. 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)
  14. Go to line number 15
    :15 enter
    copy line number:15 (yy)
    :25
    copy it after line number:25 (p)
  15. 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’
  16. 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
  17. while practicing, something wrong happened or some unwanted lines got added,
    o escape
    :q!
    o quit without saving the file
  18. grep is used for searching for a word
  19. open top.sv
    go to line numebr#17
    replace mem_inst with dut
  20. 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
  21. copy line numebr 30 to 35 and paste 6 lines before line number#17
    use P (upper case)
  22. 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
  23. 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)
  24. create a folder MTI
    • copy all .mti files to MTI folder
Course Registration