Contents
Linux Common Command
show port
sudo netstat -tuln
Copy File/Folder
cp
cp -a /source/. /dest/
If you want to copy content of folder. If you want to copy folder content and parent, remove [dot]
rsync
rsync -r --progress /source/. /dest/
same with cp, but copy only the files that have changed
Mount/Unmount USB/removable drive
mount
- list drive with
lsblk
- make mount point
mkdir /media/usbdrive/
- mount drive to created dir
mount /dev/sdb1 /media/usbdrive/
unmount
sudo umount /media/pendriv
Show Last n Connected Users
n = change with number list you want to show
last -n
Get Real Path
readlink -f foo.bar
Cron log
journalctl -u cron.service
sudo grep CRON /var/log/syslog