-
To remove a folder with all its contents (including all interior folders):
rm -rf /path/to/directory
-
To remove all the contents of the folder (including all interior folders) but not the folder itself:
rm -rf /path/to/directory/*
- Details
- Category: Generalia
Find the size of a directory: du -sh dirname/
Tail like command for windows using Windows Powershell to extract last few lines of a large text file:
Get-Content "inputfile.txt" -Wait -Tail 3000 > tail.txt
Useful Linux Navigating Commands
Zip a folder (and exclude a sub-folder)
zip -r myarchive.zip dir1 -x dir1/ignoreDir1/**\* dir1/ignoreDir2/**\*
- Details
- Category: Generalia
Best method to backup and restore all DBs in MySQL. This ensures that the dbs are separate and does not have bulk issues.
Step 1. get a list of all the databases
Step 2: Create a batch file to dump all the DBs, one by one, using the following command:
mysqldump -u user -pPassword dbname > dbname.sql
Step 3: Create a batch file to restore all the DBs, one by one, using the following command:
mysql -u user -pPassword dbname < dbname.sql
Update a column with the character count of another column within the same table.
update dbName.tableName a set a.columnToUpdate=char_length(a.columnToCountCharacterOf) where a.columnToCountCharacterOf=a.columnToCountCharacterOf;
Load tab delimited data into a table:
Remove tabs from a given mysql field:
update dbName.TableName set ColumnName = replace(ColumnName,'\t','');
Enable Local Data load after logging into the MySQL prompt: SET GLOBAL local_infile=ON;
LOAD DATA LOCAL INFILE 'C:/director/importdata.txt' INTO TABLE dbName.tableName FIELDS TERMINATED BY '\t' LINES TERMINATED BY '\n';
select distinct(lang), (sum(textlength)) FROM dbName.tableName group by lang;
Count number of words in a field:
SELECT LENGTH(langtext) - LENGTH(REPLACE(langtext, ' ', ''))+1, id FROM dbName.tableName INTO OUTFILE "D:\\outdirector\\length.txt" limit 10;
- Details
- Category: Generalia
- These are some of excel formulas I use often.
1. The following to to find the unique case sensitive entries in a column:
=REPT($A2,SUMPRODUCT(--EXACT($A2,$A$1:$A1))=0)
- Details
- Category: Generalia
गोस्वामी तुलसीदास रचित श्री रुद्राष्टकम् - शिव वंदना
नमामीशमीशान निर्वाणरूपं, विभुं व्यापकं ब्रह्मवेदस्वरूपम् ।
निजं निर्गुणं निर्विकल्पं निरीहं, चिदाकाशमाकाशवासं भजेऽहम् ॥ १॥
निराकारमोंकारमूलं तुरीयं, गिरा ज्ञान गोतीतमीशं गिरीशम् ।
करालं महाकाल कालं कृपालं, गुणागार संसारपारं नतोऽहम् ॥ २॥
Read more: गोस्वामी तुलसीदास रचित श्री रुद्राष्टकम् - शिव वंदना
- Details
- Category: Generalia
I recently started using OmegaT, a free software to translate internal projects that I have with me.
One issue that I find while translating text files is that it does not take the line marks as a segment breaker. This can be changed by going into Options -> File Filters and under "Text Files", select options to choose the "Line Breaks" as the segment source.