Home » Linux Basics

Linux Basics

DOS-to-UNIX file conversion

Using Perl: # WARNING! For UNIX only! Do not use with ActivePerl in MSYS shell on Windows! # (Returns error message and file is deleted.) perl -pi -e 's/\r\n/\n/g' filename Using sh or bash: Works fine even in MSYS shell on Windows. #tr -d '\r' < original_filename > new_filename (Note that the “<” and “>” must be typed for this command to work). …

Read More »

Linux: Restart Nginx WebServer

How do I restart nginx web server under Linux? To restart nginx web server use any one of the following command as a root user: # /etc/init.d/nginx restart However, recommed way is as follows which should work with any Linux distribution : # nginx -s reload OR # /usr/local/nginx/sbin/nginx -s reload Originally posted 2016-03-10 02:57:42.

Read More »

How to delete a file

How do I delete a file under Linux  operating system? To remove a file or directory in Linux use the rm command. rm command syntax rm (short for remove) is a Unix / Linux command which is used to delete files from a filesystem. Usually, on most filesystems, deleting a file requires write permission on the parent directory (and execute …

Read More »

Linux: Bash Find Matching All Dot Files

A dot-file is generally any file whose name begins with a full stop. In Linux it is also called as hidden file. How do I list all dot files in my home directory? You can use the ls command to list all dot files in your current directory:   ls .* Sample outputs: .bash_history .bash_profile .bashrc .lesshst .profile .viminfo .: …

Read More »

How to Install and Configure maldet (Linux Malware Detect – LMD)

Maldet also known as Linux Malware Detect virus scanner for Linux. Linux Malware Detect (LMD) is a malware scanner for Linux released under the GNU GPLv2 license, that is designed around the threats faced in shared hosted environments. It uses threat data from network edge intrusion detection systems to extract malware that is actively being used in attacks and generates …

Read More »

How to install cron (crond, crontab)

Are you looking for crontab on a new install of CentOS 5? Well if you do a custom installation and don’t select anything then it will not be installed by default. In order to install it there just needs to be one package installed. See the below commands to install and setup crontab. Use this command to install crontab, start …

Read More »

Linux Centos 6 Change Server Hostname

I am a new CentOS Linux server user. How do I change hostname on CentOS Linux? How can I change server hostname on CentOS Linux  6? You need to use the following commands to set or view current hostname, domain name and/or FQDN (Fully Qualified Domain Name): dnsdomainname command : Display the system’s DNS domain name. hostname command : Show or …

Read More »