
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 1466 Articles for Linux

2K+ Views
Many times there can be un-intentional delete of files or directories. That can lead to loss of important data or some misconfiguration of the system so we need a way to stop the accidental deletion of files and directories it may not be applicable to all the files and directories but we can have a design where at least some files and directories are prevented from such scenario.We use the change attribute command to prevent scenario below will see how this command is applied to two files and directories.SyntaxBelow is the syntax of change attribute command.chattr [operator] [flag] [filename] Where ... Read More

27K+ Views
The file systems in Linux can be of different types. They support different file sizes and some mechanism like journaling etc. Also different types of file systems are supported by different Linux Kernel systems. So for the devices which are available as memory in the Linux System, we can determine their file types by using the following commands.Using lsblkThis command dispalys all the attached divices as well as their file types and partitions.$ lsblk -fRunning the above code gives us the following result −NAME FSTYPE LABEL UUID MOUNTPOINT sr0 sda ├─sda2 ├─sda5 swap 02a54ace-c5c2-41cf-a679-acd9b460ee79 [SWAP] └─sda1 ext4 ae7c051f-451b-45ad-80a3-347c70a9de5e /Using fileIt ... Read More

4K+ Views
Adding a single new user to a Linux system can be achieved through the useradd command. But system admins often get request to add many users. So Linux provides a different to do a bulk addition of many users to a system.This is the newusers command.Synatxsudo newusers user_deatils.txt user_details.txt is the file containing the details of all the usernames to be added.User DetailsBelow we see the structure of user_details.txt file.UserName:Password:UID:GID:comments:HomeDirectory:UserShell So we create a file with below details to add many usres.~$ cat MoreUsers.txt uname1:pwd#@1:2112:3421:storefront:/home/uname1:/bin/bash uname3:pwd#!@3:2112:3525:backend:/home/uname3:/bin/bash uname4:pwd#$$9:9002:4721:HR:/home/uname4:/bin/bashGiving Permissions to the User Details FileBefore we sue the user details file to ... Read More

38K+ Views
When multiple users need access to the same set of directories of files then we need to create shared folders to be used by the users. In Linux there is concept of users and groups which can be given certain level of permissions that will enable them to share the data. Below are the steps how to create the shared folders where users can and update the files individually.Step 1 − Create the folder to be sharedAssuming we are setting up the shared folder from scratch, lets create the folder. The -p will create the directory and would ignore any ... Read More

11K+ Views
Linux shell scripting has many powerful tools to process the data in files. One such feature is to find patterns and count the number of occurrences of matched patterns. One such example is to count the number of occurrences of a specific word in a given file. This is achieved by combination of commands for pattern search and counting. Below are the approaches which can be used for this need.Input fileLets use the below file for demonstrating the examples.$ cat inspire.txt Mastering anything needs practice. It also needs patience. And it needs time and other resources.Using grep and wcThe grep ... Read More

3K+ Views
It often becomes essential to know not just the count of files in my current directory but also the count of files from all the subdirectories inside the current directory. This can be found out using theUsing lswe can use ls to list the files, then choose only the ones that start with ‘-‘ symbol. The R option along with the l option does a recursive search. The ‘-c’ option counts the number of lines which is the number of files.ls -lR . | egrep -c '^-'Running the above code gives us the following result −13Using find With Hidden FilesThe ... Read More

1K+ Views
Many times while taking back up of data from one location to another or configuring software, we need to maintain the same level of ownership and permission of the files. Creating those permissions and granting ownership to individual files can be error prone of done by typing commands for each of the files. So we use some arguments with the chown and chmod commands.OwnershipWe use the –-reference swiych in the chown function to specify the ownership cloning from the source file to the target file.Syntaxchown --reference=source_reference_file target_fileIn the below example we have a source file whose ownership gets cloned to ... Read More
704 Views
The Bash command-line history is a powerful feature that allows you to easily recall and reuse previously executed commands. However, there are times when you might want to clear this history for privacy reasons, security concerns, or simply to start with a fresh slate. This comprehensive guide will explore various methods for clearing your Bash command-line history in Linux, covering different techniques, options, and best practices. Why Clear Bash History? Clearing your Bash history can be important for several reasons − Privacy − If you've been working with sensitive information or executing commands you don't ... Read More

122 Views
Gogo is a tool to bookmark directories with long and complicated paths in the Unix shell. Because the long parts are difficult to remember and cumbersome to type in. In this article we'll see how to install go go and use it.Installing gitWe first need to have git installed in our system which will be needed for gogo installation. To install git in an Ubuntu system follow the below command.$ sudo apt install gitRunning the above code gives us the following result −[sudo] password for ubuntu: Reading package lists... Done Building dependency tree Reading state information... Done The following additional ... Read More

20K+ Views
LinuxLinux is an open source multi-tasking, multi-user operating system. It was initially developed by Linus Torvalds in 1991. Linux OS is widely used in desktops, mobiles, mainframes etc.UnixUnix is multi-tasking, multi-user operating system but is not free to use and is not open source. It was developed in 1969 by Ken Thompson team at AT&T Bell Labs. It is widely used on servers, workstations etc. Following are the important differences between Linux and Unix.Following are the important difference between Linux and Unix.Sr. No.KeyLinuxUnix1DevelopmentLinux is open source and is developed by Linux community of developers.Unix was developed by AT&T Bell labs ... Read More