Skip to main content

Posts

Showing posts from December, 2019

df Command & Examples in Linux [Beginners Guide]

There might come a situation while using Linux when you want to know the amount of space consumed by a particular file system on your LINUX system or how much space is available on a particular file system. LINUX being command friendly provides a command line utility for this i.e df command that displays the amount of disk space available on the file system containing each file name argument. If no file name is passed as an argument with df command then it shows the space available on all currently mounted file systems . This is something you might wanna know cause df command is not able to show the space available on unmounted file systems and the reason for this is that for doing this on some systems requires very deep knowledge of file system structures. By default, df shows the disk space in 1 K blocks. df displays the values in the units of first available SIZE from –block-size (which is an option) and from the DF_BLOCK_SIZE, BLOCKSIZE AND BLOCK_SIZE environmen

apt-get Command & Examples in Linux [Beginners Guide]

apt-get command & Examples in Linux apt-get is a command-line tool which helps in handling packages in Linux. Its main task is to retrieve the information and packages from the authenticated sources for installation, upgrade and removal of packages along with their dependencies. Here APT stands for the Advanced Packaging Tool. APT (Advanced Package Tool) is the command line tool to interact with this packaging system. There are already dpkg commands to manage it, but apt is a more user-friendly way to handle packages. You can use it to find and install new packages, upgrade packages, clean your packages, etc. Syntax : Command : apt-get [options] command or Command : apt-get [options] install|remove pkg1 [pkg2 ...] or Command : apt-get [options] source pkg1 [pkg2 ...] Most Used Commands: You need to provide one of the commands below, if -h option is not used. update : This command is used to synchronize the package index files from their sources ag

How To Find Large Files and Directories in Linux with Examples with Outputs

When you're trying to clean up your filesystems and reclaim some space, one of the first things you'll want to do is to confirm the largest directories and individual files you have. This can be easily done using two Unix commands: find command and du command. Find files larger than a certain size It's very simply to find files which are larger than a specified size. The find command accepts a size parameter, and you can specify the limits for file sizes in your command line. This example finds all the files under /etc directory which are larger than 100k: root@ubuntu# find /etc -size +100k /etc/ssh/moduli /etc/ssl/certs/ca-certificates.cr /etc/bash_completio If we look at their sizes, they really are above 100k: root@ubuntu# ls -l /etc/ssh/moduli /etc/ssl/certs/ca-certificates.crt /etc/bash_completio -rw-r--r-- 1 root root 215938 Apr 10  2007 /etc/bash_completion -rw-r--r-- 1 root root 132777 Feb 19  2007 /etc/ssh/moduli -rw-r--r-- 1 root ro

Netstat Command & Examples : View Monitor Network Statistics and Configurations In Linux

Netstat is a command line tool that is used to view and monitor network statistics and configurations of a system. This tool is available on both Unix, Linux and Windows NT-based operating systems. Below are some of the activities that can be carried out using this tool View network connections View routing tables View network interface statistics View masquerade connections View multicast memberships Netstat is a very powerful tool that can be used for network troubleshooting and network performance measuring purposes. Below are some of the basic commands of netstat tool 1) Listing all the sockets This displays details of all the sockets, including open and close sockets in the following format Proto - Protocol RefCnt - Reference Count : number of attached processes connected via this socket Flags - Flag type Type – Network socket type State - State of the socket I-Node - Inode of the socket Path - Path of the socket Command : netstat -a Sample out