Linux Interview questions and preparation - part 2 (Linux commands)

Linux Interview questions and preparation- part , is a first part of linux interview question/reading materials. Which will helps anyone who is interested in Linux from beginners to advanced.

LINUX

- Luminari

7/8/20242 min read

Before diving into more advanced topics, let's cover some essential basic admin commands:

Basic commands:

cd: Change Directory - Use cd to navigate through your file system.

"cd /path/to/directory"

mkdir: Make Directory - Create a new directory using mkdir.

"mkdir my_new_directory"

rm: Remove - Delete files or directories using rm.

"rm myfile.txt"

cp: Copy - Copy files or directories using cp.

"cp myfile.txt my_copy.txt"

mv: Move - Rename or move files or directories using mv.

"mv myfile.txt my_new_name.txt"

File System Management Commands

ls: List Files and Directories - Display the contents of a directory.

"ls /path/to/directory"

cat: Concatenate and Append Text Files - View or create files using cat.

"cat myfile.txt"

touch: Create Empty Files - Create new empty files using touch.

"touch my_new_file.txt"

find: Search for Files and Directories - Search for files and directories based on specific criteria.

"find /path/to/directory -name myfile.txt"

du: Display Disk Usage - Show the size of a file or directory.

"du -h my_directory"

User Management Commands

useradd: Add Users - Create new users using useradd.

"useradd my_new_user"

usermod: Modify Users - Change user properties using usermod.

"usermod -aG wheel my_existing_user"

userdel: Delete Users - Remove existing users using userdel.

"userdel my_existing_user"

System Management Commands

uptime: Show System Uptime - Display how long the system has been running.

"uptime"

top: Display Running Processes - Show a list of currently running processes.

"top"

kill: Kill Processes - Terminate a process using kill.

"kill 1234"

reboot: Reboot the System - Restart the system immediately.

"reboot"

Network Management Commands

ping: Send ICMP Echo Request Packets - Test network connectivity using ping.

"ping google.com"

ssh: Secure Shell - Connect to another Linux system or server using ssh.

"ssh my_remote_server"

scp: Secure Copy - Copy files securely between systems using scp.

"scp myfile.txt my_remote_server:~/my_directory/"

Advanced Admin Commands

cron: Schedule Tasks - Run commands at specific times or intervals.

"crontab -e"

sudo: Superuser Do - Execute a command with superuser privileges using sudo.

"sudo apt-get install my_package"

chown: Change Ownership of Files and Directories - Modify file ownership using chown.

"chown my_user:my_group my_file.txt"

chmod: Change Mode of Files and Directories - Modify file permissions using chmod.

"chmod 755 my_directory"