Commit 1cd3656d authored by Jyothis Jagan's avatar Jyothis Jagan
Browse files

Adding session 2

parent 48640e96
#Text Editing and Searching
##Console Text Editors
Below given are some of them.
* Vim
* Nano
* Emacs
* Micro
The session started with trying text editing with [micro](
###Installing micro
The package micro is available for sid as of now.
In Buster, we can download the package for sid from [here]( and install it using dpkg cmmand or Discover application.
For example
sudo dpkg -i micro_1.4.1-2_amd64.deb
###Basic Commands in micro
Ctrl-Q Quit
Ctrl-S Save
Ctrl-E Enter command mode
Ctrl-L Go to specific line number
Ctrl-C Copy
Ctrl-V Paste
For the complete list of default keys, Enter command mode using `Ctrl-E` and type `help defaultkeys`.
Refer [A Beginner’s Guide to Grep: Basics and Regular Expressions](
> Pirate Praveen:
> grep pattern * -R is what I commonly use
> for example if I want to search for Apache license text in existing packages to copy paste to a new package
> grep Apache ../*/debian/copyright
> the parent dirtectory usually have all the packages
* `git grep` enables you to search among all the tracked files in a git repository.
* You can pass the number of worker threads using `git grep --threads <number>`
Refer [A find Tutorial and Primer](
> Akhil : you can use it to filter out files matching a certain pattern.
>Eg:- find . -type f -newermt 2018-05-01 | grep "syslog\|kern\|daemon\|messages\|debug"
> In this example I run this in /var/logs to find files which contain the names syslog, kern, daemon, mesages. debug. Like everything in Unix I combine it with find to filter out files newer than a particular date, 2018-05-01 in this case.
> Always use -t with find. If you know that what you are searching for, it cuts down a large amount of time. -t f includes files alone in its search. -t d just includes directories.
##Find and Replace
Refer [Ultimate Sed Tutorial With Examples](
> Pirate Praveen:
> I had to use sed with some js packages to modify the final built files like adding some lines at the end so that it becomes compatible
> grep sed */debian/rules -R
> see one example [here](
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment