MCA Articles

Page 73 of 94

The 802.11 Frame Structure

Moumita
Moumita
Updated on 09-Jan-2020 26K+ Views

The IEEE 802.11 standard, lays down the architecture and specifications of wireless local area networks (WLANs). WLAN or WiFi uses high frequency radio waves instead of cables for connecting the devices in LAN. Users connected by WLANs can move around within the area of network coverage.The 802.11 MAC sublayer provides an abstraction of the physical layer to the logical link control sublayer and upper layers of the OSI network. It is responsible for encapsulating frames and describing frame formats.MAC Sublayer Frame Structure of IEEE 802.11The main fields of a frame in WLANs as laid down by IEEE 802.11 are as ...

Read More

Why should eval be avoided in Bash, and what should I use instead?

Pradeep Elance
Pradeep Elance
Updated on 03-Jan-2020 2K+ Views

eval is a builtin command of the Bash shell which concatenates its arguments into a single string. Then it joins the arguments with spaces, then executes that string as a bash command. Below is an example of how it works.eval exampleIn the below example we take a string which has some Unix commands built into it and then apply eval to it.$ var="echo n" $ echo $var $ eval $varRunning the above code gives us the following result −echo n nAs you can see, when eval is applied the variable expands it gets executed as a command and no longer ...

Read More

Looping through the content of a file in Bash

Pradeep Elance
Pradeep Elance
Updated on 03-Jan-2020 7K+ Views

Often it is a requirement to read each of the line from a file using a bash script. There are various approaches to read the lines form a file. In the below example we have first described how to create a sample file and then run a script reading that sample file.Create a file to Read# Open vi Editor vi a_file.txt # Input the below lines Monday Tuesday Wednesday Thursday Friday Saturday Sunday # cat the file cat a_file.txtRunning the above code gives us the following result −Monday Tuesday Wednesday Thursday Friday Saturday SundayUsing Do-WhileIn this approach we use a ...

Read More

How to convert DOS/Windows newline (CRLF) to Unix newline (LF) in a Bash script?

Pradeep Elance
Pradeep Elance
Updated on 03-Jan-2020 2K+ Views

When we transfer files between Windows and Unix systems, often we come across with issue relating to the end of line character. This is because the EOL character in windows is not recognized as a EOL character in Unix. SO to fix this issue when a file is transferred from Windows to Unix we need to follow one of the below methods.Using dos2unixThe dos2unix command is used to convert the EOL character of windows platform to Unix platform. Most of the Unix system comes with this command pre-installed. Below we see how we can convert the file itself or save ...

Read More

How to Search and Remove Directories Recursively on Linux?

Pradeep Elance
Pradeep Elance
Updated on 03-Jan-2020 558 Views

Removing directories is a regular process for anyone working on Unix systems.But sometimes we also need to find the directories first and then decide to delete it. One hurdle in deleting the files is to do a recursive deleting because by default Unix systems do not allow deleting of a directory if it is not empty. So in this article we will see how to find and remove directories recursively.Using find and execThe below command first searches for the required directory using the find command then executes the ‘rm’ command to recursively remove the directory using the recursive option as ...

Read More

How to Re-run Last Executed Commands in Linux?

Pradeep Elance
Pradeep Elance
Updated on 03-Jan-2020 350 Views

Re-running commands in the command line is a regular task which all of us go through when working on the Unix systems. In the below article we will see various ways how we can rerun the commands we have already executed this helps save time and it helps reasoning longer commands easily without retyping them.Before we get into how to re-execute previous command let's see how we can look at the list of all the commands. There is a command call history which lists down all the executed command for a specific time period configured by the system. Below is ...

Read More

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

Pradeep Elance
Pradeep Elance
Updated on 03-Jan-2020 692 Views

Because of security concerns, the users in a system are required to update their passwords regularly. In this article we will see how we can force an user to change their password when they login to the system next time.List the usersFirst lets have a look at the users available in the system.$ cut -d: -f1 /etc/passwdRunning the above code gives us the following result −mail news uucp proxy www-data backup list … Ubuntu uname1Check user DetailsNext we check the settings for users current password system configuration.$ sudo chage -l uname1 [sudo] password for ubuntu:Running the above code gives us ...

Read More

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

Pradeep Elance
Pradeep Elance
Updated on 03-Jan-2020 5K+ Views

For the sysadmins, it is routine to monitor user details like who are active and who are not, who logged in in last 2 days, which users belong to a given group etc etc. To help these requirements, Linux provides below list of commands which can be used to gather various types of information about the users.id CommandIt gives the id details of users including the group id along with the secondary group IDs and names of a user choosen by the system. But you also ask for a specific user’sdeatils by giving the userid value in the command.ubuntu@ubuntu:~$ id ...

Read More

How to Find Linux Server Geographic Location in Terminal?

Pradeep Elance
Pradeep Elance
Updated on 03-Jan-2020 4K+ Views

For purpose of security, cyber-crime investigation, government compliance or just for curiosity we might ned to track the geographical location of a Linux server in the internet or at least the location of the server which diverts the internet traffic to the server we are interested in. It involves getting the I.P address of the server and using some third party services offered in the web, to map that I.P address to get the location. In this article we will see the steps to achieve that.Step 1 − Install curl jqThe curl package will make the http requests to the ...

Read More

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

Pradeep Elance
Pradeep Elance
Updated on 03-Jan-2020 940 Views

Usually a continuously growing files, needs to be emptied from time to time to accept the latest data from the next operation. There are various mechanisms to empty the file. We will see them one by one below. The common approach is the overwrite the target file by using > sign which should come from a source which is empty./dev/nullThis is a common method where we output empty result and then redirect that result to the target file.# Original file size $ls-lt -rw-rw-r-- 1 ubuntu ubuntu 2925 Jan 1 08:39 ref_file.txt # Redirect the output from /dev/null $ cat /dev/null ...

Read More
Showing 721–730 of 937 articles
« Prev 1 71 72 73 74 75 94 Next »
Advertisements