Linux Articles

Page 113 of 134

How to Force User to Change Password at Next Login in Linux?

Pradeep Elance
Pradeep Elance
Updated on 15-Mar-2026 710 Views

For security purposes, system administrators often need to force users to change their passwords at the next login. Linux provides several commands to manage password expiration and enforce password changes. This article demonstrates how to force a user to update their password on next login. List System Users First, let's view all users available in the system ? cut -d: -f1 /etc/passwd The output shows all system users ? mail news uucp proxy www-data backup list ... ubuntu uname1 Check Current Password Settings Before making changes, examine the current ...

Read More

How to Find User Account Info and Login Details in Linux?

Pradeep Elance
Pradeep Elance
Updated on 15-Mar-2026 5K+ Views

For system administrators, monitoring user account information is essential for security and system management. Linux provides several powerful commands to gather details about users, their login history, group memberships, and current activity. id Command The id command displays user and group identification numbers along with group memberships. It shows details for the current user by default, or you can specify a particular user. id id 2112 Running the above commands gives us the following result ? uid=1000(ubuntu) gid=1000(ubuntu) groups=1000(ubuntu), 4(adm), 24(cdrom), 27(sudo), 30(dip), 46(plugdev), 113(lpadmin), 128(sambashare) uid=2112(uname1) gid=2112(uname1) groups=2112(uname1) The ...

Read More

How to Find Linux Server Geographic Location in Terminal?

Pradeep Elance
Pradeep Elance
Updated on 15-Mar-2026 4K+ Views

When you need to find the geographic location of a Linux server for security purposes, cyber-crime investigations, or compliance requirements, you can track its location using its IP address and third-party geolocation services. This process involves getting the server's IP address and mapping it to geographic coordinates using web APIs. Step 1 − Install Required Tools First, install curl and jq packages. The curl tool makes HTTP requests to geolocation APIs, while jq processes the JSON responses ? sudo apt-get install curl jq The output shows the installation progress ? $ sudo ...

Read More

How to Empty or Delete a Large File Content in Linux?

Pradeep Elance
Pradeep Elance
Updated on 15-Mar-2026 955 Views

Continuously growing log files and data files often need to be emptied periodically to free up disk space while preserving the file structure. Linux provides several efficient methods to empty large files without deleting them entirely. Using /dev/null Redirection The most common method redirects empty output from /dev/null to overwrite the target file ? # Check original file size $ ls -lt ref_file.txt -rw-rw-r-- 1 ubuntu ubuntu 2925 Jan 1 08:39 ref_file.txt # Redirect empty output to file $ cat /dev/null > ref_file.txt # Verify file is now empty $ ls -lt ref_file.txt -rw-rw-r-- ...

Read More

How to Download and Extract Tar Files with One Command in Linux

Pradeep Elance
Pradeep Elance
Updated on 15-Mar-2026 6K+ Views

We can download any required file from the web using the Linux terminal. But many times it is found that the downloaded file is a zipped file which is in tar format. In this article we will see how to download and extract the file in a single command. Using wget and tar The wget command downloads the data from the given URL while the tar command does the extraction of the tar.gz files. By combining them with a pipe, we can download and extract in one operation ? $ wget -c https://www.metoffice.gov.uk/hadobs/hadisd/v300_2018f/data/WMO_200000-249999.tar.gz -O - | ...

Read More

How to download a website page on Linux terminal?

Pradeep Elance
Pradeep Elance
Updated on 15-Mar-2026 8K+ Views

Linux command line provides powerful tools for downloading web content and offline browsing. The most popular tools are wget and cURL, which can download individual webpages or entire websites from various protocols. Using wget Wget is the most famous downloading tool that supports HTTP, HTTPS, and FTP protocols. It can download entire websites and supports proxy browsing. Check if wget is Available ubuntu@ubuntu:~$ which wget ; echo $? Running the above code gives us the following result ? /usr/bin/wget 0 If the exit code ($?) is 1, then install ...

Read More

How to do simple Arithmetic on Linux Terminal?

Pradeep Elance
Pradeep Elance
Updated on 15-Mar-2026 556 Views

While GUI-based Linux desktops provide calculator applications similar to Windows, the Linux terminal offers powerful features for both simple and advanced arithmetic calculations. This article demonstrates how to perform various calculations directly from the Linux terminal. Using bc (Basic Calculator) The bc command stands for "basic calculator" and supports arithmetic operations, variables, comparison operators, mathematical functions, conditional statements, and loops. Below are some practical examples ? Interactive bc Mode Type bc to enter interactive mode where results appear immediately below your calculations ? $ bc bc 1.06.95 Copyright 1991-1994, 1997, 1998, 2000, 2004, 2006 ...

Read More

How to disable delete permission of File and Directory in Linux?

Pradeep Elance
Pradeep Elance
Updated on 15-Mar-2026 2K+ Views

Sometimes you need to protect important files and directories from accidental deletion in Linux. The chattr command allows you to change file attributes to make files immutable, preventing deletion even with root privileges. Syntax chattr [operator] [flag] [filename] Where: operator: + (add), - (remove), or = (set exactly) flag: i makes the file immutable (cannot be modified or deleted) Checking Current File Attributes First, let's examine the current attributes of files in a directory using lsattr ? $ pwd ; ls -l /home/ubuntu/Documents/tutorials total 4 drwxrwxr-x 2 ubuntu ubuntu ...

Read More

How to Determine the File System Type in Linux (Ext2, Ext3 or Ext4)?

Pradeep Elance
Pradeep Elance
Updated on 15-Mar-2026 27K+ Views

Linux supports various file system types like Ext2, Ext3, and Ext4, each with different features such as journaling and file size limits. Determining the file system type of your storage devices is essential for system administration and troubleshooting. Using lsblk Command The lsblk command displays all attached devices along with their file system types and partitions ? $ lsblk -f Running the above command gives us the following result − NAME FSTYPE LABEL UUID ...

Read More

How to Create Multiple User Accounts in Linux?

Pradeep Elance
Pradeep Elance
Updated on 15-Mar-2026 4K+ Views

Adding a single new user to a Linux system can be achieved through the useradd command. However, system administrators often need to add many users at once. Linux provides the newusers command for bulk user creation from a file. Syntax sudo newusers user_details.txt Where user_details.txt is the file containing the details of all the usernames to be added. User Details File Format The user details file follows a specific format with colon-separated fields ? UserName:Password:UID:GID:comments:HomeDirectory:UserShell Creating the User Details File Let's create a file with multiple user entries ...

Read More
Showing 1121–1130 of 1,338 articles
« Prev 1 111 112 113 114 115 134 Next »
Advertisements