Found 1301 Articles for MCA

How to do simple Arithmetic on Linux Terminal?

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

345 Views

While some GUI based Linux desktops give a calculator to be used in a similar way to what is available in Windows, the terminal has lot of features to do both simple and advanced level arithmetic calculations. In this article we will see how we can invoke various calculations from the Linux terminal itselfUsing bcThe command bc stands for basic calculator. Using it we can do various operations like arithmetic calculations, assigning values to variables, using comparison or relational operators and using many math functions available through bc itself. Also it has features for conditional statements and iterative statements. Below ... Read More

How to 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

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

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

23K+ 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

How to 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

How to Create a Shared Directory for All Users in Linux?

Pradeep Elance
Updated on 03-Nov-2023 03:46:34

32K+ 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

How to Count Word Occurrences in a Text File using Shell Script?

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

8K+ 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

How to Count Number of Files and Subdirectories inside a Given 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

Create Shortcuts to Long and Complicated Paths in Linux (Gogo)

Pradeep Elance
Updated on 03-Jan-2020 06:20:28

87 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

Inter – frame spaces (RIFS, SIFS, PIFS, DIFS, AIFS, EIFS)

Moumita
Updated on 02-Dec-2019 10:19:09

11K+ Views

Inter – frame SpacesInter − frame spaces (IFS) are waiting periods between transmission of frames operating in the medium access control (MAC) sublayer where carrier-sense multiple access with collision avoidance (CSMA/CA) is used. These are techniques used to prevent collisions as defined in IEEE 802.11-based WLAN standard (Wi-Fi).IFS is the time period between completion of the transmission of the last frame and starting transmission of the next frame apart from the variable back-off period.The diagram below shows the different types of inter − frame spacing starting from the shortest duration (highest priority) to the longest duration (lowest priority). Among these, ... Read More

Transmission opportunity (TXOP)

Moumita
Updated on 02-Dec-2019 10:15:42

3K+ Views

Transmit opportunity (TXOP) is a MAC layer feature used in IEEE 802.11-based wireless local area network (WLAN). TXOP defines the time duration for which a station can send frames after it has gained contention for the transmission medium. By providing this contention-free time period, TXOP aims to increase the throughput of high priority data, such as voice and video.TXOP is available in Quality of Service as part of Enhanced Distributed Channel Access (EDCA).Working PrincipleTXOP operates in the following sequence of steps −When a station in the WLAN has frames to send, it waits till it’s Network Allocation Vector (NAV) decrements ... Read More

Advertisements