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

How to Generate and Use SSH Keys in OpenStack:

This guide walks you through generating SSH keys from scratch, configuring them in OpenStack, and using them for secure instance access. These steps will help you manage your OpenStack instances securely and efficiently using SSH key pairs.  Step-by-Step Guide: Generating and Using SSH Key Pairs in OpenStack:  Step 1: Generate SSH Key Pair Locally:  To begin, you need to generate an SSH key pair on your local machine. This pair consists of a public and a private key.  Generate a new SSH key pair on your local system (Linux/macOS). Run the following command in your terminal: # ssh-keygen -t rsa -b 2048 Enter the file name for the key: When prompted, provide the file name and path to save the key. By default, it will be saved in ~/.ssh/id_rsa . You can press Enter to accept the default location.  Set a passphrase (optional): You can choose to set a passphrase for additional security or leave it blank for easy access.  This will create two files: id_rsa:...

Install Apache Guacamole on Ubuntu 22.04

  Install Apache Guacamole on Ubuntu 22.04 Apache Guacamole Installation Guide Remote Desktop Gateway for Ubuntu 22.04 Ubuntu 22.04 Remote Desktop What is Apache Guacamole? Apache Guacamole is a clientless remote desktop gateway that supports standard protocols like VNC, RDP, and SSH. Thanks to HTML5, once Guacamole is installed on a server, all you need to access your desktops is a web browser. Clientless No plugins or client software needed Secure ...