Uploaded by Connor Hsia

AssignmentChap3 4

advertisement
3-1
You can run the command:
find . -mtime – 90 | -exec cp --parents \{\} ~/CFO’s home directory/ \;
This command will find the files modified within the past 90 days, and by piping -exec cp command you
can copy that directory’s files and maintain folder hierarchy.
3-2
~/home/*> ln sci.journal /workgrp/project
This command will link the log file sci.journal that exists in the directory
/workgrp/project
4-1
You need the set number command added to the .vimrc file in the home directory, doing
so will lead to the line numbers being displayed at open.
4-2
To open either of the files in vim, use the command “#vim /home/beth/project/1stqtr”
or “#vim /home/beth/project/2ndqtr” to access text file.
From here, she can edit the file by typing “/” and then the name of the value she
wants to edit (her maiden name) and hit enter to search for the value. Once found,
type in “I” to enter insert mode and modify the value. Press ESC and then enter in
“:wq!”, press enter and changes will save and she will exit vim.
4-3
Everything in Vi is available in Vim, with Vi being a simpler and more standard text editor to use. Vim
just adds more capability on to Vi.
Some of Vim’s capabilities include:

Compatible with more OS’s than Vi

Includes more support such as syntax highlighting, code folding for several programming
languages

Integrated with cscope

Can utilize network protocols to edit files

Has multilevel undo/redo

Allows split screen for multiple file editing

Allows editing of compressed files

Includes built in vimdiff for comparing, completing and merging files

Includes support for plugins and allows more customization and control over config and startup
files

Is capable of being scripted with vimscript or other scripting languages
All in all, Vim has much more to provide over Vi and has much more functionality. It can also
continuously saves the changes a user makes by utilizing the .swp extension and can be used to recover
in the event of a crash.
Download