Pradeep Jhuriya

Pradeep Jhuriya

78 Articles Published

Articles by Pradeep Jhuriya

Page 4 of 8

Soft-Delete Files from the Terminal on Linux

Pradeep Jhuriya
Pradeep Jhuriya
Updated on 13-Feb-2023 755 Views

Introduction When working with files in the terminal on Linux, there may be times when you want to delete a file but also keep a copy of it just in case. This is where the concept of "soft delete" comes into play. A soft delete allows you to move a file to a designated recycle bin or trash, instead of permanently deleting it. That way, if you accidentally delete a file, you can easily get it back. In this article, we will explore how to delete files from the terminal on Linux using the "trash-put" command. We will also discuss ...

Read More

Guide to the Linux touch Command

Pradeep Jhuriya
Pradeep Jhuriya
Updated on 13-Feb-2023 959 Views

Introduction The Linux touch command is a versatile tool that allows you to create new files and update timestamps on existing files. In this guide we will explain the basic use of the touch command and some of its advanced options. We will also provide examples of how to use the command and show the corresponding output. By the end of this guide, you'll have a solid understanding of how to use the touch command to manage files on your Linux system. Basic usage touch command The basic syntax of the touch command is as follows − $ touch [options] ...

Read More

Date Command in Linux

Pradeep Jhuriya
Pradeep Jhuriya
Updated on 13-Feb-2023 18K+ Views

Introduction The "date" command in Linux is a simple but powerful tool used to display the current date and time, as well as set the system date and time. This command is extremely useful for troubleshooting and system administration tasks, and is a vital tool in understanding any Linux user. In this article, we'll discuss the basic usage of the date command, as well as some of its more advanced options and features. We'll also cover some examples of how the date command can be used in real-world scenarios. Basic usage of date command The date command is one of ...

Read More

Using Shebang #! in Linux Scripts

Pradeep Jhuriya
Pradeep Jhuriya
Updated on 13-Feb-2023 7K+ Views

Introduction On Linux, a shebang (#!) is a special line at the beginning of a script that tells the operating system which interpreter to use when executing the script. This line, also known as a hashbang, shabang or "sharp-exclamation", is the first line of a dash and starts with "#!" followed by the path to the interpreter. The Shebang line is important because it allows you to run scripts written in any language, not just shell scripts, on a Linux system. Understanding Shebang What is a Shebang? The Shebang “#!” The symbol indicates which interpreter, or which version of an ...

Read More

Transfer Files Between Linux Machines Over SSH

Pradeep Jhuriya
Pradeep Jhuriya
Updated on 13-Feb-2023 2K+ Views

Introduction Transferring files between Linux machines over SSH is a common task for system administrators and developers. SSH (Secure Shell) is a protocol that allows you to securely transfer files between machines, as well as remotely access and manage them. In this article, we will explore different ways to transfer files over SSH and demonstrate the process with examples and commands. Setting up SSH Before you can transfer files over SSH, you need to set up SSH on both the source and destination machines. SSH is a secure communication protocol that allows you to remotely access and manage your Linux ...

Read More

Shutdown and Reboot Linux Systems From the Terminal

Pradeep Jhuriya
Pradeep Jhuriya
Updated on 13-Feb-2023 893 Views

Introduction In this article, we will discuss how to shut down and restart Linux systems from the terminal. The ability to shut down and restart a system from the command line can be useful in a variety of situations, such as when the GUI is unavailable or when automating tasks via Linux shell scripts. Overview Linux is a fairly robust operating system, and as such, rebooting Linux servers is rarely necessary. However, sometimes there are reasons why you need to restart your system. For example, if we are running Linux on our personal computer, restarting and shutting down the system ...

Read More

Move All Files Including Hidden Files Into Parent Directory in Linux

Pradeep Jhuriya
Pradeep Jhuriya
Updated on 25-Jan-2023 10K+ Views

Introduction In Linux, hidden files, also known as dotfiles, are files whose names begin with a dot (.) character. These files are often used to store configuration data or other important information that should not be changed or deleted by the user. If you have a directory with a large number of hidden files and you want to move them all to the root directory, there are several ways to do this. In this tutorial, we will discuss two methods for moving all files, including hidden files, from a directory to its home directory in Linux: the mv command and ...

Read More

Run Cron Job Only If It Isn’t Already Running in Linux

Pradeep Jhuriya
Pradeep Jhuriya
Updated on 25-Jan-2023 2K+ Views

Introduction Cron is a utility in Linux that allows users to schedule commands or scripts to run automatically at a specific date and time. However, sometimes it may be necessary to ensure that a cron job does not run more than once at a time. In this article, we will discuss two ways to prevent overlapping cron tasks: using process tracking and using a “.pid” file. Locate running instances by process One way to avoid overlapping a cron task run is to check for the presence of the task's process before running it. This can be done using the pgrep ...

Read More

Find the Current Working Directory of a Running Process in Linux

Pradeep Jhuriya
Pradeep Jhuriya
Updated on 25-Jan-2023 9K+ Views

Introduction One of the basic tasks when working with processes on a Linux system is determining the current working directory of a process. The current working directory, also known as the "current directory" or "current working folder, " is the directory in which a process runs and interacts with files. Knowing the current working directory of a process can be useful for a variety of purposes, such as debugging, understanding the environment in which a process is running, or simply monitoring the activity of a process. In this article, we will discuss how to find the current working directory of ...

Read More

Remove the Last N Lines of a File in Linux

Pradeep Jhuriya
Pradeep Jhuriya
Updated on 25-Jan-2023 12K+ Views

Introduction There may be times when you need to remove the last few lines of a file on Linux. For example, you may have a log file that is constantly being added and you want to keep only the most recent entries. In this tutorial, we'll explore a few different methods to remove the last N lines of a file on Linux. Use the head and tail commands The head and tail commands are two very useful utilities for displaying the beginning and end of a file, respectively. By combining these commands, we can easily remove the last N lines ...

Read More
Showing 31–40 of 78 articles
« Prev 1 2 3 4 5 6 8 Next »
Advertisements