Skip to main content

Basic Linux/unix Commands - Part 2

 Basic Linux/unix Commands - Part 2

Let we start the basic Linux/unix Commands - Part 2

find Command 

               1. find command is used to search the location of a particular file.

               2. The syntax is presented below.


               3. For instance, to find a file named file.txt in the home directory, type: 


Output


Note: In coming section, we post the find command with briefly. 

locate command 

               1. The locate command is similar to find command, but it takes only one argument.


For instance,


Output


               2. The locate command uses a database of all the system's possible files and directories to search. 

               3. The find command is significantly slower than the locate command. 

               4. The find command, on the other hand, is far more powerful and can be used when locate fails to deliver the needed results.

uptime Command

               1. The uptime command reports the amount of time your system has been running since it was turned on the previous time. 

               2. You can use the uptime command without specifying any parameters. 

               3. The current time, number of users with active sessions, and system load averages for the previous 1, 5, and 15 minutes will all be displayed in uptime.


               4. How to Check the Uptime of a Linux Server? By using this below command, you can able to filter it,



               5. By using below mentioned command, you can able to Check the Starting Time of a Linux Server 


uname Command 

               1. The uname command displays basic information about your operating system and the hardware it runs on. 

               2. Without any options, it will show like this only,


              3. Add the -a option to disclose full information about the kernel, including its name, version, and release, as well as the machine, processor, and operating system. 


               4. The -r option is used to display the kernel release.


               5. Use the -v option to get the kernel version.


              6. Check out the following section for more options. 


whoami Command 

               As illustrated here, the whoami command displays the presently logged-in user.


w Command

              The w command displays information about the users who are currently logged in and also show the uptime, load average.


free Command 

             1. The free command displays statistics on swap and main memory consumption. 

             2. It shows the overall memory size, used memory, and available memory.


               3. Add the -h option to display information in a more human-readable style.


               4. The most important options 

                  -b, – -bytes: The memory is displayed in bytes.
                  -k, – -kilo: It shows the memory size in kilobytes (default). 
                  -m, – -mega: It displays the amount of memory in megabytes. 
                  -g, – -giga: It displays the amount of memory in gigabytes. 
                  - tera: It shows how much RAM is in terabytes. 
                  -h, – –human: It will display a format that is readable by humans. 

top Command 

               1. The top command is used to display the current state of Linux processes. 

               2. It is one of the most important monitoring tool. 

               3. It gives you a dynamic, real-time view of the system as it runs. 

               4. This command usually displays the system's summary information as well as a list of processes or threads that the Linux Kernel is currently managing.



               5. Let's have a look at what each column indicates in more detail. 

                   PID - This is the process ID that identifies a process. 

                   USER – This is the username of the user who started the process or spawned it. 

                   PR – This is the task's scheduling priority. 

                   NI – This is the process or task's pleasant value. 

                   VIRT – This is the amount of virtual memory that a job consumes. 

                   RES - The memory that a process uses.

                   SHR - The amount of memory that a process uses and that is shared with other processes. 

                   The process's CPU use is expressed as a percentage. %

                   RAM – The percentage of RAM used. 

                   TIME+ – A process's total CPU time since it began operating. 

                   COMMAND – This is the name of the process. 

               6. Run the command to see processes specific to a single user.


ps Command 

               1. The ps programmer displays the PIDs of all presently active processes in the current shell.


               2. Use the -u option to list the user's presently executing processes, as shown.


sudo Command 

               1. sudo access - similar to root privileges 

               2. The sudo command allows you to run applications with another user's security rights (by default, as the superuser). 

               3. sudo is a command-line tool that allows a non-administrative user to conduct administrative or elevated functions.

               4. Make that the user has been added to the sudo group before using the command. 

               5. To update the package lists, for example, run the command:


               6. You will be asked for a password before the task can be completed.


That’s It! In this topic, we have covered Basic Linux/unix Commands - Part 2







Comments

Popular posts from this blog

Configuring Multipathing and Setting Up Storage on a Linux Server:

Ensuring high availability and redundancy in your storage environment is crucial for maintaining system reliability. Multipathing allows you to distribute I/O across multiple paths, providing fault tolerance and improved performance. This guide covers the entire process from configuring multipathing to setting up physical volumes (PVs), volume groups (VGs), and logical volumes (LVs) with different sizes.  Prerequisites:   Before you begin, make sure you have the following:  Administrative access to the server  Multipath tools installed on your server  Basic understanding of Linux commands  Step-by-Step Guide:   1. Install Multipath Tools:   Ensure that you have the necessary multipath tools installed: # sudo yum install device-mapper-multipath yum: Package manager for RHEL-based distributions.  install: Command to install a package.  device-mapper-multipath: Name of the package to be installed.  2. Enable and Start t...

Configure SSH Between Compute Nodes in OpenStack:

To perform operations like live migration or resizing an instance between compute nodes in OpenStack, SSH key-based authentication must be configured between all the nodes. This ensures smooth communication for moving instance disks without encountering errors like "Permission denied." Follow these steps to configure SSH between compute nodes:  Step 1: Obtain or Generate SSH Key Pair: On the first compute node, either use the existing SSH key pair located in /root/.ssh/id_rsa (private key) and /root/.ssh/id_rsa.pub (public key) , or generate a new key pair if none exists: # ssh-keygen -t rsa -b 2048 This will create a private key (id_rsa) and a public key (id_rsa.pub) in the .ssh directory.  Step 2: Disable SELinux (Optional): If you are using SELinux, switch to permissive mode temporarily to avoid permission issues: # setenforce 0 Step 3: Enable Login for the nova User: Ensure that the nova user has shell access: # usermod -s /bin/bash nova Switch to the nova user...

What is the OSI Model, and how does it work?

  What is the OSI Model, and how does it work? OSI - Open Systems Interconnection                1. The Open Systems Interconnection (OSI) model is a virtual model for describing the internal structure and technologies of a computer system.                2. Network communication is divided into seven tiers according to the OSI Model. These layers are helpful in detecting network problems.                3. A lot of unneeded work can be avoided if the problem can be focused down to one specific layer of the model. Seven layers of the OSI Model 7. Application layer                1. In the OSI model, the Application Layer is the layer closest to the end user.                2. It receives data directly from users and shows the information to them.           ...