TestingDocs.com
    Software Testing website
    • Automation
      • Selenium
      • JBehave Framework
    • Tutorials
      • MySQL Tutorials
      • Testlink
      • Maven
      • Git
    • IDEs
      • IntelliJ IDEA
      • Eclipse
    • Flowcharts
      • Flowgorithm
      • Raptor
    • About

    Linux commands

    Common File Commands in Linux

    Introduction

    In this post, we will learn some commonly File commands on Linux operating system.  We can use these commands in the bash terminal or in bash scripts.

    Create Directory

    mkdir command is used to create a directory in Linux. To create a directory called ubuntu, type the following command in the terminal window:

    $ mkdir ubuntu

    The new directory would be created under the present working directory. To navigate we can use the cd command.

     

    Remove Directory

    rmdir command is used for removing the directory.

    :~$ rmdir ubuntu

    Common errors while using this command is: providing a non-existent directory name or trying to remove a directory that is not empty.

    Create File

    There are so many ways to create a file in Linux. Using touch command, cat command, etc.

    touch command creates a new file if it doesn’t exist in the directory. If the file already exists then it will change the modification timestamp of the file. To learn more about touch command use

    $ man touch

    To create a new file with touch, use the following command:

    $ touch sample.txt

    Copy File

    cp command is used in Linux to copy the file. This command copies the file to the new location.

    Format of the command is

    cp  file <new location>

    $ cp toBecopied.txt ubuntu/

    Move File

    mv command can be used to move the file to a new location.

    Remove File

    We can use the rm command to remove a file.

    $ rm -rf sample.txt

    To know the flags and to learn more about the command, use the below command:

    $ man rm

    —

    Linux Commands

    Linux Basic Commands Tutorial page:

    https://www.testingdocs.com/linux-basic-commands-tutorial/

    More Information on Ubuntu Linux:
    https://ubuntu.com/

    Related Posts

    sudo auth log entry

    Linux commands /

    sudo Linux Command with Examples

    su linux command

    Linux commands /

    su Linux Command

    ls linux command

    Linux commands /

    ls Linux Command with Examples

    touch create file

    Linux commands /

    touch Linux Command

    change directory Linux

    Linux commands /

    cd(Change Directory) Linux Command with Examples

    ‹ su Linux Command› sudo Linux Command with Examples

    Recent Posts

    • ChatGPT Plans Free and PlusChatGPT Subscription Plans
    • Stellar Converter for Database ToolStellar Converter for Database
    • Stellar MySQL Log AnalyzerStellar Log Analyzer for MySQL
    • Stellar Repair for MySQLStellar Repair for MySQL
    • ChatGPT IntroductionChatGPT Capabilities
    • How to secure your SQL Database: Tips and Tricks
    • ChatGPT4 Conversational AI FeaturesChatGPT4 Conversational AI Features
    • Trends in Software EngineeringShaping the Future of Development: Exploring Key Trends in Software Engineering
    • Java PerformanceImproving Java Performance with Multithreading
    • QDrant Vector DatabaseOpen-source Vector Databases
    • Difference between PHP and JavaScript?
    • Bing AI Browser Web ContentBing Conversation Styles
    • ChatGPT PreviewChatGPT Introduction
    • Open Source AI Frameworks TensorFlowOpen Source AI Frameworks
    • Artificial Intelligence Tools

    Back to Top

    Links

    • Contact
    • Privacy Policy
    • Cookie Policy

    www.TestingDocs.com