Posts

Windows findstr command, What it is, How does work, Where to use.

          FINDSTR command in windows cmd - it's syntax, exampels, and use cases    🔍 findstr command in windows cmd - it's syntax, exampels, and use cases The findstr command in windows command prompt lets you search text inside files or terminal output. It's kind of like the grep command in linux, and can be super helpful for devs, techs, and script geeks. 📘 1. introduction You can use findstr for finding patterns or words in files. Whether its logs, configs or scripts - this tool really comes handy. Saves lots of time. 🛠️ 2. Syntax findstr [options] "text to search" [filename(s)] 💡 4. Examples 🔹 Search in one file: findstr "error" serverlog.txt 🔹 ignore case while searching: findstr /I "Warning" serverlog.txt 🔹 find in all txt files in folders: findstr /S "timeout" *.txt 🔹 regex use: findstr /R "^[0-9]*$" data.txt 📂 5. Use Cases search logs for error or fail messages check source files for specific fun...

| (Pipe) symbol in CLI, CMD or Linux shell

Image
 What is | symbol (Pipeline) ? The pipe symbol (|) is used in MS Windows cmd (or other linux system as well) to redirect the output of one command as an input of other command. E.g In windows CMD the command assoc will print the file extension list, it will print a huge number of lines but you want to find/search a specific output/extension. you can run the following command:s assoc | findstr jp This will give the output like this What it is doing ? The above command is executing assoc and getting large number of output lines and then | symbol is just redirecting that large output to further command which is findstr and giving instruction to find the lines those have jp in it. Why and Where to use ? When you have command that gives output but you need it further to process in other command then you can use | (pipe) symbol.

What is ASSOC command in CMD

Image
What is assoc   The Assoc Command in MS Windows  Displays or modifies file extension associations. which means that what type of file is associated with what program  e.g .txt or .log are linked to what type of program. If you want to see the list of all file type then simply open CMD by pressing 🪟 + R and type cmd in RUN dialogue  you will see command prompt with your default users path. Lets take and example  run assoc RDP.File This command will show you the file extensions which is RDP.File  And most probably you will get the output like below. because the RDP (Remote Desktop Protocol) is present in all MS Windows machines. What does this tell  that the description/filetype of RDP and next to it the the program that will open these sort of files. This means if you have saved and RDP or created as RDP connection shortcut then opening that shortcut will execute the associated program for RDP let's further dig in... before that we need to take a...