Print current environment variables using printenv
Answer:
Besides using env command, you can also use the printenv command, which has the same effect.
# printenv
TERM=xterm
SHELL=/bin/bash
XDG_SESSION_COOKIE=ff8f5b056d8812b8...
Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.
Print current environment variables using printenv
Answer:
Besides using env command, you can also use the printenv command, which has the same effect.
# printenv
TERM=xterm
SHELL=/bin/bash
XDG_SESSION_COOKIE=ff8f5b056d8812b8...
Use an alternative port when connecting to remote server using SSH
Answer:
Sometimes the SSH server port is not the standard 22 for security reason. So when you connect it, you need to specify the alternative port used with the -p argument.
E.g.
# ssh -p 12345 [email protected]
Mount a CDROM in Linux
Answer:
You can mount a CDROM using this command:
# mount /dev/cdrom /mnt/cdrom
Make sure you have created the mount point /mnt/cdrom beforehand.
Add a user to group in Linux
Answer:
To add a user to a group (supplementary), you can use the command below:
e.g.
# useradd -G admin john
If you want to change the user's primary group, you can use
e.g.
# useradd -g admin john
mount: unknown filesystem type 'nfs'
Answer:
If you attempt to mount a NFS share, using the mount command, e.g.
# sudo mount -t nfs 192.168.1.2:/data/share /mnt/share
And it gives:
mount: unknown filesystem type 'nfs'
You would need to install the nfs clients to solve it:
# sudo apt-get install nfs-common