Mukul Latiyan

Mukul Latiyan

363 Articles Published

Articles by Mukul Latiyan

Page 33 of 37

How to find the files in Linux that have been changed in the last 24 hours?

Mukul Latiyan
Mukul Latiyan
Updated on 29-Jul-2021 1K+ Views

One thing that is constant about working with Linux is that we will make changes to one file or another with time. There are some files that stay unchanged, for example the files inside the /usr/local/ directory while there are some files that are just temporary and get deleted automatically, like the files or folders you insert in the /tmp directory.Since we know that change is imminent to files and folders, Linux also provides us with different ways to keep track of the files or folders that we change or have changed.The most common way to check if we have ...

Read More

Linux – How to find the files existing in one directory but not in the other directory?

Mukul Latiyan
Mukul Latiyan
Updated on 29-Jul-2021 908 Views

Let’s consider a case where we have two directories, say, d1 and d2 and both these directories contain some files, which may be the same or different. Now we want to list out the names of those files that are present in one of these directories say d1 and not present in the other directory say d2.In order to do that we must be familiar with either the diff command or the comm command, as both these commands can be used to solve the above problem.Let’s first explore the diff command, which is short for difference. This command is used ...

Read More

Fastest way to tell if two files have the same contents in Unix/Linux

Mukul Latiyan
Mukul Latiyan
Updated on 29-Jul-2021 747 Views

Let’s say that we have two files inside a directory called dir1, and at first both these files are different. Different in the sense that the text they contain isn’t the same.The files in the folder −immukul@192 dir1 % ls -ltr total 16 -rw-r--r-- 1 immukul staff 7 Jul 7 10:37 2.txt -rw-r--r-- 1 immukul staff 8 Jul 8 19:05 3.txtThe contents inside the first file(2.txt) looks something like this −immukul@192 dir1 % cat 2.txt orangeThe contents inside the second file(2.txt) looks something like this −immukul@192 dir1 % cat 3.txt uorangeWe can easily make use of the diff command to ...

Read More

Crontab day of the week syntax on Linux

Mukul Latiyan
Mukul Latiyan
Updated on 29-Jul-2021 6K+ Views

In order to understand the syntax of a crontab job, we first need to explore and understand what a crontab job is.A crontab is nothing but a list of commands that we can run during a cron job. A cron job is a utility that schedules automatic execution of commands at specific times.We can start a cron job with the help of bash script by following the commands shown below −crontab -eThis will open a file which you can edit, insert the cron job shell script in the above file and then close that file.Just insert the code shown below ...

Read More

Convert XLSX to CSV in Linux with Command Line in Linux

Mukul Latiyan
Mukul Latiyan
Updated on 29-Jul-2021 1K+ Views

XLSX file is a standard file extension for the modern Microsoft Excel spreadsheet. We use of these files to analyze and organize data and they usually contain numerical data separated by rows and columns within a cell.On the other hand, a CSV file is basically a delimited text file that uses a comma to separate values, and each line of this file is usually a data record.While both the xlsx and csv formats of storing data are way different, as one makes use of tables with rows and columns, while the other uses commas to separate the values, but that ...

Read More

Best practices when running Node.js with port 80 (Ubuntu) in Linux

Mukul Latiyan
Mukul Latiyan
Updated on 29-Jul-2021 745 Views

We know that most of the time we want our node applications to listen on port 80. While it is a widely used technique and many times we don’t need anything else then just simply mentioning the port as 80 in our project configurations. The real issue actually resides in the fact that many of the operating systems nowadays require root privileges for this to happen (e.g., OS X, BSD).One workaround is to make sure that we start our application with the superuser.Commandsudo node server.jsWhile this might actually solve the problem for quite an extent, this approach has its vulnerabilities ...

Read More

How to add a new entry to the PATH variable in ZSH on Mac OS in Linux

Mukul Latiyan
Mukul Latiyan
Updated on 29-Jul-2021 14K+ Views

By default, we don’t have the .zshrc file present in macOS Catalina, and we need to create it. In order to create the .zshrc file, we can follow the steps shown below −Open TerminalType touch ~/.zshrc to create the file.Hit ReturnWe can also open the .zshrc file in the terminal from any directory by just typing the command shown belowExamplevi ~/.zshrcOutputimmukul@192 linux-questions-code % cat ~/.zshrc export GOPATH=/Users/immukul/go_projects export NDHOME=/Users/immukul/Downloads export GOTRACEBACK=all export GOROOT=/usr/local/go export LC_CTYPE=C export PATH=/home/Systems export LANG=CIt should be noted that the output may vary from machine to machine.To add an entry to the PATH variable present inside ...

Read More

How to create standalone Lua executables?

Mukul Latiyan
Mukul Latiyan
Updated on 20-Jul-2021 2K+ Views

We can create standalone Lua executables with the help of the third party packages like srlua.srlua does a perfect job in converting a Lua script file into an executable, and we can do it on both the major platforms, whether that is the windows or the Unix based systems.Let’s first learn how to do it on a Windows system.Consider the steps mentioned below as a reference −First, visit the github link of the srlua project. Please click the following link. After that, you need to clone the repository on your local windows machine with this command −git clone https://github.com/LuaDist/srlua.gitIt should ...

Read More

How to convert JSON string into Lua table?

Mukul Latiyan
Mukul Latiyan
Updated on 20-Jul-2021 4K+ Views

When working with JSON we generally need to decode JSON into a string or maybe encode a string into JSON. Both of these processes of converting the string into a JSON or the opposite are seen frequently.While Lua doesn’t provide an official library to do the same, we can still make use of the third party libraries.There are many third party libraries that we can make use of, out of these the most common one is the json-lua library which can be located on this link.We can either clone the repository on our local machine and then install it or ...

Read More

How to compile embedded Lua code in C?

Mukul Latiyan
Mukul Latiyan
Updated on 20-Jul-2021 3K+ Views

We know that Lua does a great job when it comes to being a simple language and an embedded language. Lua works even better with C, because of the different libraries that provide a great amount of support for it.In order to compile embedded Lua in C, we need to first write a Lua program followed by a C program that will invoke the Lua program function, and then we will compile the C program.Consider the program shown below as the Lua program −print("--I am using Lua from within C--")It should be noted that the above Lua script should be ...

Read More
Showing 321–330 of 363 articles
« Prev 1 31 32 33 34 35 37 Next »
Advertisements