Find larger file that are consuming disk space in Linux | Sys Admin

While handling over the linux server we many time come across disk issue, below are few method which we can use.

login as root user:


Method1:
To find file which are greater than 1 GB.

find / -xdev -type f -size +1G -exec ls -lrth {} \;

you can change the file limit as you need.
Continue reading “Find larger file that are consuming disk space in Linux | Sys Admin”

Advertisements

To copy a large number of files, or have large files over Linux system (scp/rsync/nc/tar over ssh) | scp alternatives

To copy/send large number of files or to copy/send large files in Linux below are sample method that we can send over other linux server.

Here we have create dummy file of 5 GB.

fallocate -l 5G testfile.img

Method1:

scp testfile rupin@192.168.43.114:/tmp

Method2:

rsync -avzh --progress --stats testfile rupin@192.168.43.114:/var/tmp

Method3:

tar -c testfile | gzip -2 | ssh server2 "cat > ~/file.tar.gz"

Continue reading “To copy a large number of files, or have large files over Linux system (scp/rsync/nc/tar over ssh) | scp alternatives”

System Administrator | All about Date & Time in linux

Modern operating systems distinguish between the following two types of clocks:
  • real-time clock (RTC), commonly referred to as a hardware clock, (typically an integrated circuit on the system board) that is completely independent of the current state of the operating system and runs even when the computer is shut down.
  • system clock, also known as a software clock, that is maintained by the kernel and its initial value is based on the real-time clock. Once the system is booted and the system clock is initialized, the system clock is completely independent of the real-time clock.
The system time is always kept in Coordinated Universal Time (UTC) and converted in applications to local time as needed. Local time is the actual time in your current time zone, taking into account daylight saving time (DST). The real-time clock can use either UTC or local time. UTC is recommended.
Red Hat Enterprise Linux 7 offers three command line tools that can be used to configure and display information about the system date and time: the timedatectl utility, which is new in Red Hat Enterprise Linux 7 and is part of systemd; the traditional date command; and the hwclock utility for accessing the hardware clock.

Continue reading “System Administrator | All about Date & Time in linux”

Nmap Basics for system Administrator

The Nmap aka Network Mapper is an open source and a very versatile tool for Linux system/network administrators. Nmap is used for exploring networksperform security scansnetwork audit and finding open ports on remote machine. It scans for Live hosts, Operating systems, packet filters and open ports running on remote hosts.

Understanding Open, Closed and Filtered

Nmap has a variety of scan types, understanding how the default and most common SYN scan works is a good place to start to examine how the scan works and interpreting the results.

The 3 way TCP handshake

First a bit of background, during communication with a TCP service, a single connection is established with the TCP 3 way handshake. This involves a SYN sent to an TCP open port that has a service bound to it, typical examples are HTTP (port 80), SMTP (port 25), POP3 (port 110) or SSH (port 22).

Continue reading “Nmap Basics for system Administrator”

Alternative for DD command with a progress report about how much has been written-dcfldd

1 ) DD Command:-

The dd command stands for “data duplicator” and used for copying and converting data. It is very powerful low level utility of Linux which can do much more like.

• Backup and restore the entire hard disk or partition.
• Backup of MBR (Master Boot Record)
• It can copy and convert magnetic tape format, convert between ASCII and EBCDIC formats,swap bytes and can also convert lower case to upper case.
• It can also be used by Linux kernel make files to make boot images.

Only superuser can run this command because you can face a big data loss due to its improper usage, so you should be very careful while working with this utility. At that moment data loss can convert the dd utility as a “data destroyer” for you

Continue reading “Alternative for DD command with a progress report about how much has been written-dcfldd”

Ansible Playbook Example-1

What’s with the Name “Ansible”?

 Ansible was used to control a large number of remote ships at once, over vast distances. Think of it as a metaphor for controlling remote servers.

Introduction:-

Ansible playbooks are a way to send commands to remote computers in a scripted way. Instead of using Ansible commands individually to remotely configure computers from the command line, you can configure entire complex environments by passing a script to one or more systems.

Ansible playbooks are written in the YAML data serialization format. If you don’t know what a data serialization format is, think of it as a way to translate a programmatic data structure (lists, arrays, dictionaries, etc) into a format that can be easily stored to disk. The file can then be used to recreate the structure at a later point. JSON is another popular data serialization format, but YAML is much easier to read.

Continue reading “Ansible Playbook Example-1”

Ansible Agentless Automation

WiKi:-

Ansible is a free-software platform for configuring and managing computers which combines multi-node software deployment, ad hoctask execution, and configuration management.[1] It manages nodes (Linux nodes must have Python 2.4 or later installed on them, Windows nodes require PowerShell 3.0 or later) over SSH or over PowerShell.[2] Modules work over JSON and standard output and can be written in any programming language. The system uses YAML to express reusable descriptions of systems.[3]

Configuration management systems are designed to make controlling large numbers of servers easy for administrators and operations teams. They allow you to control many different systems in an automated way from one central location.

Continue reading “Ansible Agentless Automation”