Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
Operating System Articles
Page 139 of 171
Best practices when running Node.js with port 80 (Ubuntu) in Linux
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 MoreHow to add a new entry to the PATH variable in ZSH on Mac OS in Linux
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 MoreHow to wrap each input line to fit in specified width in Linux?
To wraps a line in an input file to fit the specified width, we use the fold command in the Linux operating system.The fold command is used to making a file with long lines more readable on a limited width output by performing a line wrap in the Linux system. Most Linux/Unix terminals default screen width of 80, and sometimes while reading files with long lines could be annoying.The fold command wraps each input line to fit in specified width and allows the user to set the maximum length of a line. The fold command was inherited into the first ...
Read MoreHow to split or break large files into pieces in Linux?
To split large files into small pieces, we use the split command in the Linux operating system.The split command is used to split or break large files into small pieces in the Linux system. By default, it generates output files of a fixed size, the default lines are 1000 and the default prefix would be ‘x’. For example, if the output file is not given, the default filename would be xaa, xab, etc. When a – (hyphen) is used instead of an input file then the data is derived from standard input.SyntaxThe general syntax of the split command as follows.split [OPTION]... ...
Read MoreHow to sort lines of text files in Linux?\\n
To sort lines of text files, we use the sort command in the Linux system.The sort command is used to prints the lines of its input or concatenation of all files listed in its argument list in sorted order. The operation of sorting is done based on one or more sort keys extracted from each line of input. By default, the entire input is taken as the sort key.SyntaxThe general syntax of the sort command is as follows.sort [OPTION]... [FILE]... sort [OPTION]... --files0-from=FBrief description of options available in the sort command.Sr.No.Option & Description1-b, --ignore-leading-blanksIgnore leading blanks.2-d, --dictionary-orderConsider only blanks and ...
Read MoreHow to shrink or extend the size of a file in Linux?
The truncate command is used to shrink or extend the size of a file to the given size. The truncate command cannot remove the file whereas removes the contents of the file and set size of file is zero byte. The meaning of truncate is reducing. While reducing the size of the file is the specified size is less than actual size then extra data will be lost.SyntaxThe general syntax of the truncate command is as follows.$ truncate OPTION... FILE...Brief description of options available in the truncate command.Sr.No.Option & Description1-c, --no-createDo not create any files2-o, --io-blocksManage size as number of ...
Read MoreHow to removes duplicate lines from a sorted file in Linux?
To remove duplicate lines from a sorted file and make it unique, we use the uniq command in the Linux system. The uniq command work as a kind of filter program that reports out the duplicate lines in a file. It filters adjacent matching lines from the input and gives a unique output. This command is also available in the Windows and IBM i operating system.SyntaxThe general syntax of the uniq command is as followsuniq [OPTION]... [INPUT [OUTPUT]]Brief description of options available in the fmt command.Sr.No.Option & Description1-c, --countDisplay how many times line was repeated.2-d—repeatedDisplay only repeated lines, one for ...
Read MoreHow to remove sections from each line of files in the Linux system?\\n
In this article, we will learn to remove sections from each line of files in the Linux/Unix operating system.To remove selected parts of lines from each FILE, we use the cut command in the Linux system.The cut command is used to remove and print the selected section of each FILE in the Linux operating system using a terminal. It is also used to cut the selected parts of a line by byte position, character, and field. It is also been ported to the IBM i operating system.SyntaxThe general syntax of the cut command is as followscut OPTION... [FILE]...Brief description of ...
Read MoreHow to overwrite a file to hide file contents, and make original contents unrecoverable in Linux?
To overwrite and file contents in the Linux system, we use the shred command using the terminal.shred – The shred command is used to securely delete files and devices. This command overwrites a file to hide file contents, and optionally delete the file so that it is very difficult to recover the file for any software in the Linux/Unix system.As usual, to remove files from the system, we use the rm command using the terminal. After removal files through the rm command, it may be recoverable using the software whereas after removing files through the shred command files are unrecoverable ...
Read MoreHow to move jobs to the background in the Linux system?
To move foreground jobs in the background, we use the bg command in the Linux system.bg (background) – The bg command is used to move foreground jobs in the background. It resumes execution of a suspended process in the background. If no job is specified, then the bg command work upon the currently running process.SyntaxThe general syntax of the bg command is as follows −bg [job_spec ...]Job Identifiers −Sr.No.Notation & Meaning1%nJob number2(n)%stringRefer to a job which was started by a command beginning with string3%? stringRefer to a job which was started by a command containing string4%% or %+Current job5%-Previous jobExit ...
Read More