This quick Linux tip shows you how to find files of a certain type and copy those files to a different directory in Linux.
How do I change all occurrences of a word in all the files in the given folder in Linux command line? Example explained.
Quick Linux tip showcases how to create a tar archive file in Linux.
Quickly find out the IP address of the host system in Linux command line.
Question: How do I find all files containing specific text on Linux? Answer: There could be a number of ways to find files containing specific text in Linux command line. My favorite way is to use Grep command here. You can use the Grep command with a few options to achieve this. grep -Ril “specific_text” directory R… Read More
Question: How do I find the size of a directory in Linux command line? Answer: The size of a folder or directory in Linux can be found using the du command. du stands for disk usage. All you need to do is to use the command: du -h <path_to_directory> This will show the size of… Read More
Question: How do I copy a directory and the files inside it to another directory in Linux command line? Answer: You probably already know that you can use cp command to copy files in Linux command line. You can use the same cp command with the recursive option to copy a folder with its content… Read More
Question: How do I find the nth line in a file in Linux command line? Answer: There could be a number of ways to do that. For example, you can use a combination of head and tail command in the following function: head -n x file_name | tail -n 1 You can replace x with the… Read More
Question: How do I kill all the jobs running in the background in Linux command line? Answer: If you want to kill all the background jobs in Linux, you can use this: jobs -p | xargs kill Explanation: Here’s the quick explanation of the above command: jobs: the command to display all the jobs started in… Read More
You’ll often find yourself in situations where you need to empty a file. So, how do you empty a file in Linux? How to clear a file from all of its content without deleting the actual file? There are several ways you can delete all the content of a file without actually deleting the file.… Read More