Here are the list of some useful Linux commands that's used on a day-to-day work and are equally important for interview purposes.
1. How to check memory usage
free -h
-h is to make the result readable by humans.
2. How to check disk usage
df -h
3. How to check CPU Usage
top
4. How to quickly find the process id of a program
pgrep <ProcessName>
5. How to find the Linux Kernal version
uname -r
amar@LPF22E8MA:~$ uname -r
4.4.0-19041-Microsoft
6. How to find the Operating System (OS) version
cat /etc/os-release
lsb_release -a
amar@LPF22E8MA:~$ cat /etc/os-release
NAME="Ubuntu"
VERSION="20.04 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04 LTS
Release: 20.04
Codename: focal
6. Want to see weather forecast in the Shell
curl wttr.in/bengaluru
7. Get live memory usage stats in a human readable format
watch vmstat -sSM
9. How to check whether computer is 32 bit or 64 bit
getconf LONG_BIT
64
10. How to limit the CPU Usage for a process
cpulimit -p <pid of the process> -l 25
Comments
Post a Comment