Skip to main content

Posts

Showing posts with the label linux

Linux - How to find all the files that contains a given string

Linux - Find all files that contains a given string. In order to find all the files that contains a given string, we can make use of several commands. One of the simplest option is to use the grep command. grep -R '/path/to/theFiles/' -e 'pattern-to-search' With this execution, grep will go through all the files in the provided location recursively(since we gave -R option) and look for the string-pattern to look for. Then, it will provide a list of files that contains our given string-pattern. 

Zip and unzip in Linux

 Zip and unzip in Linux We can use the commands to zip and unzip the files or folders in Linux. Zip and unzip and such useful commands. The usage of the commands are described below. Zipping Create a zip file for a single file zip targetZipFilename.zip filetoZip.txt Add multiple files to the new zipfile zip targetZipFilename.zip filetoZip-1.txt filetoZip-2.txt Note : We can use wildcards for the filenames as needed. Add a file to existing zip file  zip -u existingZipFilename.zip filetoZip.txt Remove  single file from a zip file zip -d existingZipFilename.zip filetoRemoveFrom Zip.txt Zip directories and the contents zip -r ZipFilename.zip ./FolderInPWDToZip Note : -r is for recursive file selection. To zip everything in the present working directory zip -r ZipFilename.zip ./* Unzipping  The command without any arguments will unzip the contents to present folder. No additional folders will be created on extraction. Basic unzip  unzip zippedFile.zip Extract to ...

Termux - The android Terminal

Termux No hesitation, you can certainly call Termux “The Android terminal”. Owing to it’s simplicity and capabilities, Termux stand so close to the original Linux terminal. Who is it for and who should read this? This is beginner article which will introduce you to the fundamentals of using Linux terminal on android devices. To understand something here, you should barely understand English and nothing else is a pre-requisite. 🤓 Let us figure out the basics.   Android If you are using an android device, you know that android is the operating system that run the show on your mobile phone. Android is an operating system with its core based on Linux. In fact, android is based on a modified version of Linux optimized for mobile devices. Terminal Terminal is a command line interface which can be used to communicate with or control the Operating system. So, a linux terminal can be used to control a Linux device. Terminal is a tool that comes default with a full fat Unix or Linux opra...