Linux Commands PDF Add Htop
Linux Commands PDF Add Htop
chmod octal file - change the permissions of file Install from source:
to octal, which can be found separately for user, ./configure
group, and world by adding: make
* 4 -read(r) make install
* 2 - write (W) dpkg -i pkg.deb - install a package (Debian)
* 1 -execute (x) rpm -Uvh pkg.rpm - install a package (RPM)
Examples:
chmod 777 - read, write, execute for all
chmod 755 - rwx for owner, rx for g
SSH ShortCuts
ssh user@host - connect to host as user Ctrl+C - halts the current command
ssh -p port user@host - connect to host on port
port as user
Ctrl+Z - stops the current command, resume with
ssh-copy-id user@host - add your key to host foruser to enable a keyed or
passwordless login fg in the foreground or bg in the background
Searching Ctri+D - log out of current session, similar to exit
grep pattern files - search for pattern in files Ctrl+W - erases one word in the current line
grep -r pattern dir - search recursively for
pattern in dir Ctrl+U - erases the whole line
command | grep pattern - search for pattern in theoutput of command Ctrl+R - type to bring up a recent command
locate file - find all instances of file Ctrl+R - type to bring up a recent command
NFS Commands !! - repeats the last command
showmount -e "server ip" - Find NFs share on remote server exit - log out of current session
sudo apt install nfs-common - install NFS support Samba
smbd -V - Check if SMB installed and what version
sudo mount example.hostname.com:/srv /opt/example -Mounting NFS Directory
sudo dnf install nfs-utils - install on a server providing NFS Share sudo dnf install samba samba-common samba-client - Install Samba Client and server
/etc/exports - the exports file location /etc/samba/smb.conf - location of the samba configuration file
sudo systemctl enable --now nfs-server - to Enable the NFS service sudo systemctl start smb - start the smb service
sudo systemctl enable --now rpcbind - Enable the RPC bind service sudo systemctl enable smb - Enable the SMB service
sudo exportfs -arv - Exporting the nfs list sudo smbpasswd -a <username> - to add user to the smb password
sudo exportfs -s - Check the Exported list
nfsstat- displays statistics kept about NFS client and server activity.
rpcinfo -p | grep nfs - Check NFS version