-
Archives
- March 2019
- March 2018
- June 2017
- May 2017
- November 2016
- September 2016
- July 2016
- June 2016
- May 2016
- April 2016
- March 2016
- February 2016
- January 2016
- December 2015
- November 2015
- October 2015
- September 2015
- August 2015
- July 2015
- June 2015
- April 2015
- December 2014
- October 2014
- September 2014
- May 2014
- April 2014
- March 2014
- January 2014
- November 2013
- October 2013
- October 2012
- September 2012
- August 2012
- July 2012
- June 2012
- March 2012
- February 2012
- January 2012
- December 2011
- November 2011
- October 2011
- September 2011
- August 2011
-
Meta
Category Archives: Operating System
Find and Replace File Content using Linux Command Line
1find . -name "*.pgsql" -print | xargs sed -i ‘s/STRINGTOREPLACE/REPLACERSTRING/g’
How To List All Users or Groups in Linux
To list all users in Linux: 1cat /etc/passwd See only the first word before double colon (:) for exampple, user “root” will look like: root:x:0:0:root:/root:/bin/bash And to list all groups do the following 1cat /etc/group
Preventing Another Instance of A Program Running in Linux
The code below is my solution for preventing a program from running more than once at the same time in Linux. The scenario: Consider if you have a cron job (jobA.sh) set to run at 6PM, 7PM, and 8PM. While … Continue reading →
MySQL Backup and Restore – Using Command Line
Here is how you backup database using command line. The first line is to backup and the second line is to restore. These commands work on both Windows and Linux. In Windows you might want to setup mysql bin directory … Continue reading →
Delete All Symlink in The Current Directory
find . -maxdepth 1 -type l -exec rm -f {} \;
Benchmark How Long a Program Runs In Linux Using Bash
The following bash code might come handy for those of you who want to benchmark how long does a program runs. In the following example the assumption is that you want to pass along two parameters for your program to … Continue reading →
Auto Login Using SSH Public and Private Keys
Assume that your main server (the one you use the most) is ServerA. And from ServerA, you want to automatically login to ServerB. For illustration purpose, ServerB can be a repo server and you don’t want to keep being asked … Continue reading →
Linux Soft Symlink Folder or Directory
$ ln -s /home/rpringad/somefolder /home/rpringad/newfolder #or if your current directory is already /home/rpringad: $ ln -s /home/rpringad/somefolder /home/rpringad/newfolder $ ln -s existingSourceFolder newLinkedFolder
How To Know Which Linux Distribution You Are Using?
There are three commands that you can use, pick one of them: 12345cat /etc/issue cat /proc/version dmesg | head -1
How to Set up an FTP Server in Ubuntu Linux
Login to your Linux shell menu as root 12[root@locahost]# apt-get install vsftpd [root@locahost]# vim /etc/vsftpd.conf At VIM, 1st comment out anonymous_enable by adding a # sign at the beginning of the line # anonymous_enable=YES 2nd remove comment at local enable … Continue reading →