Listing all Files Recursively in Windows
Save the list of all files in a folder in windows - recursively.
dir /s /b>FileList.txt
[tags]command, dir, directory, folder, windows, list, ls ,recursive[/tags]
Save the list of all files in a folder in windows - recursively.
dir /s /b>FileList.txt
[tags]command, dir, directory, folder, windows, list, ls ,recursive[/tags]
This is how to create hard and soft links in Linux. Remember, a directory cannot be hard linked.
#Hard link
ln /path/to/file.ext .
#Soft link
ln -s /path/to/file.ext .
[tags]link, shortcut, soft,hard,linux,command[/tags]
Show the headers of an URL using Curl
curl http://example.com -I
Search for a specific text in a folder using grep
grep "fetchFeedPacksCustomize()" *.js
[tags]grep,search,text,folder[/tags]
Find the meaning of a word from dict using curl. System must be online for this to work.
curl dict://dict.org/d:word
[tags]dict,word,meaning,dictionary,curl,linux,command[/tags]
Functions to Export and import CSV data using PHP
//*Get the result of the query as a CSV stream.
function CSVExport($query) {
global $sql;
$sql_csv = $sql->getSqlHandle($query);
header("Content-type:text/octect-stream");
header("Content-Disposition:attachment;filename=data.csv");
while($row = mysql_fetch_row($sql_csv)) {
$row = $sql->_stripsls($row);
print '"' . implode('","',$row) . "\"\n";
}
exit;
}
[tags]php,export,import,csv,function[/tags]
How to access firefox profiles in Linux…
#Open the profile manager.
firefox --ProfileManager
#Open firefox using the specified profile
firefox --P WebDev
[tags]firefox,profile,linux[/tags]
Initialize a New Project in Git…
git init
git add .
git commit
#Add a file
git add file.php
git status
git commit
[tags]git,command,source,control[/tags]
A better way to get the process id of an application. I recommend giving an alias for this command…
ps aux|grep firefox|awk '{print $2 "\t\t" $12}'|head -n1
Replace firefox with the name of the application you are searching for.
[tags]linux,command,cli,awk,ps,process,id,grep[/tags]
Remove all empty directories within the current directory
find . -type d -empty -exec rmdir {} \;
perl -MFile::Find -e"finddepth(sub{rmdir},'.')"
Delete Empty Directories
http://www.jonasjohn.de/lab/red.htm
[tags]empty,folder,delete,remove,perl,command,linux[/tags]