Category: Linux Tutorials
- Home
- Category: Linux Tutorials
This article covers the basic usage of the CHOWN command in Linux.In fact, you can now change the ownership of a file in system at the user level as well as at the group level. Also, with the chmod command command , you can change file access permissions such as read, write, and access.
This article covers the methods of finding out the ports that are in use in your Ubuntu Linux machine. In fact, if you are intending to close any unused port, you will easily be able to do that after knowing that it is still in the listening state.
1. Open a terminal application i.e. shell prompt. Run any one of the following command on Linux to see open ports:
$ sudo lsof -i -P -n | grep LISTEN
$ sudo netstat -tulpn | grep LISTEN
$ sudo ss -tulpn | grep LISTEN
$ sudo lsof -i:22 ## see a specific port such as 22 ##
$ sudo nmap -sTU -O IP-address-Here
2. For the latest version of Linux use the ss command. For example:
$ ss -tulw
This article covers the usage of the AWK command in Linux. In fact, AWK can use to manipulate text in documents or perform specific functions.
It is given below:
$ awk options 'selection _criteria {action }' input-file > output-file
This article covers the equality comparison operator for the strings in Bash. In fact, you will be able to realize that the strings can be compared in Bash very easily irrespective of their length.
Two strings are equal when they have the same length and contain the same sequence of characters.
This article covers the best text editor for Linux. In fact, some Linux editors add extra features or an easy-to-use interface.
This article covers the usage of the DMIDECODE command in Linux. In fact, the "dmidecode" command in Linux is used for extracting all the hardware-related information of your system.
Dmidecode stands for DMI (Desktop Management Interface) table decoder, as the name suggests it reads the data from DMI table and represents to us in human readable format. DMI table holds the system hardware details like BIOS, Serial Number, RAM(DIMMs) and CPU details etc, apart from this dmidecode can also retrieve details about the maximum system supported configuration (like DIMMs & Processors etc).
This article covers the methods of comparing two numbers in Bash.
This article covers the usage of the LSOF command in Linux. In fact, With lsof, you can find different processes locking up a file or directory, a process listening on a port, a user's process list, what all files a process is locking.
lsof isn't available by default on most Linux distributions but can be easily installed. So Use the below command to install lsof:
1. For CentOS / RHEL / Fedora, run the below command:
$ sudo yum install lsof
2. For CentOS/RHEL 8, you can use the DNF command:
$ sudo dnf install lsof
3. For Ubuntu / Debian, run the below command:
$ sudo apt install lsof
You can get a summarized list of lsof supported options using -? or -h flag:
$ lsof -?
This article covers how to extend LVM partition on the fly using lvextend command. In fact, LVM(Logical Volume Manager) provides the facility to increase and reduce the file system size.
This article covers an overview of how to use the PASSWD command in Linux. In fact, The passwd command modifies passwords for user accounts and manages the password validity period.
passwd general command is:
$ passwd <options> <username>
The terminal prints out what user you are changing the password for. Type your current password, and then define and confirm your new password.
This article covers a few options of the RSYNC command along with a few examples that elaborated on the usage of this command. In fact, with rsync, you will be able to use this tool very efficiently for transferring data from one location to another.
The syntax for the rsync command changes depending on the usage of the tool. We will cover all the scenarios in the following examples. Rsync syntax in its most basic form looks like this:
$ rsync options SOURCE DESTINATION
Remote data transfers require you to specify a host's address, but more on that later.
The rsync tool comes with many options. You can enter rsync in your terminal and get all the details. We will list some of the most common rsync options:
This article covers the process of running a remote command with SSH on a Linux system along with actually running a command remotely. In fact, you will be able to run any command on a remote system of your choice provided that you know the correct username of that system as well as its password with which you will be able to access it remotely.
This article covers the concept of the SED command in Linux along with a few useful examples to elaborate on its usage. In fact, SED is a text stream editor used on Unix systems to edit files quickly and efficiently. The tool searches through, replaces, adds, and deletes lines in a text file without opening the file in a text editor.
The main syntax for using the Linux sed command is:
$ sed OPTIONS... [SCRIPT] [INPUTFILE...]
You can execute sed with the following command-line options:
This article covers the usage of the TAR command in Linux. In fact, the GNU tar (short for Tape ARchiver) command is the most widely used archiving utility in Linux systems. Available directly in the terminal, the tar command helps create, extract, and list archive contents.
This article covers an overview of the ULIMIT command in Linux. In fact, ULIMIT command is used for viewing or limiting the resources available to the Linux users.
This article covers the whereis command which is useful for Locating the binaries and manual pages for various commands. Sometimes, while working on the command line, we just need to quickly find out the location of the binary file for a command.
Linux whereis command syntax
The whereis command lets users locate binary, source, and manual page files for a command. Following is its syntax:
$ whereis [options] [-BMS directory... -f] name...
This article covers an overview of the s3cmd command-line tool and how you can use it to manage your Amazon S3 storage feature. S3cmd is an Open Source tool that is free for both commercial and private use, but you need to pay only for Amazon resources. so most of the users are using this tool for managing AWS S3 Buckets. S3cmd is a free command-line tool written in Python
How to use the s3cmd command line to manage the Amazon s3 bucket in Linux ?
To use s3cmd command to list s3 bucket, run the command:
# s3cmd ls
This command will list s3bucket from Amazon S3, If you are unable to get the list of the bucket then there will be the following reasons:
This article covers how to list users in Linux system and also differentiate difference between normal user and system user. Linux OS is unique because of its multi-user characteristic allowing multiple users on one system, at the same time. However, tracking all users is essential. The /etc/passwd file contains one line for each Linux user account, with seven fields delimited by colons. This is a text file. You can easily list users under Linux using the cat command or other commands such as grep command / egrep command and more. With this same approach, you can use the Linux commands to list all users on all Linux operating system, including Ubuntu, Debian, RHEL, Arch, Fedora, CentOS, and other distros.
To list all users on Linux, use the cat command as follows:
$ cat /etc/passwd
This article covers most used Nginx commands. You can learn more about Nginx command line at Nginx documentation.
Nginx is one of the most popular web servers in the world. So whether you're currently using it or not, chances are, if you're a web developer chances are you'll likely come in contact with it at some point.
Also, Nginx is well known for its simple configuration, and low resource consumption due to its high performance, it is being used to power several high-traffic sites on the web, such as GitHub, SoundCloud, Dropbox, Netflix, WordPress and many others.
To start the Nginx service, run the following command. Note that this process may fail if the configuration syntax is not OK:
$ sudo systemctl start nginx #systemd
OR
$ sudo service nginx start #sysvinit
To enable Nginx auto-start at boot time, run the following command:
$ sudo systemctl enable nginx #systemd
OR
$ sudo service nginx enable #sysv init
How to Show Nginx Command Help ?
To get an easy reference guide of all Nginx commands and options, use following command.
$ systemctl -h nginx
This article covers how to use the Linux cat command. Cat(concatenate) command is very frequently used in Linux. It reads data from the file and gives their content as output. It helps us to create, view, concatenate files.
If you want to add a bit of new text to an existing text file, you use the cat command to do it directly from the command line (instead of opening it in a text editor).
Type the cat command followed by the double output redirection symbol ( >> ) and the name of the file you want to add text to.
This article covers how to query various DNS records. The dig command in Linux is used to gather DNS information. It stands for Domain Information Groper, and it collects data about Domain Name Servers. The dig command is helpful for diagnosing DNS problems, but is also used to display DNS information.
By default, dig sends the DNS query to name servers listed in the resolver(/etc/resolv.conf) unless it is asked to query a specific name server.
How to Install Dig on Linux ?
1. On Debian and Ubuntu, run:
$ apt-get install dnsutils
2. On CentOS 7, run the command:
$ yum install bind-utils
3. Once installed, check the version, to make sure the setup was completed successfully:
$ dig -v
Dig Syntax
In its simplest form, the syntax of the dig utility will look like this:
dig [server] [name] [type]
i. [server] – the IP address or hostname of the name server to query.
If the server argument is the hostname then dig will resolve the hostname before proceeding with querying the name server.
It is optional and if you don't provide a server argument then dig uses the name server listed in /etc/resolv.conf.
ii. [name] – the name of the resource record that is to be looked up.
iii. [type] – the type of query requested by dig. For example, it can be an A record, MX record, SOA record or any other types.
By default dig performs a lookup for an A record if no type argument is specified.
This article will guide you on how to use the #cat #command to display or create a new file on #Linux. To save a file, you must first be in Command mode. Press Esc to enter Command mode, and then type :wq to write and quit the file. The other, quicker option is to use the keyboard shortcut ZZ to write and quit.
This article will guide you on the different #command line options to extend #disk space storage in #Linux thereby allowing you to add #storage capacity to your #VM. If your filesystem has the resize capability, that capability is what you use. 1. Check if disk is available: #dmesg | grep sdb. 2. Check if disk is mounted: df -h | grep sdb. 3. Ensure there are no other partitions on disk: fdisk -l /dev/sdb. 4. Verify the #disk: fsck /dev/sdb. 5. Resize the #filesystem: resize2fs /dev/sdb.
This article will guide you on the steps to set up a secured VNC server up and running on your Ubuntu 20.04 server. This will help you to manage your files, software, and settings with a user-friendly graphical interface, and you will be able to run graphical software like web browsers remotely.
This article will guide you on how to run commands and bash shell aliases on a remote machine using the ssh command.
This article will guide you on using find command to find and remove files on your Server.
This extract will guide you on how to save terminal output to a file when using Linux or Unix-like operating system with modern shell such as Bash or KSH including POSIX syntax.
This article will guide you on how to delete files on Linux operating systems.
This article will show you different Linux commands to find information about running process and their ports.
In this article, you will learn how to create a symbolic link in Linux using the ln command by passing the -s option.
It is vital for you to check if your Linux memory is running low to help your server to stay optimized.