Skip to main content

Basic Linux/unix Commands - Part 1


Basic Linux/Unix Commands - Part 1


Let we start the basic Linux/unix commands - part 1 

pwd Command

               1. The command pwd displays the current working directory. 

              2. Simply use the pwd command to determine your current working directories. 

Output
 According to the output, the current home directory .

cd Command
                1. cd command is used to navigate the directories. 
                2. For examples : Run the following command to go to the /var/log file path.

Output

               3. cd . . is used to get back one step form the current directory. 

               4. cd is used to get back to the home directory.


ls Command
                  The ls command is used to list existing files or sub-folders in a directory.

Output

   -a option is used to show the hidden files.

touch Command
              1. The touch command is used to create zero size file . 
syntax

             2. Run the following command to create a sample.txt file.
and use ls command to list the created file.

cat Command 

               cat command is used to view a specific file's contents .

syntax


mv Command 

                 1. To transfer or rename files, by using the mv command.



                 2. When renaming a file, you may not be alerted that it may overwrite an existing file. 

                 3. So, when issuing mv, always use the '-i' option as a precaution .


                 4. While moving the files, better to move more than 2 arguments like this,


                 5. If ~/Test already exists, mv will copy the files there. 

                 6. If it doesn't exist, an error notice will appear, like this, 


cp Command 

                1. The cp command is used to copies a file from one location to another location. 

                2. This command will be create duplicate file from original file. 

Syntax


                3. For examples, Copy the file sample.txt to the Public/docs/ directory


mkdir Command 

                 1. Use the mkdir (make directory) command to create a new directory.


                2. Let's make a new directory called project.


                3. Use the -p argument to create a directory within another directory as shown below. 


rmdir Command 

                1. The rmdir command is user to deletes a directory that is empty.

                2. To delete or remove the tutorial directory, for example, use the command


                3. If you try to delete a directory that isn't empty, you'll get an error message like the one below.


rm Command

                1. To delete a file, use the rm (remove) command. 

Syntax


                2. Example: Run the command to delete the file.txt file.


                3. Using the -R option, you can recursively remove or delete a directory.

                4. It's possible to delete an empty or non-empty directory also by using -R option. 



                5. Example: To delete the project directory, use the command




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











Comments

Popular posts from this blog

temp-1

  🔧 vast_id Configuration Key: vast_id Description This section defines the VAST ID , a unique numeric identifier used by internal systems for asset tracking, automation, or integration with enterprise management platforms. It helps associate the server with inventory records, monitoring tools, or deployment workflows. ✅ Used during provisioning to register the system in centralized databases or orchestration systems. JSON Format json 1 "vast_id" : 12194 ✅ Can also be provided as a string: json 1 "vast_id" : "12194" Field Reference vast_id String or Integer Unique identifier for the system in VAST (Verizon Asset Systems Tracker) 12194 ✅ Must be non-empty and numeric — leading zeros may be stripped depending on system. Validations Enforced vast_id  is required and must be a non-empty string or integer Ensures the field is present and contains usable data If  vast_id  is a string, it must not be blank or whitespace-only Prevents " " , "...

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...

temp

 {   "_id": {     "$oid": "6841e4b0fd270b2ab92d7eaa"   },   // 📌 [Auto-generated]   // Description: Unique system identifier for internal use (MongoDB ObjectId).   // Type: ObjectId (string)   // Required: No (automatically handled)   "vast_id": "21452",   // 📌 [Required]   // Description: Your unique request ID or reference number.   // Type: string   // Format: Numeric string (e.g., "21452")   // Example: "21452"   "env": "dev",   // 📌 [Required]   // Description: The environment where the VM will be deployed.   // Type: string   // Allowed values: "dev", "qa", "uat", "prod"   // Example: "dev" for development, "prod" for production   "ver": "0.2",   // 📌 [Do Not Modify]   // Description: Template version. Used by automation to ensure compatibility.   // Type: string   // Format: Semantic versioning (e.g., "...