Download Website Page on Linux Terminal

Pradeep Elance
Updated on 03-Jan-2020 06:40:41

8K+ Views

The Linux command line provides greta features for web crawling in addition to its inherent capabilities to handle web servers and web browsing. In this article we will check for few tools which are wither available or can be installed and used in the Linux environment for offline web browsing. This is achieved by basically downloading the webpage or many webpages.WgetWget is probably the most famous one among all the downloading options. It allows downloading from http, https, as well as FTP servers. It can download the entire website and also allows proxy browsing.Below are the steps to get it ... Read More

Binary Tree with Array Implementation in C++

sudhir sharma
Updated on 03-Jan-2020 06:40:01

5K+ Views

A binary tree is a special type of tree in which each node of the tree can have at most two child nodes. These child nodes are known as right child and left child.A simple binary tree is −For representing trees, there are two ways, dynamic node representation which uses linked listSequential representation which uses array.Here, we will discuss about array representation of binary tree. For this we need to number the nodes of the BT. This numbering can start from 0 to (n-1) or from 1 to n.Lets derive the positions of nodes and their parent and child nodes ... Read More

Redirect If JavaScript is Not Enabled in a Browser

mkotla
Updated on 03-Jan-2020 06:38:41

953 Views

To redirect if JavaScript is not enabled in the web browser, add a script to the tag. Let us say you need to redirect to index.php if JavaScript is not enabled. ExampleHere’s how you can do this:           HTML noscript Tag                                                        html{display:none;}          

Disable Delete Permission of File and Directory in Linux

Pradeep Elance
Updated on 03-Jan-2020 06:37:46

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

Binary Search Tree Delete Operation in C++

sudhir sharma
Updated on 03-Jan-2020 06:37:30

4K+ Views

Binary search tree (BST) is a special type of tree which follows the following rules −left child node’s value is always less than the parent Noteright child node has a greater value than the parent node.all the nodes individually form a binary search tree.Example of a binary search tree (BST) −A binary search tree is created in order to reduce the complexity of operations like search, find minimum and maximum.Delete Operation binary search tree (BST)delete operation is dropping the specified node from the tree. in case deleting the nodes, there are three possibilities −Deleting a leaf node from the tree: ... Read More

Determine File System Type in Linux: ext2, ext3, or ext4

Pradeep Elance
Updated on 03-Jan-2020 06:36:36

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

Create Multiple User Accounts in Linux

Pradeep Elance
Updated on 03-Jan-2020 06:32:22

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

Binary Search Tree: Search and Insertion Operations in C++

sudhir sharma
Updated on 03-Jan-2020 06:31:08

2K+ Views

Binary search tree (BST) is a special type of tree which follows the following rules −left child node’s value is always less than the parent Noteright child node has a greater value than the parent node.all the nodes individually form a binary search tree.Example of a binary search tree (BST) −A binary search tree is created in order to reduce the complexity of operations like search, find minimum and maximum.Search operation in BSTPerforming a search in a binary search tree, We need to search for a key in the tree. For this, We will compare the key with the root ... Read More

Count Word Occurrences in a Text File Using Shell Script

Pradeep Elance
Updated on 03-Jan-2020 06:29:40

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

Count Number of Files and Subdirectories in a Linux Directory

Pradeep Elance
Updated on 03-Jan-2020 06:27:19

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

Advertisements