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

How to Check Hardware Details on Linux:

  Whether you're troubleshooting hardware issues, planning an upgrade, or just curious about your system’s specifications, Linux provides a variety of commands to gather comprehensive hardware information. Here are some essential commands: 1.  Use lscpu to get detailed information about the CPU, including architecture, cores, threads, and CPU speeds. # lscpu                                                 2. The lshw command provides a complete overview of hardware configuration, including CPU, memory, storage, and network. You’ll likely need superuser privileges to run it. # sudo lshw                                                                               ...

testing

09052025 T-1 { "volume_groups" : { "vgroot" : { "vgsize" : "304G" , "fs_type" : "xfs" } } , "logical_volumes" : { "root" : { "lvroot" : { "vgname" : "vgroot" , "lvname" : "lvroot" , "lvsize" : "12G" , "mountpoint" : "/" , "purpose" : "root filesystem" , "disk" : 1 , "partition" : 2 } } , "swap" : { "lvswap" : { "vgname" : "vgroot" , "lvname" : "lvswap" , "lvsize" : "4G" , "mountpoint" : "NA" , "purpose" : "swap" , "disk" : 1 , "partit...

How Virtual Machines are Created in OpenStack: A Complete Backend Workflow:

When creating a Virtual Machine (VM) in OpenStack, several components work together in the backend to provision the instance. Here's a step-by-step explanation of how the process flows: 1. User Request Interface Used : The user initiates the VM creation through the Horizon Dashboard (web UI), the OpenStack CLI ( openstack server create ), or the OpenStack API. Request Information : The request includes parameters such as: VM name. Image (the operating system or custom image to boot from). Flavor (the compute, memory, and storage specifications). Network (which network the VM will be connected to). Security Groups (firewall rules). Key Pair (for SSH access). 2. API (Nova API) Component : Nova (Compute service). Process : The request is received by the Nova API , which validates the request (checks if the requested resources like the image, flavor, and network exist). If valid, the API creates an entry in the database for the new instance. Nova's Role : Nova is the core service r...