Rename a file or folder via command line
1 |
mv oldName newName |
Remove directory with files
1 |
rm -rf dir_name_to_delete |
-r "recursive" -f "force" (suppress confirmation messages)
See hidden files in directory
1 |
ls -a |
ls: "Directory listing", -a:"Show with hidden files/folders" -l:"vertical detailed list view"
Delete the content of your app/cache and app/logs folders
1 2 3 4 |
rm -rf app/cache/* rm -rf app/logs/* rm -rf folder/subfolder/* |
rm "Remove"
Give all permissions (reads and writes) to your app/cache and app/logs folders
1 2 3 4 |
chmod 777 app/cache chmod 777 app/logs chmod 777 folder/subfolder |
chmod "Change mod write permission" 777 "everybody read/write/execute"
Print Working Directory
1 |
pwd |
It shows your absolute path on computer. like: /Users/trevor/Dev/web
Find / Search A File
1 |
find / -type f -name *.key |
Duplicate / Copy A File
1 |
cp file.txt fileBackup.txt |