Day 3: Essential Linux Commands

Day 3: Essential Linux Commands

Hey LinkedIn Family,

Welcome to Day 3 of my DevOps journey! Today, we’ll be exploring some essential Linux commands that are crucial for navigating and managing your Linux environment. These commands will help you perform basic tasks efficiently.

Getting Started with Linux Commands

Before diving into the commands, here are some essential rules to keep in mind:

  • Linux is case-sensitive: Be mindful of uppercase and lowercase letters.
  • Avoid using spaces: Spaces are not allowed in command names.
  • Root Directory (`/`): The root of the file system.
  • Home Directory (`~`): The current user's home directory.

User Information

1. who

  • Shows login names, dates, times, and remote host names of users.

2. whoami

  • Displays the current user's username.

3. id

  • Shows user and group IDs.

4. groups

  • Displays the groups the user belongs to.

5. sudo (Five ways to become a superuser)

1) sudo -i
2) sudo -s
3) sudo su -
4) sudo -root
5) su -        

6. users

  • Displays usernames of all currently logged-in users.

7. clear

  • Clears the terminal screen.

8. lastlog

  • - Shows the most recent login details of all users.

File & Directory Commands

1. pwd

  • Prints the current working directory.

2. ls

  • Lists directory contents.

3. cd 'Name of folder' or 'Path'

  • Changes the current directory.

4. mkdir

  • Creates a new directory.

5. rmdir

  • Removes an empty directory.

Options:

-p: Removes directory and its ancestors.

-v: Verbose mode.         

6. cd ..

  • Moves to the parent directory.

7. touch 'filename.extension'

  • Creates an empty file.

Installing Packages

1. yum

  • Installs packages using yum.

 Example: 
   
 yum install package_name        

2. yum info

  • Displays information about a package.

Example:

 yum info package_name           

3. yum remove

  • Removes a package.

Example: 

yum remove package_name        

4. ./filename

  • Installs a package from a local file.

Disk Usage Commands

1. du

  • Summarizes disk usage.

Example:

du path_of_directory           

2. du -h

  • Displays disk usage in a human-readable format.

Example:

du -h path_of_directory        

3. du -sh

  • Summarizes total disk usage.

Example:

du -sh name_of_directory           
### System & Hardware Information

1. uname -a

  • Displays all system information.

2. uname -s

  • Prints the kernel name.

3. uname -r

  • Prints the kernel release version.

4. uname -m

  • Prints the machine's hardware name.

5. uname -o

  • Prints the operating system name.

Mastering these essential commands is a significant step towards becoming proficient in Linux and advancing in your DevOps journey. Stay tuned for tomorrow’s update where we’ll dive into more advanced Linux topics!

#DevOps #Linux #Day3 #LinuxCommands #ContinuousLearning #TechJourney

要查看或添加评论,请登录

pratik davda的更多文章

社区洞察

其他会员也浏览了