Show the Top 10 Largest Directories on Linux
If you need to see the top 10 largest directories on your Linux system, you can use the following command:
du -h --max-depth=1 / | sort -rh | head -n …
45 articles about linux development, tools, and best practices
If you need to see the top 10 largest directories on your Linux system, you can use the following command:
du -h --max-depth=1 / | sort -rh | head -n …
If you need to set the hostname on a linux server, and you are using Terraform, then you can do the following:
Include the provisioner
block and set …
mysql -u root -p
select @@datadir;
Output:
+-----------------+
| @@datadir | …
Read Article →
If you need to sync the clock on Linux using the central NTP clock service, you can do the following:
sudo service ntp stop
sudo ntpd -gq
sudo service …
Read Article →
If using the EC2 launch type, the allowable network mode depends on the underlying EC2 instance’s operating system. If Linux, awsvpc, bridge, host and …
Read Article →This guide showcases the ability to use imported certificates from a third party provider (e.g. Venafi) in ACM, mount them in EFS and use them …
Read Article →If you need to check if a volume is mounted in a Bash script, then you can do the following.
First we need to determine …
Read Article →If you need to check if a bash
variable is empty, or unset, then you can use the following code:
if [ -z "${VAR}" ];
The above code will check …
Read Article →If you use the du
command to list all the file sizes on Linux:
du
# or
du -h # Human readable
Then you would have noticed that they are not ordered by …
Read Article →If you need to resize an EBS volume in AWS, you can do so using bash
.
bash
fileCreate a bash file called resize.sh
:
#!/bin/bash …
Read Article →
If you need to count how many files are in a directory on Linux, then you can use a combination of the ls
command to list all the files, and the wc …
If you need to get the CPU Frequency in Linux, then you can run the following command:
watch -n.1 "grep \"^[c]pu MHz\" /proc/cpuinfo"
Read Article →