Shell Script

How to Cat a File Content by iNode

Posted on
Symptoms At times, we may see some garbled filenames or even worse, empty or white-spaced names like this: [root@test ~]# ls -lai total 48 402653349 -rw-r–r–   1 root root  174 Oct 17 17:31 402653313 dr-xr-x—.  3 root root 4096 Oct 17 17:36 .       128 dr-xr-xr-x. 18 root root 4096 Oct 17 17:27 […]
cmd.exe

How to Check Disk Free Space Command Prompt in Windows

Posted on
Whenever you’d like to check disk free space by command prompt in Windows, you can use examples as below: Print datetime C:\Users\edchen>echo Check Time: %date% %time% Check Time: Fri 03/30/2018 18:47:10.73 Check Disk Free Space Command Prompt C:\Users\edchen>fsutil volume diskfree c: Total # of free bytes : 205131612160 Total # of bytes : 257139486720 Total […]
Shell Script

How to Auto Start Oracle Database on Solaris

Posted on
For Linux Os, you should check this post: How to Auto Start Oracle Database on Linux. Assuming that you already have some knowledge about how to start Oracle database manually and Oracle provided shell script dbstart, then we can keep going to design and deploy our automatic startup scripts. By default, Oracle software installation does […]
Shell Script

How to Auto Start Oracle Database on Linux

Posted on
For Solaris OS, you should check this post: How to Auto Start Oracle Database on Solaris. Assuming that you already have some knowledge about how to start Oracle database manually and Oracle provided shell script dbstart, then we can keep going to design and deploy our automatic startup scripts. By default, Oracle software installation does […]
bash

How to Increase Bash History Size

Posted on
Some valuable or complex commands may not be able to keep in your mind constantly when you need them. In this moment, you can leverage the command history to recall them. But as time goes by, you could lose them due to the size limitation of command history. The history always keep the most recent […]
ksh

How to Set Default Editor to Vi in KSH

Posted on
You might find out your shell does not respond to your esc + k which can reuse the historical commands in KSH just like ↑ in bash. This is because the default EDITOR in your shell has not been set.There’re several ways to solve this:For session-scope only:$ set -o viFor single user:$ vi ~/.profile…EDITOR=vi; export […]
Shell Script

How to Take Parallel Jobs to Background in One Line

Posted on
Suppose you’re a SA. In the beginning of the year 2016, you have to execute multiple system analysis reports parallelly for every month last year. In the first place, you execute the following 1 + 12 commands like the followings.     1  cd ~/reporting     2  nohup ./system_analysis_monthly.sh ‘201501’ &     3  nohup ./system_analysis_monthly.sh ‘201502’ &  […]
Linux

How to Combine Multiple Files Into One on Linux

Posted on
In this post, I will introduce several ways to Combine files into one file. Suppose we have 4 files as followings:[root@localhost ~]$ cat 1.txt1. Database.1. Database.[root@localhost ~]$ cat 2.txt2. Web.2. Web.[root@localhost ~]$ cat 3.txt3. IT Architecture.3. IT Architecture.[root@localhost ~]$ cat 4.txt4. Project.4. Project.Vertical format: We can merge them by concatenating vertically.[root@localhost ~]$ cat 1.txt 2.txt […]