Most used command related to Directory
Command | Description |
cd – | Go to the last directory. |
Empty a file/ delete content of a file
# > filename
---------------
# : > example.log
OR
# true > example.log
--------------
OR
# cat /dev/null > access.log
--------------
OR
# cp /dev/null access.log
---------------
# echo "" > access.log
OR
# echo > access.log
----------------
# truncate -s 0 access.log
Note : Taken from : https://www.tecmint.com/empty-delete-file-content-linux/
Copy all the lines to clipboard
- CTRL+A means “Mark the entire file.
- CTRL+C means “Mark the entire file.
- ESC means “De-select, so your next key press doesn’t replace the entire file 🙂
Note : This will only copy the visible part in terminal
Check Port and Service in Unix
sudo lsof -i -n -P | grep TCP
sudo netstat -tulpn | grep LISTEN